From 7d0b49b2984a18906cde3263b69cab20f3125994 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 12 Aug 2018 00:40:54 +0200 Subject: [PATCH 1/3] [class.virtual] Define 'virtual function' --- source/classes.tex | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index 8087f545de..ad60d7e183 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3764,6 +3764,13 @@ \indextext{type!polymorphic}% \pnum +\indextext{virtual function|see{function, virtual}}% +A non-static member function is a \defnx{virtual function}{function!virtual} +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 +3781,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. From 68159a118c7527db9e1f111a3b0b5f459a962df0 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 8 Oct 2018 17:48:47 -0700 Subject: [PATCH 2/3] Use \defnadj --- source/classes.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index ad60d7e183..2d21adf28e 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3764,8 +3764,7 @@ \indextext{type!polymorphic}% \pnum -\indextext{virtual function|see{function, virtual}}% -A non-static member function is a \defnx{virtual function}{function!virtual} +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 From 9ab15f7282e1741a096746fc220e707470ca861e Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 8 Oct 2018 17:51:04 -0700 Subject: [PATCH 3/3] Move footnote after period. --- source/classes.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index 2d21adf28e..95ac429b50 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3767,9 +3767,9 @@ 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 +(see below).\footnote{The use of the \tcode{virtual} specifier in the declaration of an overriding function is valid but redundant (has empty -semantics).}. +semantics).} \begin{note} Virtual functions support dynamic binding and object-oriented programming. \end{note} A class that declares or inherits a virtual function is