Should one mark explicitly as virtual all overrides in descendant classes at any level?
class Base {
// ...
protected:
virtual void to_be_derived() const; // First level to introduce this virtual function
};
class LevelOne : public Base {
// ...
protected:
// virtual??
void to_be_derived() const;
};
class LevelTwo : public levelOne {
// ...
protected:
// virtual??
void to_be_derived() const;
};
I didn't see the Prefixing virtual keyword to overridden methods which answers my question. In particular, one of the answers there was updated to reflect current usage with respect to c++11, especially the override
keyword that I didn't know about!
EDIT: I'd rather accept another answer from the linked question for post-c++11 code.