From 172f4b3610996c43023e066e9a2ad4c319a5c5d4 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 18 Jan 2017 22:30:22 +0100 Subject: [PATCH 1/3] Hyphenate 'pointer-to-member' when it is an adjective. Fixes #1369. --- source/basic.tex | 4 ++-- source/conversions.tex | 14 +++++++------- source/declarators.tex | 2 +- source/exceptions.tex | 8 ++++---- source/expressions.tex | 24 ++++++++++++------------ source/lex.tex | 4 ++-- source/overloading.tex | 8 ++++---- source/templates.tex | 17 ++++++++--------- 8 files changed, 40 insertions(+), 41 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 82674cfb6d..b5495fce55 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -3637,7 +3637,7 @@ \pnum Arithmetic types~(\ref{basic.fundamental}), enumeration types, pointer -types, pointer to member types~(\ref{basic.compound}), +types, pointer-to-member types~(\ref{basic.compound}), \tcode{std::nullptr_t}, and cv-qualified~(\ref{basic.type.qualifier}) versions of these @@ -3927,7 +3927,7 @@ \pnum A value of type \tcode{std::nullptr_t} is a null pointer constant~(\ref{conv.ptr}). Such values participate in the pointer and the -pointer to member conversions~(\ref{conv.ptr}, \ref{conv.mem}). +pointer-to-member conversions~(\ref{conv.ptr}, \ref{conv.mem}). \tcode{sizeof(std::nullptr_t)} shall be equal to \tcode{sizeof(void*)}. \pnum diff --git a/source/conversions.tex b/source/conversions.tex index e88e8d0b2a..358d96bed6 100644 --- a/source/conversions.tex +++ b/source/conversions.tex @@ -22,7 +22,7 @@ \item Zero or one conversion from the following set: integral promotions, floating-point promotion, integral conversions, floating-point conversions, floating-integral conversions, pointer conversions, -pointer to member conversions, and boolean conversions. +pointer-to-member conversions, and boolean conversions. \item Zero or one function pointer conversion. @@ -326,7 +326,7 @@ \pnum \begin{note} -Function types (including those used in pointer to member function +Function types (including those used in pointer-to-member-function types) are never cv-qualified (\ref{dcl.fct}). \end{note} \indextext{conversion!qualification|)} @@ -527,21 +527,21 @@ object. The null pointer value is converted to the null pointer value of the destination type. -\rSec1[conv.mem]{Pointer to member conversions} +\rSec1[conv.mem]{Pointer-to-member conversions} \pnum \indextext{conversion!pointer to member}% \indextext{constant!null pointer}% \indextext{value!null member pointer}% -A null pointer constant~(\ref{conv.ptr}) can be converted to a pointer -to member type; the result is the \term{null member pointer value} +A null pointer constant~(\ref{conv.ptr}) can be converted to a +pointer-to-member type; the result is the \term{null member pointer value} of that type and is distinguishable from any pointer to member not created from a null pointer constant. Such a conversion is called a \term{null member pointer conversion}. Two null member pointer values of the same type shall compare equal. The conversion of a null pointer constant to a pointer to member of cv-qualified type is a single -conversion, and not the sequence of a pointer to member conversion +conversion, and not the sequence of a pointer-to-member conversion followed by a qualification conversion~(\ref{conv.qual}). \pnum @@ -600,7 +600,7 @@ \pnum \indextext{conversion!boolean}% -A prvalue of arithmetic, unscoped enumeration, pointer, or pointer to member +A prvalue of arithmetic, unscoped enumeration, pointer, or pointer-to-member type can be converted to a prvalue of type \tcode{bool}. A zero value, null pointer value, or null member pointer value is converted to \tcode{false}; any other value is converted to \tcode{true}. For diff --git a/source/declarators.tex b/source/declarators.tex index 5c884c27cb..91d9f7d10a 100644 --- a/source/declarators.tex +++ b/source/declarators.tex @@ -919,7 +919,7 @@ \begin{note} See also~\ref{expr.unary} and~\ref{expr.mptr.oper}. The type ``pointer to member'' is distinct from the type ``pointer'', -that is, a pointer to member is declared only by the pointer to member +that is, a pointer to member is declared only by the pointer-to-member declarator syntax, and never by the pointer declarator syntax. There is no ``reference-to-member'' type in \Cpp. \end{note} diff --git a/source/exceptions.tex b/source/exceptions.tex index 0ff6d1afc2..db67d2995d 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -496,8 +496,8 @@ \tcode{T} is an unambiguous public base class of \tcode{E}, or \item% the \grammarterm{handler} is of type \cv{}~\tcode{T} or \tcode{const T\&} -where \tcode{T} is a pointer or pointer to member type and -\tcode{E} is a pointer or pointer to member type +where \tcode{T} is a pointer or pointer-to-member type and +\tcode{E} is a pointer or pointer-to-member type that can be converted to \tcode{T} by one or more of \begin{itemize} @@ -512,7 +512,7 @@ \end{itemize} \item -the \grammarterm{handler} is of type \cv{}~\tcode{T} or \tcode{const T\&} where \tcode{T} is a pointer or pointer to member type and \tcode{E} is \tcode{std::nullptr_t}. +the \grammarterm{handler} is of type \cv{}~\tcode{T} or \tcode{const T\&} where \tcode{T} is a pointer or pointer-to-member type and \tcode{E} is \tcode{std::nullptr_t}. \end{itemize} @@ -520,7 +520,7 @@ A \grammarterm{throw-expression} whose operand is an integer literal with value zero does not match a handler of -pointer or pointer to member type. +pointer or pointer-to-member type. A handler of reference to array or function type is never a match for any exception object~(\ref{expr.throw}). \end{note} diff --git a/source/expressions.tex b/source/expressions.tex index c5acfc0ade..2d5554b287 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -274,7 +274,7 @@ The \defn{composite pointer type} of two operands \tcode{p1} and \tcode{p2} having types \tcode{T1} and \tcode{T2}, respectively, where at least one is a -pointer or pointer to member type or +pointer or pointer-to-member type or \tcode{std::nullptr_t}, is: \begin{itemize} @@ -1721,8 +1721,8 @@ An argument that has type \cv{}~\tcode{std::nullptr_t} is converted to type \tcode{void*}~(\ref{conv.ptr}). After these conversions, if the -argument does not have arithmetic, enumeration, pointer, pointer to -member, or class type, the program is ill-formed. Passing a potentially-evaluated +argument does not have arithmetic, enumeration, pointer, pointer-to-member, +or class type, the program is ill-formed. Passing a potentially-evaluated argument of class type (Clause~\ref{class}) having a non-trivial copy constructor, a non-trivial move constructor, or a @@ -2387,7 +2387,7 @@ class (Clause~\ref{class.derived}) of \tcode{D}, if \cvqual{cv2} is the same cv-qualification as, or greater cv-qualification than, \cvqual{cv1}.\footnote{Function types -(including those used in pointer to member function +(including those used in pointer-to-member-function types) are never cv-qualified; see~\ref{dcl.fct}.} If no valid standard conversion from ``pointer to member of \tcode{B} of type \tcode{T}'' @@ -2558,14 +2558,14 @@ \begin{itemize} \item converting a prvalue of type ``pointer to member function'' to a -different pointer to member function type and back to its original type -yields the original pointer to member value. +different pointer-to-member-function type and back to its original type +yields the original pointer-to-member value. \item converting a prvalue of type ``pointer to data member of \tcode{X} of type \tcode{T1}'' to the type ``pointer to data member of \tcode{Y} of type \tcode{T2}'' (where the alignment requirements of \tcode{T2} are no stricter than those of \tcode{T1}) and back to its original type -yields the original pointer to member value. +yields the original pointer-to-member value. \end{itemize} \pnum @@ -2771,7 +2771,7 @@ \pnum \indextext{name!address of cv-qualified}% -\indextext{expression!pointer to member constant}% +\indextext{expression!pointer-to-member constant}% The result of the unary \tcode{\&} operator is a pointer to its operand. The operand shall be an lvalue or a \grammarterm{qualified-id}. If the operand is a \grammarterm{qualified-id} naming a non-static or variant member \tcode{m} @@ -4312,7 +4312,7 @@ \pnum The \tcode{==} (equal to) and the \tcode{!=} (not equal to) operators group left-to-right. The operands shall have arithmetic, enumeration, pointer, -or pointer to member type, or type \tcode{std::nullptr_t}. The operators +or pointer-to-member type, or type \tcode{std::nullptr_t}. The operators \tcode{==} and \tcode{!=} both yield \tcode{true} or \tcode{false}, i.e., a result of type \tcode{bool}. In each case below, the operands shall have the same type after the specified conversions have been applied. @@ -4344,7 +4344,7 @@ \end{itemize} \pnum -If at least one of the operands is a pointer to member, pointer to member +If at least one of the operands is a pointer to member, pointer-to-member conversions~(\ref{conv.mem}) and qualification conversions~(\ref{conv.qual}) are performed on both operands to bring them to their composite pointer type (Clause~\ref{expr}). @@ -4685,8 +4685,8 @@ composite pointer type (Clause~\ref{expr}). The result is of the composite pointer type. -\item One or both of the second and third operands have pointer to member type; -pointer to member conversions~(\ref{conv.mem}) and qualification +\item One or both of the second and third operands have pointer-to-member type; +pointer-to-member conversions~(\ref{conv.mem}) and qualification conversions~(\ref{conv.qual}) are performed to bring them to their composite pointer type (Clause~\ref{expr}). The result is of the composite pointer type. diff --git a/source/lex.tex b/source/lex.tex index a596f6b449..87281bf68e 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -1710,8 +1710,8 @@ The pointer literal is the keyword \tcode{nullptr}. It is a prvalue of type \tcode{std::nullptr_t}. \begin{note} -\tcode{std::nullptr_t} is a distinct type that is neither a pointer type nor a pointer -to member type; rather, a prvalue of this type is a null pointer constant and can be +\tcode{std::nullptr_t} is a distinct type that is neither a pointer type nor a pointer-to-member type; +rather, a prvalue of this type is a null pointer constant and can be converted to a null pointer value or null member pointer value. See~\ref{conv.ptr} and~\ref{conv.mem}. \end{note} diff --git a/source/overloading.tex b/source/overloading.tex index 58059376e4..5f8a73e8ca 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -2040,7 +2040,7 @@ Floating-point conversions & & & \ref{conv.double} \\ \cline{1-1}\cline{4-4} Floating-integral conversions & & & \ref{conv.fpint} \\ \cline{1-1}\cline{4-4} Pointer conversions & \rb{Conversion} & \rb{Conversion} & \ref{conv.ptr} \\ \cline{1-1}\cline{4-4} -Pointer to member conversions & & & \ref{conv.mem} \\ \cline{1-1}\cline{4-4} +Pointer-to-member conversions & & & \ref{conv.mem} \\ \cline{1-1}\cline{4-4} Boolean conversions & & & \ref{conv.bool} \\ \end{floattable} @@ -2796,7 +2796,7 @@ match targets of function pointer type or reference to function type. Non-static member functions match targets of -pointer to member function type. +pointer-to-member-function type. If a non-static member function is selected, the reference to the overloaded function name is required to have the form of a pointer to member as described in~\ref{expr.unary.op}. @@ -3648,7 +3648,7 @@ \end{codeblock} \pnum -For every pointer to member type \tcode{\placeholder{T}} or type \tcode{std::nullptr_t} there +For every pointer-to-member type \tcode{\placeholder{T}} or type \tcode{std::nullptr_t} there exist candidate operator functions of the form \begin{codeblock} @@ -3715,7 +3715,7 @@ \cvqual{vq}), where \tcode{\placeholder{T}} -is an enumeration or pointer to member type, +is an enumeration or pointer-to-member type, there exist candidate operator functions of the form \begin{codeblock} diff --git a/source/templates.tex b/source/templates.tex index 3dddbf5712..4f847fe950 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -6288,7 +6288,7 @@ the transformed \tcode{A}. \item The transformed \tcode{A} -can be another pointer or pointer to member type that can be converted +can be another pointer or pointer-to-member type that can be converted to the deduced \tcode{A} via a function pointer conversion~(\ref{conv.fctptr}) and/or @@ -6336,8 +6336,7 @@ \pnum When \tcode{P} -is a function type, function pointer type, or pointer to member -function type: +is a function type, function pointer type, or pointer-to-member-function type: \begin{itemize} \item If the argument is an overload set containing one or more function templates, @@ -6511,12 +6510,12 @@ \tcode{A} can be ``pointer to function'' even if the deduced \tcode{A} is ``pointer to noexcept function''. \item -If the original \tcode{A} is a pointer to member function type, +If the original \tcode{A} is a pointer-to-member-function type, \tcode{A} can be ``pointer to member of type function'' even if the deduced \tcode{A} is ``pointer to member of type noexcept function''. \item The deduced \tcode{A} -can be another pointer or pointer to member type that +can be another pointer or pointer-to-member type that can be converted to \tcode{A} via a qualification conversion. \end{itemize} @@ -6529,7 +6528,7 @@ \pnum When the deduction process requires a qualification conversion for a -pointer or pointer to member type as described above, the following +pointer or pointer-to-member type as described above, the following process is used to determine the deduced template argument values: If @@ -6830,7 +6829,7 @@ A function type includes the types of each of the function parameters and the return type. \item -A pointer to member type includes the type of the class object pointed to +A pointer-to-member type includes the type of the class object pointed to and the type of the member pointed to. \item A type that is a specialization of a class template (e.g., @@ -7348,8 +7347,8 @@ \pnum A \grammarterm{template-argument} -can be deduced from a function, pointer to function, or pointer to -member function type. +can be deduced from a function, pointer to function, or +pointer-to-member-function type. \begin{example} From 71f8194c2d4dd1970d1fbee28d99317350d1c877 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 12 Nov 2017 00:12:10 -0700 Subject: [PATCH 2/3] Define "pointer-to-member", retire "pointer to non-static class member" --- source/basic.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index b5495fce55..f17bc39545 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -3976,10 +3976,10 @@ \defnx{enumerated type}{type!enumerated},~\ref{dcl.enum}; \item \indextext{member pointer to|see{pointer to member}}% -\defnx{pointers to non-static class members}{pointer to member},% +\defnx{pointers-to-members}{pointer-to-member},% \footnote{Static class members are objects or functions, and pointers to them are ordinary pointers to objects or functions.} -which identify members of a given +which identify non-static members of a given type within objects of a given class,~\ref{dcl.mptr}. \end{itemize} From fba0508014f815c0ef161232e8a4b9d5468b249a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 12 Nov 2017 00:39:39 -0700 Subject: [PATCH 3/3] Update basic.tex --- source/basic.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index f17bc39545..a5db7fcb91 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -3976,11 +3976,13 @@ \defnx{enumerated type}{type!enumerated},~\ref{dcl.enum}; \item \indextext{member pointer to|see{pointer to member}}% -\defnx{pointers-to-members}{pointer-to-member},% +\defnx{pointers to non-static class members}{pointer-to-member},% \footnote{Static class members are objects or functions, and pointers to them are ordinary pointers to objects or functions.} which identify non-static members of a given type within objects of a given class,~\ref{dcl.mptr}. +Pointers to data members and pointers to member functions are collectively +called \defn{pointer-to-member} types. \end{itemize} \pnum