Question

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)

Was it helpful?

Solution

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

OTHER TIPS

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
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top