Pét*_*rök 15
因为忽略返回值是合法的,因此编译器不总是能够真实地决定调用哪个重载.
考虑
void foo();
int foo();
long foo();
...
foo(); // which function to call here???
Run Code Online (Sandbox Code Playgroud)
但即使分配了返回值,也可能无法在需要转换时在等效重载之间进行选择:
double d = foo(); // and here???
Run Code Online (Sandbox Code Playgroud)