Skip to content

Commit 9751b29

Browse files
committed
Apply new designates wording to pointer-to-members
1 parent e717636 commit 9751b29

File tree

5 files changed

+59
-72
lines changed

5 files changed

+59
-72
lines changed

source/basic.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4469,7 +4469,7 @@
44694469
\item
44704470
a pointer-to-member operation\iref{expr.mptr.oper} using the \tcode{.*} operator
44714471
where the left operand is one of these expressions and
4472-
the right operand is a pointer to data member of non-reference type,
4472+
the right operand is of pointer to data member type,
44734473
\item
44744474
a
44754475
\begin{itemize}
@@ -5196,7 +5196,7 @@
51965196
\defnx{pointers to non-static class members}{pointer to member},%
51975197
\footnote{Static class members are objects or functions, and pointers to them are
51985198
ordinary pointers to objects or functions.}
5199-
which identify members of a given
5199+
which \defn{designate} members of a given
52005200
type within objects of a given class, \ref{dcl.mptr}.
52015201
Pointers to data members and pointers to member functions are collectively
52025202
called \term{pointer-to-member} types.

source/declarations.tex

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2921,8 +2921,9 @@
29212921
then the type of the identifier of
29222922
\tcode{D}
29232923
is ``\placeholder{derived-declarator-type-list} \grammarterm{cv-qualifier-seq} pointer to member of class
2924-
\grammarterm{nested-name-specifier} of type
2925-
\tcode{T}''.
2924+
\grammarterm{nested-name-specifier} of type \tcode{T}''.
2925+
\tcode{T} is known as the \defn{member type};
2926+
it shall not be a reference type or ``\cv{}~\tcode{void}''.
29262927
The optional \grammarterm{attribute-specifier-seq}\iref{dcl.attr.grammar} appertains to the
29272928
pointer-to-member.
29282929

@@ -2987,11 +2988,8 @@
29872988
\end{example}
29882989

29892990
\pnum
2990-
A pointer to member shall not point to a static member
2991-
of a class\iref{class.static},
2992-
a member with reference type,
2993-
or
2994-
``\cv{}~\tcode{void}''.
2991+
A pointer to member shall not designate a static member
2992+
of a class\iref{class.static}.
29952993

29962994
\pnum
29972995
\begin{note}
@@ -3417,7 +3415,7 @@
34173415
\begin{itemize}
34183416
\item the function type for a non-static member function,
34193417

3420-
\item the function type to which a pointer to member points,
3418+
\item the member type\iref{dcl.mptr} of a pointer to member type,
34213419

34223420
\item the top-level function type of a function typedef declaration
34233421
or \grammarterm{alias-declaration},

source/expressions.tex

Lines changed: 48 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1020,9 +1020,9 @@
10201020
ambiguous\iref{class.member.lookup}, or virtual\iref{class.mi} base
10211021
class of \tcode{D}, or a base class of a virtual base class of
10221022
\tcode{D}, a program that necessitates this conversion is ill-formed.
1023-
The result of the conversion points to the same member as the pointer to
1024-
member before the conversion took place, but it points to the base class
1025-
member as if it were a member of the derived class. The result points to
1023+
The result of the conversion designates the same member as the pointer to
1024+
member before the conversion took place, but it designates the base class
1025+
member as if it were a member of the derived class. The result designates
10261026
the member in \tcode{D}'s instance of \tcode{B}. Since the result has
10271027
type ``pointer to member of \tcode{D} of type \cv{} \tcode{T}'',
10281028
indirection through it with a \tcode{D} object is valid. The result is the same
@@ -2906,7 +2906,7 @@
29062906
implicit~(\ref{class.mfct.non-static}, \ref{class.static}) or explicit
29072907
class member access\iref{expr.ref} whose \grammarterm{id-expression} is a
29082908
function member name, or a pointer-to-member
2909-
expression\iref{expr.mptr.oper} pointing to a function member; the call is as a member of
2909+
expression\iref{expr.mptr.oper} of function type; the call is as a member of
29102910
the class object referred to by the
29112911
object expression. In the case of an implicit class
29122912
member access, the implied object is the one pointed to by \tcode{this}.
@@ -3800,8 +3800,8 @@
38003800
The null member pointer value\iref{conv.mem} is converted to the null
38013801
member pointer value of the destination type. If class \tcode{B}
38023802
contains the original member, or is a base or derived class of the class
3803-
containing the original member, the resulting pointer to member points
3804-
to the original member. Otherwise, the behavior is undefined.
3803+
containing the original member, the resulting pointer to member designates
3804+
the original member. Otherwise, the behavior is undefined.
38053805
\begin{note}
38063806
Although class \tcode{B} need not contain the original member, the
38073807
dynamic type of the object with which indirection through the pointer
@@ -4186,7 +4186,7 @@
41864186
\item
41874187
If the operand is a \grammarterm{qualified-id} naming a non-static or variant member \tcode{m}
41884188
of some class \tcode{C} with type \tcode{T}, the result has type ``pointer to member
4189-
of class \tcode{C} of type \tcode{T}'' and is a prvalue pointing to \tcode{C::m}.
4189+
of class \tcode{C} of type \tcode{T}'' and is a prvalue designating \tcode{C::m}.
41904190
\item
41914191
Otherwise, if the operand is an lvalue of type \tcode{T},
41924192
the resulting expression is a prvalue of type ``pointer to \tcode{T}''
@@ -5582,38 +5582,35 @@
55825582
\end{bnf}
55835583

55845584
\pnum
5585-
The binary operator \tcode{.*} binds its second operand, which shall be
5586-
of type ``pointer to member of \tcode{T}'' to its first operand, which shall be
5587-
a glvalue
5588-
of
5589-
class \tcode{T} or of a class of which \tcode{T} is an unambiguous and
5590-
accessible base class. The result the object or a function to which the second operand points.
5591-
5592-
\pnum
5593-
The binary operator \tcode{->*} binds its second operand, which shall be
5594-
of type ``pointer to member of \tcode{T}'' to its first operand, which shall be of
5595-
type ``pointer to \tcode{U}''
5596-
where \tcode{U} is either \tcode{T} or
5597-
a class of which \tcode{T}
5598-
is an unambiguous and accessible base class.
5599-
The expression \tcode{E1->*E2} is converted into the equivalent form
5600-
\tcode{(*(E1)).*E2}.
5585+
In a pointer-to-member expression of the form \tcode{E1->*E2}, \tcode{E2} shall
5586+
be of type ``pointer to member of \tcode{T}'' and \tcode{E1} shall be of type
5587+
``pointer to \cv{}~\tcode{U}'' where \tcode{U} is \tcode{T} or a type of which
5588+
\tcode{T} is an accessible and unambiguous base class. The expression is converted
5589+
to the equivalent form \tcode{(*(E1)).*E2}; the remainder of this subclause will
5590+
address only the operator \tcode{.*}.
5591+
5592+
\pnum
5593+
Abbreviating \grammarterm{pm-expression}\tcode{.*}\grammarterm{cast-expression} as \tcode{E1.*E2},
5594+
\tcode{E2} shall be of type ``pointer to member of \tcode{T}'', and \tcode{E1} shall be a glvalue
5595+
of type \tcode{T} or a type of which \tcode{T} is an accessible and unambiguous base class
5596+
(ignoring cv-qualification). The expression \tcode{E1} is known as the \defn{object expression}.
5597+
If \tcode{E2} is the null-member-pointer value, or the member \tcode{E2} designates is not a
5598+
member of the the dynamic type of the object expression, the behavior is undefined.
5599+
The result is the member subobject or function designated
5600+
by \tcode{E2} corresponding to the object denoted by the object expression;
5601+
the expression is a prvalue if the result is a function, and otherwise has
5602+
the same value category as the (possibly-converted) object expression.
5603+
The expression \tcode{E1} is sequenced before the expression \tcode{E2}.
56015604

56025605
\pnum
5603-
Abbreviating \grammarterm{pm-expression}\tcode{.*}\grammarterm{cast-expression} as \tcode{E1.*E2}, \tcode{E1}
5604-
is called the \defn{object expression}.
5605-
If the dynamic type of \tcode{E1} does not
5606-
contain the member to which
5607-
\tcode{E2} points, the behavior is undefined.
5608-
Otherwise, the expression \tcode{E1} is sequenced before the expression \tcode{E2}.
5606+
The manner in which the cv-qualifiers of the operands are combined
5607+
to produce the cv-qualifiers of the result are the same as those
5608+
specified in~\ref{expr.ref} for the expression \tcode{E1.M}, where
5609+
the invented \grammarterm{id-expression} \tcode{M} denotes the same
5610+
member \tcode{E2} designates.
56095611

5610-
\pnum
5611-
The restrictions on cv-qualification, and the manner in which
5612-
the cv-qualifiers of the operands are combined to produce the
5613-
cv-qualifiers of the result, are the same as the rules for
5614-
\tcode{E1.E2} given in~\ref{expr.ref}.
56155612
\begin{note}
5616-
It is not possible to use a pointer to member that points to a
5613+
It is not possible to use a pointer to member designating a
56175614
\tcode{mutable} member to modify a const class object. For
56185615
example,
56195616
\begin{codeblock}
@@ -5624,39 +5621,31 @@
56245621
void f()
56255622
{
56265623
const S cs;
5627-
int S::* pm = &S::i; // \tcode{pm} points to \tcode{mutable} member \tcode{S::i}
5624+
int S::* pm = &S::i; // \tcode{pm} designates the \tcode{mutable} member \tcode{S::i}
56285625
cs.*pm = 88; // error: \tcode{cs} is a const object
56295626
}
56305627
\end{codeblock}
56315628
\end{note}
56325629

56335630
\pnum
56345631
\indextext{function!pointer to member}%
5635-
If the result of \tcode{.*} or \tcode{->*} is a function, then that
5636-
result can be used only as the operand for the function call operator
5637-
\tcode{()}.
5632+
If the result of a pointer-to-member expression is a function, the
5633+
result can be used only as the left-hand operand of a member function call.
56385634
\begin{example}
56395635
\begin{codeblock}
56405636
(ptr_to_obj->*ptr_to_mfct)(10);
56415637
\end{codeblock}
5642-
calls the member function denoted by \tcode{ptr_to_mfct} for the object
5638+
calls the member function designated by \tcode{ptr_to_mfct} for the object
56435639
pointed to by \tcode{ptr_to_obj}.
56445640
\end{example}
5645-
In a \tcode{.*} expression whose object expression is an rvalue, the program is
5646-
ill-formed if the second operand is a pointer to member function
5647-
whose \grammarterm{ref-qualifier} is \tcode{\&},
5648-
unless its \grammarterm{cv-qualifier-seq} is \tcode{const}.
5649-
In a \tcode{.*}
5650-
expression whose object expression is an lvalue, the program is ill-formed if the second
5651-
operand is
5652-
a pointer to member function
5653-
whose \grammarterm{ref-qualifier} is \tcode{\&\&}.
5654-
The result of a \tcode{.*} expression
5655-
whose second operand is a pointer to a data member is an lvalue if the first
5656-
operand is an lvalue and an xvalue otherwise. The result of a \tcode{.*} expression whose
5657-
second operand is a pointer to a member function is a prvalue.
5658-
If the second operand is the null
5659-
member pointer value\iref{conv.mem}, the behavior is undefined.
5641+
5642+
\pnum
5643+
In a pointer-to-member expression whose object expression is an xvalue,
5644+
if the second operand is of pointer-to-member-function type, the member type\iref{dcl.mptr}
5645+
shall not have the \grammarterm{ref-qualifier} \tcode{\&} unless its \grammarterm{cv-qualifier-seq}
5646+
is \tcode{const}. Similarly, in a pointer-to-member expression whose object expression is an lvalue,
5647+
if the second operand is of pointer-to-member-function type, the member type\iref{dcl.mptr}
5648+
shall not have the \grammarterm{ref-qualifier} \tcode{\&\&}.
56605649

56615650
\rSec2[expr.mul]{Multiplicative operators}%
56625651
\indextext{expression!multiplicative operators}%
@@ -6154,7 +6143,7 @@
61546143
If either is a pointer to a virtual member function, the result is unspecified.
61556144

61566145
\item
6157-
If one points to a member of class \tcode{C1} and the other points to a member
6146+
If one designates a member of class \tcode{C1} and the other designates a member
61586147
of a different class \tcode{C2}, where neither is a base class of the other,
61596148
the result is unspecified.
61606149
\begin{example}
@@ -6171,11 +6160,11 @@
61716160
\end{example}
61726161

61736162
\item
6174-
If both point to (possibly different) members of the same union\iref{class.union},
6163+
If both designate (possibly different) members of the same union\iref{class.union},
61756164
they compare equal.
61766165

61776166
\item
6178-
Otherwise, two pointers to members compare equal if they would point to the same member of
6167+
Otherwise, two pointers to members compare equal if they would designate the same member of
61796168
the same most derived object\iref{intro.object} or the same subobject if
61806169
indirection with a hypothetical object of the associated
61816170
class type were performed, otherwise they compare unequal.
@@ -7227,7 +7216,7 @@
72277216

72287217
\item
72297218
if the value is of pointer-to-member-function type,
7230-
it does not point to an immediate function, and
7219+
it does not designate an immediate function, and
72317220

72327221
\item
72337222
if the value is an object of class or array type,

source/lib-intro.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2477,7 +2477,7 @@
24772477
if it attempts to form a reference
24782478
to \tcode{\placeholder{F}}
24792479
or
2480-
if it attempts to form a pointer-to-member to
2480+
if it attempts to form a pointer-to-member designating
24812481
either a standard library non-static member function\iref{member.functions}
24822482
or an instantiation of a standard library member function template.
24832483

source/templates.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,7 +2084,7 @@
20842084
they are of pointer type and they have the same pointer value, or
20852085

20862086
\item
2087-
they are of pointer-to-member type and they point to the same class member
2087+
they are of pointer-to-member type and they designate the same class member
20882088
or are both the null member pointer value, or
20892089

20902090
\item
@@ -8531,7 +8531,7 @@
85318531
and the return type.
85328532
\item
85338533
A pointer-to-member type includes the type of the class object pointed to
8534-
and the type of the member pointed to.
8534+
and the member type\iref{dcl.mptr}.
85358535
\item
85368536
A type that is a specialization of a class template (e.g.,
85378537
\tcode{A<int>})

0 commit comments

Comments
 (0)