views:

107

answers:

2

When a subclass overrides a baseclass's method, all of the baseclass's overloads are not available from the subclass. In order to use them there should be added a using BaseClass::Method; line in the subclass.

Is there a quick way to inheirt the baseclass's overloads for ALL of the overridden methods? (not needing to explicitly specify using ... for each method)

+5  A: 

No. It's only possible with a using declaration and that only works with the individual methods.

Troubadour
I want to emphasize `using declaration`. This is the keyword to search for more details, as `using` is used in several different contexts in C++.
gimpf
A: 

You can access base class's method , by explicitly specifying scope of the class when you want to call method ..

e.g

class Base{ public: void foo(){} };

class Derived : public Base { public: void foo(int){} };

int main() { Derived d; d.Base::foo(); // like this }

Ashish