C++: rationale behind hiding rule

It’s an hairy question, but apparently the idea is that this hiding feature helps avoiding subtle bugs when making changes to a base class (that could otherwise “steal” calls that before would have been handled by the derived class). Still a change in a base class can influence the result of compilation of derived classes so I don’t think I understand 100% this explanation.

I agree that this topic is so frequently discussed that probably the hiding actually increases the amount of “surprises” in C++ programmers.

A detailed discussion about this issue can be found here

Leave a Comment