Skip to content

Commit e9ac689

Browse files
committed
[class.mfct.non-static], [class.this] Define and use cv member function.
Fixes #447.
1 parent 8d3cba2 commit e9ac689

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

source/classes.tex

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -989,15 +989,18 @@
989989
\end{example}
990990

991991
\pnum
992+
\indextext{member function!const}%
993+
\indextext{member function!volatile}%
994+
\indextext{member function!const volatile}%
992995
A non-static member function may be declared \tcode{const},
993996
\tcode{volatile}, or \tcode{const} \tcode{volatile}. These
994997
\grammarterm{cv-qualifier}{s} affect the type of the \tcode{this}
995998
pointer~(\ref{class.this}). They also affect the function
996999
type~(\ref{dcl.fct}) of the member function; a member function declared
997-
\tcode{const} is a \term{const} member function, a member function
998-
declared \tcode{volatile} is a \term{volatile} member function and a
1000+
\tcode{const} is a \defn{const member function}, a member function
1001+
declared \tcode{volatile} is a \defn{volatile member function} and a
9991002
member function declared \tcode{const} \tcode{volatile} is a
1000-
\term{const volatile} member function.
1003+
\defn{const volatile member function}.
10011004
\begin{example}
10021005

10031006
\begin{codeblock}
@@ -1007,8 +1010,8 @@
10071010
};
10081011
\end{codeblock}
10091012

1010-
\tcode{X::g} is a \tcode{const} member function and \tcode{X::h} is a
1011-
\tcode{const} \tcode{volatile} member function.
1013+
\tcode{X::g} is a const member function and \tcode{X::h} is a
1014+
const volatile member function.
10121015
\end{example}
10131016

10141017
\pnum
@@ -1030,17 +1033,14 @@
10301033
\indextext{\idxcode{this}!type of}%
10311034
The type of \tcode{this} in a member function of a class \tcode{X} is
10321035
\tcode{X*}.
1033-
\indextext{member function!\idxcode{const}}%
10341036
If the member function is declared \tcode{const}, the type of
10351037
\tcode{this} is \tcode{const} \tcode{X*},
1036-
\indextext{member function!\idxcode{volatile}}%
10371038
if the member function is declared \tcode{volatile}, the type of
10381039
\tcode{this} is \tcode{volatile} \tcode{X*}, and if the member function
10391040
is declared \tcode{const} \tcode{volatile}, the type of \tcode{this} is
10401041
\tcode{const} \tcode{volatile} \tcode{X*}.
1041-
\indextext{member function!\idxcode{const}}%
1042-
\begin{note} Thus in a \tcode{const} member function, the object for which the function is
1043-
called is accessed through a \tcode{const} access path. \end{note}
1042+
\begin{note} Thus in a const member function, the object for which the function is
1043+
called is accessed through a const access path. \end{note}
10441044
\begin{example}
10451045

10461046
\begin{codeblock}
@@ -1056,14 +1056,14 @@
10561056

10571057
The \tcode{a++} in the body of \tcode{s::h} is ill-formed because it
10581058
tries to modify (a part of) the object for which \tcode{s::h()} is
1059-
called. This is not allowed in a \tcode{const} member function because
1059+
called. This is not allowed in a const member function because
10601060
\tcode{this} is a pointer to \tcode{const}; that is, \tcode{*this} has
10611061
\tcode{const} type.
10621062
\end{example}
10631063

10641064
\pnum
10651065
Similarly, \tcode{volatile} semantics~(\ref{dcl.type.cv}) apply in
1066-
\tcode{volatile} member functions when accessing the object and its
1066+
volatile member functions when accessing the object and its
10671067
non-static data members.
10681068

10691069
\pnum
@@ -1082,7 +1082,7 @@
10821082
\end{codeblock}
10831083

10841084
The call \tcode{y.g()} is ill-formed because \tcode{y} is \tcode{const}
1085-
and \tcode{s::g()} is a non-\tcode{const} member function, that is,
1085+
and \tcode{s::g()} is a non-const member function, that is,
10861086
\tcode{s::g()} is less-qualified than the object-expression \tcode{y}.
10871087
\end{example}
10881088

0 commit comments

Comments
 (0)