August 2012
Intermediate to advanced
976 pages
30h 17m
English
As we’ve seen, functions declared in an inner scope do not overload functions declared in an outer scope (§6.4.1, p. 234). As a result, functions defined in a derived class do not overload members defined in its base class(es). As in any other scope, if a member in a derived class (i.e., in an inner scope) has the same name as a base-class member (i.e., a name defined in an outer scope), then the derived member hides the base-class member within the scope of the derived class. The base member is hidden even if the functions have different parameter lists:
struct Base { int memfcn();};struct Derived : Base { int memfcn(int); // hides memfcn in the base};Derived d; Base b;b.memfcn(); // ...
Read now
Unlock full access