I’m not sure if this is even remotely possible but here it goes:
is it possible for a derived class to NOT inherit a base class function ( without making them private/protected or overriding them an empty definition ) ?
Something like:
class base{
public:
virtual int f();
virtual int g();
};
class derived1: public base //<-- this would inherit f() but not g()
class derived2: public base //<-- this would inherit g() but not f()
No it’s not. And even if it were, it would be a design flaw.
If
derived1is-abase, why shouldn’t it inherit all its members? That’s what inheritance represents.