diff --git a/source/classes.tex b/source/classes.tex index 8087f545de..95ac429b50 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3764,6 +3764,12 @@ \indextext{type!polymorphic}% \pnum +A non-static member function is a \defnadj{virtual}{function} +if it is first declared with the keyword \tcode{virtual} or +if it overrides a virtual member function declared in a base class +(see below).\footnote{The use of the \tcode{virtual} specifier in the +declaration of an overriding function is valid but redundant (has empty +semantics).} \begin{note} Virtual functions support dynamic binding and object-oriented programming. \end{note} A class that declares or inherits a virtual function is @@ -3774,13 +3780,11 @@ \tcode{Base} and in a class \tcode{Derived}, derived directly or indirectly from \tcode{Base}, a member function \tcode{vf} with the same name, parameter-type-list\iref{dcl.fct}, cv-qualification, and ref-qualifier -(or absence of same) as -\tcode{Base::vf} is declared, then \tcode{Derived::vf} is also virtual -(whether or not it is so declared) and it \term{overrides}\footnote{A function with the same name but a different parameter list\iref{over} +(or absence of same) as \tcode{Base::vf} is declared, +then \tcode{Derived::vf} \term{overrides}\footnote{A function +with the same name but a different parameter list\iref{over} as a virtual function is not necessarily virtual and -does not override. The use of the \tcode{virtual} specifier in the -declaration of an overriding function is legal but redundant (has empty -semantics). Access control\iref{class.access} is not considered in +does not override. Access control\iref{class.access} is not considered in determining overriding.} \tcode{Base::vf}. For convenience we say that any virtual function overrides itself.