Assume the following:
class A{ virtual void f() = 0; };
class B{ virtual void f() = 0; };
Can I do the following somehow?
class C : public A, public B
{
virtual void A::f(){ printf("f() from A"); }
virtual void B::f(){ printf("f() from B"); }
};
So now I can do???
A* pa = new C();
pa->f(); // prints f() from A;
B* pb = (B*)pa;
pb->f(); // prints f() from B;
Thanks!!!