Skip to content

Use \term and \defnx more correctly and consistently #980

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 4 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
8 changes: 4 additions & 4 deletions source/atomics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,10 @@
to all other atomic accesses to that object. \end{note}

\pnum
An atomic operation \term{A} that performs a release operation on an atomic
object \term{M} synchronizes with an atomic operation \term{B} that performs
an acquire operation on \term{M} and takes its value from any side effect in the
release sequence headed by \term{A}.
An atomic operation \placeholder{A} that performs a release operation on an atomic
object \placeholder{M} synchronizes with an atomic operation \placeholder{B} that performs
an acquire operation on \placeholder{M} and takes its value from any side effect in the
release sequence headed by \placeholder{A}.

\pnum
There shall be a single total order \textit{S} on all \tcode{memory_order_seq_cst}
Expand Down
2 changes: 1 addition & 1 deletion source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3773,7 +3773,7 @@

\pnum
\indextext{type!standard~signed~integer}%
There are five \defnx{standard signed integer types}{standard~signed~integer~type} :
There are five \defnx{standard signed integer types}{standard~signed~integer~type}:
\indextext{type!\idxcode{signed char}}%
\indextext{type!\idxcode{short}}%
\indextext{type!\idxcode{int}}%
Expand Down
16 changes: 6 additions & 10 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,8 @@
virtual functions or virtual base classes.\end{note}

\indextext{class!standard-layout}%
\indextext{standard-layout~class}%
\pnum
A class \tcode{S} is a \grammarterm{standard-layout class} if it:
A class \tcode{S} is a \defnx{standard-layout class}{standard-layout~class} if it:
\begin{itemize}
\item has no non-static data members of type non-standard-layout class
(or array of such types) or reference,
Expand Down Expand Up @@ -211,14 +210,12 @@
\end{example}

\indextext{struct!standard-layout}%
\indextext{standard-layout~struct}%
\indextext{union!standard-layout}%
\indextext{standard-layout~union}%
\pnum
A \grammarterm{standard-layout struct} is a standard-layout class
A \defnx{standard-layout struct}{standard-layout~struct} is a standard-layout class
defined with the \grammarterm{class-key} \tcode{struct} or the
\grammarterm{class-key} \tcode{class}.
A \grammarterm{standard-layout union} is a standard-layout class
A \defnx{standard-layout union}{standard-layout~union} is a standard-layout class
defined with the
\grammarterm{class-key} \tcode{union}.

Expand All @@ -228,14 +225,13 @@
in~\ref{class.mem}.\end{note}

\pnum
\indextext{POD struct}\indextext{POD class}\indextext{POD union}%
A \term{POD struct}\footnote{The acronym POD stands for ``plain old data''.}
A \defn{POD struct}\footnote{The acronym POD stands for ``plain old data''.}
is a non-union class that is both a trivial class and a
standard-layout class, and has no non-static data members of type non-POD struct,
non-POD union (or array of such types). Similarly, a
\term{POD union} is a union that is both a trivial class and a standard-layout
\defn{POD union} is a union that is both a trivial class and a standard-layout
class, and has no non-static data members of type non-POD struct, non-POD
union (or array of such types). A \term{POD class} is a
union (or array of such types). A \defn{POD class} is a
class that is either a POD struct or a POD union.

\begin{example}
Copy link
Member

Choose a reason for hiding this comment

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

Do we have any rules when to use "POD~struct" vs. "POD struct" in the index? We seem to prefer the variant with the tilde = non-breaking space. If true, the stuff above needs to become \defnx.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll change it to use tilde, so that we're covered if one day we want to render the index so narrowly that an entry consisting of 2 words side by side would get broken.

Copy link
Contributor Author

@Eelis Eelis Nov 17, 2016

Choose a reason for hiding this comment

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

If being prepared for that is an actual goal, though, there are hundreds more occurrences that need to be replaced.

Expand Down
8 changes: 4 additions & 4 deletions source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2059,7 +2059,7 @@
argument values of type \tcode{Key}, and by a binary predicate \tcode{Pred}
that induces an equivalence relation on values of type \tcode{Key}.
Additionally, \tcode{unordered_map} and \tcode{unordered_multimap} associate
an arbitrary \textit{mapped type} \tcode{T} with the \tcode{Key}.
an arbitrary \term{mapped type} \tcode{T} with the \tcode{Key}.

\pnum
\indextext{unordered associative containers!hash function}%
Expand Down Expand Up @@ -2089,9 +2089,9 @@
\pnum
\indextext{unordered associative containers!unique keys}%
\indextext{unordered associative containers!equivalent keys}%
An unordered associative container supports \textit{unique keys} if it
An unordered associative container supports \term{unique keys} if it
may contain at most one element for each key. Otherwise, it supports
\textit{equivalent keys}. \tcode{unordered_set} and \tcode{unordered_map}
\term{equivalent keys}. \tcode{unordered_set} and \tcode{unordered_map}
support unique keys. \tcode{unordered_multiset} and \tcode{unordered_multimap}
support equivalent keys. In containers that support equivalent keys,
elements with equivalent keys are adjacent to each other
Expand Down Expand Up @@ -2123,7 +2123,7 @@
\indextext{buckets}%
\indextext{hash code}%
The elements of an unordered associative container are organized into
\textit{buckets}. Keys with the same hash code appear in the same
\term{buckets}. Keys with the same hash code appear in the same
bucket. The number of buckets is automatically increased as elements
are added to an unordered associative container, so that the average
number of elements per bucket is kept below a bound. Rehashing
Expand Down
6 changes: 2 additions & 4 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2013,14 +2013,12 @@
\pnum
\indextext{constant!enumeration}%
\indextext{enumeration}%
\indextext{enumeration!unscoped}%
\indextext{enumeration!scoped}%
The enumeration type declared with an \grammarterm{enum-key}
of only \tcode{enum} is an \term{}{unscoped enumeration},
of only \tcode{enum} is an \defnx{unscoped enumeration}{enumeration!unscoped},
and its \grammarterm{enumerator}{s} are \term{unscoped enumerators}.
The \grammarterm{enum-key}{s} \tcode{enum class} and
\tcode{enum struct} are semantically equivalent; an enumeration
type declared with one of these is a \term{scoped enumeration},
type declared with one of these is a \defnx{scoped enumeration}{enumeration!scoped},
and its \grammarterm{enumerator}{s} are \term{scoped enumerators}.
The optional \grammarterm{identifier} shall not be omitted in the declaration of a scoped enumeration.
The \grammarterm{type-specifier-seq} of an \grammarterm{enum-base}
Expand Down
3 changes: 1 addition & 2 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,10 @@
applied to convert the expression to an xvalue.

\pnum
\indextext{conversion!usual arithmetic}%
Many binary operators that expect operands of arithmetic or enumeration
type cause conversions and yield result types in a similar way. The
purpose is to yield a common type, which is also the type of the result.
This pattern is called the \term{usual arithmetic conversions},
This pattern is called the \defnx{usual arithmetic conversions}{conversion!usual arithmetic},
which are defined as follows:

\begin{itemize}
Expand Down
4 changes: 2 additions & 2 deletions source/iostreams.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@

\pnum
When a standard iostream object \tcode{str} is
\textit{synchronized}
\term{synchronized}
with a standard stdio stream \tcode{f}, the effect of inserting a character \tcode{c} by
\begin{codeblock}
fputc(f, c);
Expand Down Expand Up @@ -1895,7 +1895,7 @@
\pnum
\returns
An output sequence that is
\textit{tied}
\term{tied}
to (synchronized with) the sequence controlled by the stream buffer.
\end{itemdescr}

Expand Down
105 changes: 49 additions & 56 deletions source/lex.tex
Original file line number Diff line number Diff line change
Expand Up @@ -870,26 +870,21 @@
\pnum
\indextext{literal!\idxcode{unsigned}}%
\indextext{literal!\idxcode{long}}%
\indextext{literal!integer}%
\indextext{literal!binary}%
\indextext{literal!octal}%
\indextext{literal!decimal}%
\indextext{literal!hexadecimal}%
\indextext{literal!base~of integer}%
An \term{integer literal} is a sequence of digits that has no period
An \defnx{integer literal}{literal!integer} is a sequence of digits that has no period
or exponent part, with optional separating single quotes that are ignored
when determining its value. An integer literal may have a prefix that specifies
its base and a suffix that specifies its type. The lexically first digit
of the sequence of digits is the most significant.
A \term{binary} integer literal (base two) begins with
A \defnx{binary}{literal!binary} integer literal (base two) begins with
\tcode{0b} or \tcode{0B} and consists of a sequence of binary digits.
An \term{octal} integer
An \defnx{octal}{literal!octal} integer
literal (base eight) begins with the digit \tcode{0} and consists of a
sequence of octal digits.\footnote{The digits \tcode{8} and \tcode{9} are not octal digits. }
A \term{decimal}
A \defnx{decimal}{literal!decimal}
integer literal (base ten) begins with a digit other than \tcode{0} and
consists of a sequence of decimal digits.
A \term{hexadecimal} integer literal (base sixteen) begins with
A \defnx{hexadecimal}{literal!hexadecimal} integer literal (base sixteen) begins with
\tcode{0x} or \tcode{0X} and consists of a sequence of hexadecimal
Copy link
Member

Choose a reason for hiding this comment

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

Please put all of "XXX integer literal" into the first argument of \defnx; we're not actually defining the term "decimal" here, but the phrase "decimal integer literal".

digits, which include the decimal digits and the letters \tcode{a}
through \tcode{f} and \tcode{A} through \tcode{F} with decimal values
Expand Down Expand Up @@ -1298,10 +1293,8 @@
The integer and fraction parts both consist of
a sequence of decimal (base ten) digits if there is no prefix, or
hexadecimal (base sixteen) digits if the prefix is \tcode{0x} or \tcode{0X}.
\indextext{literal!decimal floating}%
The literal is a \term{decimal floating literal} in the former case and
\indextext{literal!hexadecimal floating}%
a \term{hexadecimal floating literal} in the latter case.
The literal is a \defnx{decimal floating literal}{literal!decimal floating} in the former case and
a \defnx{hexadecimal floating literal}{literal!hexadecimal floating} in the latter case.
Optional separating single quotes in
a \grammarterm{digit-sequence} or \grammarterm{hexadecimal-digit-sequence}
are ignored when determining its value.
Expand Down Expand Up @@ -1498,7 +1491,7 @@
also referred to as narrow
string literals. A narrow string literal has type
\indextext{literal!string!type~of}%
``array of \term{n} \tcode{const char}'', where \term{n} is the size of
``array of \placeholder{n} \tcode{const char}'', where \placeholder{n} is the size of
the string as defined below, and has static storage
duration~(\ref{basic.stc}).

Expand All @@ -1513,7 +1506,7 @@
\indextext{prefix!\idxcode{u}}%
such as \tcode{u"asdf"}, is
a \tcode{char16_t} string literal. A \tcode{char16_t} string literal has
type ``array of \term{n} \tcode{const char16_t}'', where \term{n} is the
type ``array of \placeholder{n} \tcode{const char16_t}'', where \placeholder{n} is the
size of the string as defined below; it
is initialized with the given characters. A single \grammarterm{c-char} may
produce more than one \tcode{char16_t} character in the form of
Expand All @@ -1525,7 +1518,7 @@
\indextext{prefix!\idxcode{U}}%
such as \tcode{U"asdf"}, is
a \tcode{char32_t} string literal. A \tcode{char32_t} string literal has
type ``array of \term{n} \tcode{const char32_t}'', where \term{n} is the
type ``array of \placeholder{n} \tcode{const char32_t}'', where \placeholder{n} is the
size of the string as defined below; it
is initialized with the given characters.

Expand All @@ -1538,8 +1531,8 @@
\indextext{\idxcode{wchar_t}}%
\indextext{literal!string!wide}%
\indextext{prefix!\idxcode{L}}%
A wide string literal has type ``array of \term{n} \tcode{const
wchar_t}'', where \term{n} is the size of the string as defined below; it
A wide string literal has type ``array of \placeholder{n} \tcode{const
wchar_t}'', where \placeholder{n} is the size of the string as defined below; it
is initialized with the given characters.

\pnum
Expand Down Expand Up @@ -1726,93 +1719,93 @@
\pnum
A \grammarterm{user-defined-literal} is treated as a call to a literal operator or
literal operator template~(\ref{over.literal}). To determine the form of this call for a
given \grammarterm{user-defined-literal} \term{L} with \grammarterm{ud-suffix} \term{X},
the \grammarterm{literal-operator-id} whose literal suffix identifier is \term{X} is
looked up in the context of \term{L} using the rules for unqualified name
lookup~(\ref{basic.lookup.unqual}). Let \term{S} be the set of declarations found by
this lookup. \term{S} shall not be empty.
given \grammarterm{user-defined-literal} \placeholder{L} with \grammarterm{ud-suffix} \placeholder{X},
the \grammarterm{literal-operator-id} whose literal suffix identifier is \placeholder{X} is
looked up in the context of \placeholder{L} using the rules for unqualified name
lookup~(\ref{basic.lookup.unqual}). Let \placeholder{S} be the set of declarations found by
this lookup. \placeholder{S} shall not be empty.

\pnum
If \term{L} is a \grammarterm{user-defined-integer-literal}, let \term{n} be the literal
without its \grammarterm{ud-suffix}. If \term{S} contains a literal operator with
parameter type \tcode{unsigned long long}, the literal \term{L} is treated as a call of
If \placeholder{L} is a \grammarterm{user-defined-integer-literal}, let \placeholder{n} be the literal
without its \grammarterm{ud-suffix}. If \placeholder{S} contains a literal operator with
parameter type \tcode{unsigned long long}, the literal \placeholder{L} is treated as a call of
the form

\begin{codeblock}
operator "" @\term{X}@(@\term{n}@ULL)
operator "" @\placeholder{X}@(@\placeholder{n}@ULL)
\end{codeblock}

Otherwise, \term{S} shall contain a raw literal operator or a literal operator
template~(\ref{over.literal}) but not both. If \term{S} contains a raw literal operator,
the literal \term{L} is treated as a call of the form
Otherwise, \placeholder{S} shall contain a raw literal operator or a literal operator
template~(\ref{over.literal}) but not both. If \placeholder{S} contains a raw literal operator,
the literal \placeholder{L} is treated as a call of the form

\begin{codeblock}
operator "" @\term{X}@(@"\term{n}{"}@)
operator "" @\placeholder{X}@(@"\placeholder{n}{"}@)
\end{codeblock}

Otherwise (\term{S} contains a literal operator template), \term{L} is treated as a call
Otherwise (\placeholder{S} contains a literal operator template), \placeholder{L} is treated as a call
of the form


\begin{codeblock}
operator "" @\term{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>()
operator "" @\placeholder{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>()
\end{codeblock}

where \term{n} is the source character sequence $c_1c_2...c_k$. \begin{note} The sequence
where \placeholder{n} is the source character sequence $c_1c_2...c_k$. \begin{note} The sequence
$c_1c_2...c_k$ can only contain characters from the basic source character set.
\end{note}

\pnum
If \term{L} is a \grammarterm{user-defined-floating-literal}, let \term{f} be the
literal without its \grammarterm{ud-suffix}. If \term{S} contains a literal operator
with parameter type \tcode{long double}, the literal \term{L} is treated as a call of
If \placeholder{L} is a \grammarterm{user-defined-floating-literal}, let \placeholder{f} be the
literal without its \grammarterm{ud-suffix}. If \placeholder{S} contains a literal operator
with parameter type \tcode{long double}, the literal \placeholder{L} is treated as a call of
the form

\begin{codeblock}
operator "" @\term{X}@(@\term{f}@L)
operator "" @\placeholder{X}@(@\placeholder{f}@L)
\end{codeblock}

Otherwise, \term{S} shall contain a raw literal operator or a literal operator
template~(\ref{over.literal}) but not both. If \term{S} contains a raw literal operator,
the \term{literal} \term{L} is treated as a call of the form
Otherwise, \placeholder{S} shall contain a raw literal operator or a literal operator
template~(\ref{over.literal}) but not both. If \placeholder{S} contains a raw literal operator,
the \placeholder{literal} \placeholder{L} is treated as a call of the form

Copy link
Member

Choose a reason for hiding this comment

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

\term{literal} should be \grammarterm{literal}, not \placeholder

\begin{codeblock}
operator "" @\term{X}@(@"\term{f}{"}@)
operator "" @\placeholder{X}@(@"\placeholder{f}{"}@)
\end{codeblock}

Otherwise (\term{S} contains a literal operator template), \term{L} is treated as a call
Otherwise (\placeholder{S} contains a literal operator template), \placeholder{L} is treated as a call
of the form

\begin{codeblock}
operator "" @\term{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>()
operator "" @\placeholder{X}@<'@$c_1$@', '@$c_2$@', ... '@$c_k$@'>()
\end{codeblock}

where \term{f} is the source character sequence $c_1c_2...c_k$. \begin{note} The sequence
where \placeholder{f} is the source character sequence $c_1c_2...c_k$. \begin{note} The sequence
$c_1c_2...c_k$ can only contain characters from the basic source character set.
\end{note}

\pnum
If \term{L} is a \grammarterm{user-defined-string-literal}, let \term{str} be the
literal without its \grammarterm{ud-suffix} and let \term{len} be
If \placeholder{L} is a \grammarterm{user-defined-string-literal}, let \placeholder{str} be the
literal without its \grammarterm{ud-suffix} and let \placeholder{len} be
the number of
code units in \term{str} (i.e., its length excluding the terminating
code units in \placeholder{str} (i.e., its length excluding the terminating
null character).
The literal \term{L} is treated as a call of the form
The literal \placeholder{L} is treated as a call of the form

\begin{codeblock}
operator "" @\term{X}@(@\term{str}{}@, @\term{len}{}@)
operator "" @\placeholder{X}@(@\placeholder{str}{}@, @\placeholder{len}{}@)
\end{codeblock}

\pnum
If \term{L} is a \grammarterm{user-defined-character-literal}, let \term{ch} be the
If \placeholder{L} is a \grammarterm{user-defined-character-literal}, let \placeholder{ch} be the
literal without its \grammarterm{ud-suffix}.
\term{S} shall contain a literal operator~(\ref{over.literal}) whose only parameter has
the type of \term{ch} and the
literal \term{L} is treated as a call
\placeholder{S} shall contain a literal operator~(\ref{over.literal}) whose only parameter has
the type of \placeholder{ch} and the
literal \placeholder{L} is treated as a call
of the form

\begin{codeblock}
operator "" @\term{X}@(@\term{ch}{}@)
operator "" @\placeholder{X}@(@\placeholder{ch}{}@)
\end{codeblock}

\pnum
Expand Down
Loading