There's no way in C
to specify that one of the C::fn()
implementations overloads A::fn()
(and presumably another overloads
B::fn()
). What you can do, however, is introduce an intermediate
class which “renames” the functions, something like:
class RemapA : public A
{
virtual void fnInA() = 0;
public:
virtual void fn()
{
fnInA();
}
};
class RemapB : public B
{
virtual int fnInB() = 0;
public:
virtual int fn()
{
return fnInB();
}
};
class C : public RemapA, public RemapB
{
virtual void fnInA() { /* ... */ }
virtual void fnInB() { /* ... */ }
// ...
};