Your example indicates that you are creating a virtual function. Default arguments in virtual (especially pure) functions are not a good idea, because they are not considered when you call an overridden function.
struct A {
virtual void f(int = 4711) = 0;
};
struct B : A {
virtual void f(int) { /* ... */ }
};
Now, if someone calls f on a B object, he will have to provide the argument - the default isn't used. You would have to duplicate the default argument in the derived class, which creates ugly redundancies. Instead, you can use the non-virtual interface pattern
struct A {
void f(int a) {
int out;
f(a, out);
}
void f(int a, int &out) {
doF(a, out);
}
protected:
virtual void doF(int a, int out&) = 0;
};
The user can now call f with one, and with two arguments, from whatever class type he calls the function, and the implementers of A don't have to worry about the default argument. By using overloading instead of default arguments, you don't need to break your head around lvalues or temporaries.