#include #ifdef TEST_1 double hat(int a = 1, double c = 4.0, double e, int d) { return a * c * e * d; } #endif int foo(char x, char y = 'a') { cout << "foo 1" << endl; return 0; } void foo(int x) { cout << "foo 2" << endl; } // ambiguous with with foo(int) // double foo(int x) { cout << "foo 3" << endl; return 0.0; } int foo(char x) { cout << "foo 4" << endl; return 0; } int main(void) { #ifdef TEST_1 cout << hat(2, 3.0, 5) << endl; // What gets called? #endif foo('a', 'b'); // illegal: ambiguous call // double x = foo(foo('b')); double y = foo(foo('b', 'b')); return 0; }