For code compliant with {cpp}98 or {cpp}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"
};
----


== See

* MISRA {cpp}:2008, 10-3-2 - Each overriding virtual function shall be declared with the virtual keyword.

=== See Also

* This rule will only trigger with code compliant with {cpp}98 and {cpp}03. For code compliant with {cpp}11 and above see S3471


ifdef::env-github,rspecator-view[]
'''
== Comments And Links
(visible only on this page)

include::comments-and-links.adoc[]
endif::env-github,rspecator-view[]
