Skip to content

Commit eca2da0

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

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
@@ -988,15 +988,18 @@
988988
\end{example}
989989

990990
\pnum
991+
\indextext{member function!const}%
992+
\indextext{member function!volatile}%
993+
\indextext{member function!const volatile}%
991994
A non-static member function may be declared \tcode{const},
992995
\tcode{volatile}, or \tcode{const} \tcode{volatile}. These
993996
\grammarterm{cv-qualifier}{s} affect the type of the \tcode{this}
994997
pointer~(\ref{class.this}). They also affect the function
995998
type~(\ref{dcl.fct}) of the member function; a member function declared
996-
\tcode{const} is a \term{const} member function, a member function
997-
declared \tcode{volatile} is a \term{volatile} member function and a
999+
\tcode{const} is a \defn{const member function}, a member function
1000+
declared \tcode{volatile} is a \defn{volatile member function} and a
9981001
member function declared \tcode{const} \tcode{volatile} is a
999-
\term{const volatile} member function.
1002+
\defn{const volatile member function}.
10001003
\begin{example}
10011004

10021005
\begin{codeblock}
@@ -1006,8 +1009,8 @@
10061009
};
10071010
\end{codeblock}
10081011

1009-
\tcode{X::g} is a \tcode{const} member function and \tcode{X::h} is a
1010-
\tcode{const} \tcode{volatile} member function.
1012+
\tcode{X::g} is a const member function and \tcode{X::h} is a
1013+
const volatile member function.
10111014
\end{example}
10121015

10131016
\pnum
@@ -1029,17 +1032,14 @@
10291032
\indextext{\idxcode{this}!type of}%
10301033
The type of \tcode{this} in a member function of a class \tcode{X} is
10311034
\tcode{X*}.
1032-
\indextext{member function!\idxcode{const}}%
10331035
If the member function is declared \tcode{const}, the type of
10341036
\tcode{this} is \tcode{const} \tcode{X*},
1035-
\indextext{member function!\idxcode{volatile}}%
10361037
if the member function is declared \tcode{volatile}, the type of
10371038
\tcode{this} is \tcode{volatile} \tcode{X*}, and if the member function
10381039
is declared \tcode{const} \tcode{volatile}, the type of \tcode{this} is
10391040
\tcode{const} \tcode{volatile} \tcode{X*}.
1040-
\indextext{member function!\idxcode{const}}%
1041-
\begin{note} Thus in a \tcode{const} member function, the object for which the function is
1042-
called is accessed through a \tcode{const} access path. \end{note}
1041+
\begin{note} Thus in a const member function, the object for which the function is
1042+
called is accessed through a const access path. \end{note}
10431043
\begin{example}
10441044

10451045
\begin{codeblock}
@@ -1055,14 +1055,14 @@
10551055

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

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

10681068
\pnum
@@ -1081,7 +1081,7 @@
10811081
\end{codeblock}
10821082

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

0 commit comments

Comments
 (0)