virtual function specifier

The virtual specifier specifies that a non-static member function is virtual and supports dynamic dispatch. It may only appear in the decl-specifier-seq of the initial declaration of a non-static member function (i.e., when it is declared in the class definition).

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
CWG 258C++98a non-const member function of a derived class might becomevirtual because of a const virtual member function of its basevirtuality also require cv-qualifications to be the same
CWG 477C++98a friend declaration could contain the virtual specifiernot allowed
CWG 1516C++98the definition of the terms “virtual function call"and “virtual call” were not providedprovided

# See also