Using all base class overloads

When a subclass overrides the base class method, all overloads of the base class are not available from the subclass. To use them, a string must be added to the subclass using BaseClass::Method;.

Is there a quick way to overload the base layer overloads for ALL overridden methods? (no need to explicitly specify using ...for each method)

+3
source share
2 answers

No. This is only possible with an ad usingand only works with individual methods.

+6
source

, , ...

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

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

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

Source: https://habr.com/ru/post/1718998/


All Articles