overwrite is not standard conception in C++, most time, you can call it
name hiding. There are two things: The first one is If you redefine the same
name non-virtual function in both base and child classes, you can’t use
dynamic binding, just static binding. Detail can be seen in Namespace
section.
A class name or enumeration name can be hidden by an explicit declaration
of that same name âĂŤ as an object, function, or enumerator âĂŤ in a
nested declarative region or derived class.
If you try to overload base member function. "Name hiding" will happen.
Overloading just happens in the same name scope, not in thehierarchy. So in this way, any same name is base class will not visible in
derived class. You can use using keyword to add it in your derived class.
Then It will compile