class Base
{
public:
virtual void f(int)
{
printf("Base f(int)\n");
}
virtual void f(int, int)
{
printf("Base f(int, int)\n");
}
};
class Der : public Base
{
public:
using Base::f;
virtual void f(double)
{
printf("Der f(double)\n");
}
};
So in this case I am able to use both functions from the base class. But is it possible to allow using in derived class only certain overloaded method from base? For example allow to use only f(int), but not f(int, int).
It is not possible to unhide base class methods with the using
directive selectively. Unfortunately, it's all or nothing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With