Skip to content

Hyphenate 'pointer-to-member' when it is an adjective. #1386

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -3976,11 +3976,13 @@
\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 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 members of a given
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
Expand Down
14 changes: 7 additions & 7 deletions source/conversions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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|)}
Expand Down Expand Up @@ -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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm concerned that this change suggests a false parallel: previously, all the "X-to-Y conversion"s converted an X into a Y. A pointer to member conversion definitely does not convert a pointer into a member. I'm also still trying to decide if the rules for adjectives really apply here; "pointer to member type" seems more like "office chair store" (which would not be written as "office-chair store") than like, say, "office-themed store".

We have quite a few other cases (such as "pointer to function types") that follow a similar non-hyphenation pattern. These seem quite natural to me as-is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have 15 appearances where "pointer-to-member" is, in fact, hyphenated, so I presume you would accept a patch that removes the hyphens there?

Copy link
Member

@zygoloid zygoloid Feb 6, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's discuss this at Kona and agree on a rule, then apply it consistently.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We decided that we can get over this. Fine as written.


\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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion source/declarators.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
8 changes: 4 additions & 4 deletions source/exceptions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand All @@ -512,15 +512,15 @@
\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}

\begin{note}
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}
Expand Down
24 changes: 12 additions & 12 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}''
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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}).
Expand Down Expand Up @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions source/lex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
8 changes: 4 additions & 4 deletions source/overloading.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}

Expand Down Expand Up @@ -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}.
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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}
Expand Down
17 changes: 8 additions & 9 deletions source/templates.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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}

Expand All @@ -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
Expand Down Expand Up @@ -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.,
Expand Down Expand Up @@ -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}

Expand Down