* (e-mail address removed):
I know there exists a good reason why the designers of c++ decided that
function hiding should exist. But I don't know why. Can anybody provide
a good reason/example of a case where function hiding saves the day. I
know there exists one, I'd just like to hear about it.
IMO there is no convincing reason. However, there is a reason. Namely
the "fragile base class" problem, in this case that the mere addition of
a new member function in a base class should not by default affect
client code using a member function of that name from a derived class,
as it could do without the hiding (think overload resolution).
I find this reason less than convincing because (1) the hiding does not
help when the derived class offers no member function of that name, (2)
the hiding does not help with the "fragile base class" problem in
general, merely a subtle aspect that is not much of a practical problem,
and (3) the hiding is very counter-intuitive to most programmers (an
extreme case is where an automatically generated assignment operator in
a derived class hides a custom assignment operator in a base class), and
forces us to write extra, silly 'using'-declarations, instead of perhaps
with the opposite default behavior having to write 'hide'-declarations,
or simply acknowledging that the full effective interface of a derived
class really does include stuff from base classes.
Not much we can do about now, though.