For code compliant with C++98 or C++03 standards, declaring overriding virtual functions with the virtual
keyword removes
the need to check the base class to determine whether a function is virtual.
Noncompliant code example
class Base
{
virtual void f();
};
class Derived : public Base
{
void f(); // Noncompliant, implicitly declared "virtual"
};
Compliant solution
class Base
{
virtual void f();
};
class Derived : public Base
{
virtual void f(); // Compliant, explicitly declared "virtual"
};