I understand virtual
in the context of a member function, like virtual void frob()
. But what does it mean in the context of the class declaration, like class Foo : public virtual Bar
?
For a given method there are 8 cases stemming from the presence or absence of virtual in the following three locations: 1) a superclass's functions; 2) the inheritance chain for this class; 3) this class's functions.
I think I understand how 1) and 3) interact, but 2) seems redundant. Is it? What am I not understanding?