class A{ public: void foo(int x) { cout << \"foo with one\\n\"; } void foo(int x, int y=10) {
I think you can't. Because function/operator overloading is resolved by compiler at compile time. So overloading a function just by providing a default argument will cause ambiguity and compiler error.