I\'ve found this question, and I\'m completely baffled.
The answer says b
is invalid, \"Non-static members can not be used as default arguments.\". That
Default arguments aren't evaluated at compile time. They're evaluated each time a function call requires them. They can be any expression that's valid in the context of the function declaration and has a suitable type, except that it can't use any other parameters (including this
, in the case of a member function).
That restriction is because the evaluation order isn't specified, so there's no way to ensure a parameter value is available if it were needed to evaluate another argument.