爲什麼下面的代碼總是輸出「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;
}