When implementing a pure virtual function in C++, is there a best-practices guideline that says the implementation should also be made virtual? What is the rationale?
class Interface
{
public:
virtual void foobar() = 0;
};
class Concrete
: public Interface
{
public:
virtual void foobar();
};
It does not matter.
void foobar()inConcreteisvirtualregardless whether you declare it as such and it overrides thevoid foobar()inInterface.