I have the following snippet of code:
void eval(void*) { std::cout << "hello world\n"; }
void eval(...) { }
int main(int argc, char *argv[])
{
std::cout << "0: "; eval(0);
std::cout << "1: "; eval(1);
return 0;
}
which gives the output:
0: hello world
1:
My question is: Why does overload resolution select the void* version of eval instead of the ... version for 0, but not for 1? It seems like in both cases it could infer that the argument is an int and take the variadic version.