为什么调用不合适的重载函数?

A. *_*ghi 4 c++ overloading

为什么下面的代码总是打印"type is double"?(我在StackOverflow中看到过这段代码)

#include <iostream>


void show_type(...) {
    std::cout << "type is not double\n";
}

void show_type(double value) { 
    std::cout << "type is double\n"; 
}

int main() { 
    int x = 10;
    double y = 10.3;

    show_type(x);
    show_type(10);
    show_type(10.3);
    show_type(y);


    return 0;
}
Run Code Online (Sandbox Code Playgroud)

Chr*_*ckl 8

http://en.cppreference.com/w/cpp/language/overload_resolution说:

标准转换序列总是优于用户定义的转换序列或省略号转换序列.