1

Text book extract:

Anytime we redefine an overloaded function name from the base class, all the other versions are automatically hidden in the derived class.

I get this. But, what is the reasoning behind this. Or is it like that's how they designed C++?

Grant
  • 143
  • 1
  • 1
  • 6

1 Answers1

1

It's to avoid accidentally providing access to/calling base class methods you don't intend to call. If you explicitly want to ALSO provide the base class methods the language provides that syntax with using Base::function_name;. Alternately if the functions are orthogonal in functionality, don't name them the same thing.

Mark B
  • 95,107
  • 10
  • 109
  • 188