class A{ public: void foo(int x) { cout << \"foo with one\\n\"; } void foo(int x, int y=10) {
Think about it - at compile time the compiler has to decide what one to chose. I cannot unless you supply both parameters. So the compiler has no choice but to throw its hands up and say that try again with code that does not require Mystic Meg.