Why doesn't C ++ allow a parameter to be the default argument?
One frequently cited potential justification for this limitation is that allowing parameters as default arguments would require imposing at least partial ordering on the parameter estimates. Parameters that are used as default arguments in other parameters must be evaluated first.
Meanwhile, C ++ continues to follow the original approach to parameter estimation: parameters are evaluated in an unspecified order.
The same reasoning can be used to explain why class members cannot be referenced in the default arguments for member functions: this imposes some ordering requirements when evaluating a hidden parameter
source to share