I want to make an argument for one of the member functions optional. When no argument is provided, it would use an member variable.
However, when I tried to compil
Default values are not part of the prototype, i.e. they're resolved by the caller, not by the function itself. So firstly, they have to be visible to the caller. Secondly, they cannot access protected members of the class. (I'm pretty sure you can't even use public members as defaults, but I'm too tired to check.)
To solve the problem, use chained overloads as suggested in other answers.