The following commands will not compile:
struct A
{
virtual void foo() = 0;
};
struct B
{
virtual void foo() {}
};
struct C : A, B
{
using B::foo;
};
C c;
C ++ considers an Cabstract class because it failed to directly override a pure virtual one foo. What is the reason for this? I can, of course, throw an exception out of A::fooinstead of making it pure virtual, but is there a better design template?
source
share