I have the following interface A:
class A
{
virtual void f() = 0;
}
I also have interfaces B, C that are derived from A:
class B : public A
{
...
}
class C : public A
{
...
}
class X implements B and Y implements C. also both of them are derived from class D
class X : public D, public B {...}
class Y : public D, public C {...}
Both of these classes have the same implementation of A::f() so i moved this implementation to D. Now when i try to instantiate X or Y, i get an error that f() is not implemented for them.
It seems that although the same method is implemented in the base class, the compiler does not recognise it as an implementation of the pure virtual function. What should i do?