Skip to content

Commit fb316b4

Browse files
jensmaurertkoeppe
authored andcommitted
[std] Use \keyword for specifiers.
1 parent 290fe9c commit fb316b4

21 files changed

+199
-199
lines changed

source/algorithms.tex

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
\tcode{pred(*first)} contextually converted to \tcode{bool}\iref{conv}.
157157
The function object \tcode{pred} shall not apply any non-constant function
158158
through the dereferenced iterator.
159-
Given a glvalue \tcode{u} of type (possibly \tcode{const}) \tcode{T}
159+
Given a glvalue \tcode{u} of type (possibly \keyword{const}) \tcode{T}
160160
that designates the same object as \tcode{*first},
161161
\tcode{pred(u)} shall be a valid expression
162162
that is equal to \tcode{pred(*first)}.
@@ -181,9 +181,9 @@
181181
\tcode{binary_pred(*first1, value)} contextually converted to \tcode{bool}\iref{conv}.
182182
\tcode{binary_pred} shall not apply any non-constant function
183183
through the dereferenced iterators.
184-
Given a glvalue \tcode{u} of type (possibly \tcode{const}) \tcode{T1}
184+
Given a glvalue \tcode{u} of type (possibly \keyword{const}) \tcode{T1}
185185
that designates the same object as \tcode{*first1}, and
186-
a glvalue \tcode{v} of type (possibly \tcode{const}) \tcode{T2}
186+
a glvalue \tcode{v} of type (possibly \keyword{const}) \tcode{T2}
187187
that designates the same object as \tcode{*first2},
188188
\tcode{binary_pred(u, *first2)},
189189
\tcode{binary_pred(*first1, v)}, and

source/atomics.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1681,7 +1681,7 @@
16811681

16821682
\begin{itemdescr}
16831683
\pnum
1684-
The \tcode{static} data member \tcode{is_always_lock_free} is \tcode{true}
1684+
The \keyword{static} data member \tcode{is_always_lock_free} is \tcode{true}
16851685
if the atomic type's operations are always lock-free, and \tcode{false} otherwise.
16861686
\begin{note}
16871687
The value of \tcode{is_always_lock_free} is consistent with the value of

source/basic.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5366,7 +5366,7 @@
53665366
has no top-level cv-qualifiers.
53675367
The type corresponding to the \grammarterm{type-id}
53685368
\tcode{\keyword{volatile} \keyword{int} * \keyword{const}}
5369-
has the top-level cv-qualifier \tcode{const}.
5369+
has the top-level cv-qualifier \keyword{const}.
53705370
For a class type \tcode{C},
53715371
the type corresponding to the \grammarterm{type-id}
53725372
\tcode{\keyword{void} (C::* \keyword{volatile})(\keyword{int}) \keyword{const}}
@@ -5542,7 +5542,7 @@
55425542
if (S(3).v()) // full-expression includes lvalue-to-rvalue and \tcode{int} to \tcode{bool} conversions,
55435543
// performed before temporary is deleted at end of full-expression
55445544
{ }
5545-
bool b = noexcept(S()); // exception specification of destructor of \tcode{S} considered for \tcode{noexcept}
5545+
bool b = noexcept(S()); // exception specification of destructor of \tcode{S} considered for \keyword{noexcept}
55465546

55475547
// full-expression is destruction of \tcode{s2} at end of block
55485548
}

source/classes.tex

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@
548548

549549
\pnum
550550
A data member or member function
551-
may be declared \tcode{static} in its \grammarterm{member-declaration},
551+
may be declared \keyword{static} in its \grammarterm{member-declaration},
552552
in which case it is a \defnadj{static}{member} (see~\ref{class.static})
553553
(a \defnadj{static}{data member}\iref{class.static.data} or
554554
\defnadj{static}{member function}\iref{class.static.mfct}, respectively)
@@ -658,8 +658,8 @@
658658
exception specification of that constructor.
659659

660660
\pnum
661-
A member shall not be declared with the \tcode{extern}
662-
\grammarterm{storage-class-specifier}. Within a class definition, a member shall not be declared with the \tcode{thread_local} \grammarterm{storage-class-specifier} unless also declared \tcode{static}.
661+
A member shall not be declared with the \keyword{extern}
662+
\grammarterm{storage-class-specifier}. Within a class definition, a member shall not be declared with the \tcode{thread_local} \grammarterm{storage-class-specifier} unless also declared \keyword{static}.
663663

664664
\pnum
665665
The \grammarterm{decl-specifier-seq} may be omitted in constructor, destructor,
@@ -866,7 +866,7 @@
866866
it is inline\iref{dcl.inline}.
867867
\begin{note}
868868
A member function is also inline if it is declared
869-
\tcode{inline}, \keyword{constexpr}, or \keyword{consteval}.
869+
\keyword{inline}, \keyword{constexpr}, or \keyword{consteval}.
870870
\end{note}
871871

872872
\pnum
@@ -1141,7 +1141,7 @@
11411141
\end{itemize}
11421142
Constructors do not have names.
11431143
In a constructor declaration, each \grammarterm{decl-specifier} in the optional
1144-
\grammarterm{decl-specifier-seq} shall be \tcode{friend}, \tcode{inline},
1144+
\grammarterm{decl-specifier-seq} shall be \keyword{friend}, \keyword{inline},
11451145
\keyword{constexpr}, or an \grammarterm{explicit-specifier}.
11461146
\begin{example}
11471147
\begin{codeblock}
@@ -1194,14 +1194,14 @@
11941194
\indextext{\idxcode{const}!constructor and}%
11951195
\indextext{\idxcode{volatile}!constructor and}%
11961196
A constructor can be invoked for a
1197-
\tcode{const},
1197+
\keyword{const},
11981198
\tcode{volatile}
11991199
or
1200-
\tcode{const}
1200+
\keyword{const}
12011201
\tcode{volatile}
12021202
object.
12031203
\indextext{restriction!constructor}%
1204-
\tcode{const}
1204+
\keyword{const}
12051205
and
12061206
\tcode{volatile}
12071207
semantics\iref{dcl.type.cv} are not applied on an object under construction.
@@ -1431,7 +1431,7 @@
14311431
only has a copy constructor with a parameter of type
14321432
\tcode{X\&},
14331433
an initializer of type
1434-
\tcode{const}
1434+
\keyword{const}
14351435
\tcode{X}
14361436
or
14371437
\tcode{volatile}
@@ -1496,10 +1496,10 @@
14961496
\tcode{M}
14971497
(or array thereof)
14981498
has a copy constructor whose first parameter is of type
1499-
\tcode{const}
1499+
\keyword{const}
15001500
\tcode{M\&}
15011501
or
1502-
\tcode{const}
1502+
\keyword{const}
15031503
\tcode{volatile}
15041504
\tcode{M\&}.
15051505
\begin{footnote}
@@ -1846,7 +1846,7 @@
18461846
\item a variant member with a non-trivial corresponding assignment operator and
18471847
\tcode{X} is a union-like class, or
18481848

1849-
\item a non-static data member of \tcode{const} non-class
1849+
\item a non-static data member of \keyword{const} non-class
18501850
type (or array thereof), or
18511851

18521852
\item a non-static data member of reference type, or
@@ -2036,9 +2036,9 @@
20362036
Each \grammarterm{decl-specifier} of the \grammarterm{decl-specifier-seq}
20372037
of a prospective destructor declaration (if any)
20382038
shall be
2039-
\tcode{friend},
2040-
\tcode{inline},
2041-
\tcode{virtual},
2039+
\keyword{friend},
2040+
\keyword{inline},
2041+
\keyword{virtual},
20422042
\keyword{constexpr}, or
20432043
\keyword{consteval}.
20442044

@@ -2079,13 +2079,13 @@
20792079
\indextext{\idxcode{const}!destructor and}%
20802080
\indextext{\idxcode{volatile}!destructor and}%
20812081
A destructor can be invoked for a
2082-
\tcode{const},
2082+
\keyword{const},
20832083
\tcode{volatile}
20842084
or
2085-
\tcode{const}
2085+
\keyword{const}
20862086
\tcode{volatile}
20872087
object.
2088-
\tcode{const}
2088+
\keyword{const}
20892089
and
20902090
\tcode{volatile}
20912091
semantics\iref{dcl.type.cv} are not applied on an object under destruction.
@@ -2492,7 +2492,7 @@
24922492
Such functions are called \defnx{conversion functions}{conversion function}.
24932493
A \grammarterm{decl-specifier} in the \grammarterm{decl-specifier-seq}
24942494
of a conversion function (if any) shall be neither
2495-
a \grammarterm{defining-type-specifier} nor \tcode{static}.
2495+
a \grammarterm{defining-type-specifier} nor \keyword{static}.
24962496
\indextext{conversion!type of}%
24972497
The type of the conversion function\iref{dcl.fct} is
24982498
``function taking no parameter returning
@@ -2653,7 +2653,7 @@
26532653
\pnum
26542654
Static members obey the usual class member access rules\iref{class.access}.
26552655
When used in the declaration of a class
2656-
member, the \tcode{static} specifier shall only be used in the member
2656+
member, the \keyword{static} specifier shall only be used in the member
26572657
declarations that appear within the \grammarterm{member-specification} of
26582658
the class definition.
26592659
\begin{note}
@@ -2673,8 +2673,8 @@
26732673
\begin{note}
26742674
A static member function does not have a \tcode{this}
26752675
pointer\iref{expr.prim.this}.
2676-
A static member function cannot be qualified with \tcode{const},
2677-
\tcode{volatile}, or \tcode{virtual}\iref{dcl.fct}.
2676+
A static member function cannot be qualified with \keyword{const},
2677+
\tcode{volatile}, or \keyword{virtual}\iref{dcl.fct}.
26782678
\end{note}
26792679

26802680
\rSec3[class.static.data]{Static data members}
@@ -2688,7 +2688,7 @@
26882688
the objects of the class.
26892689

26902690
\pnum
2691-
A static data member shall not be \tcode{mutable}\iref{dcl.stc}.
2691+
A static data member shall not be \keyword{mutable}\iref{dcl.stc}.
26922692
A static data member shall not be a direct member\iref{class.mem}
26932693
of an unnamed\iref{class.pre} or local\iref{class.local} class or
26942694
of a (possibly indirectly) nested class\iref{class.nest} thereof.
@@ -2738,7 +2738,7 @@
27382738
\end{note}
27392739

27402740
\pnum
2741-
If a non-volatile non-inline \tcode{const} static data member is
2741+
If a non-volatile non-inline \keyword{const} static data member is
27422742
of integral or enumeration type,
27432743
its declaration in the class definition can specify a
27442744
\grammarterm{brace-or-equal-initializer} in which every
@@ -2828,7 +2828,7 @@
28282828
A non-const reference shall not be bound to a
28292829
bit-field\iref{dcl.init.ref}.
28302830
\begin{note}
2831-
If the initializer for a reference of type \tcode{const} \tcode{T\&} is
2831+
If the initializer for a reference of type \keyword{const} \tcode{T\&} is
28322832
an lvalue that refers to a bit-field, the reference is bound to a
28332833
temporary initialized to hold the value of the bit-field; the reference
28342834
is not bound to the bit-field directly. See~\ref{dcl.init.ref}.
@@ -3144,7 +3144,7 @@
31443144
\indextext{\idxcode{union}!global anonymous}%
31453145
\indextext{scope!anonymous \tcode{union} at namespace}%
31463146
Anonymous unions declared in the scope of a namespace with external linkage
3147-
shall be declared \tcode{static}. Anonymous unions declared at
3147+
shall be declared \keyword{static}. Anonymous unions declared at
31483148
block scope shall be declared with any storage class allowed for a
31493149
block variable, or with no storage class. A storage class is not
31503150
allowed in a declaration of an anonymous union in a class scope.
@@ -3489,8 +3489,8 @@
34893489
\pnum
34903490
\indextext{base class!virtual}%
34913491
A base class specifier that does not contain the keyword
3492-
\tcode{virtual} specifies a \defnadj{non-virtual}{base class}. A base
3493-
class specifier that contains the keyword \tcode{virtual} specifies a
3492+
\keyword{virtual} specifies a \defnadj{non-virtual}{base class}. A base
3493+
class specifier that contains the keyword \keyword{virtual} specifies a
34943494
\defnadj{virtual}{base class}. For each distinct occurrence of a
34953495
non-virtual base class in the class lattice of the most derived class,
34963496
the most derived object\iref{intro.object} shall contain a
@@ -3540,7 +3540,7 @@
35403540
\end{importgraphic}
35413541
For an object \tcode{c} of class type \tcode{C}, a single subobject of
35423542
type \tcode{V} is shared by every base class subobject of \tcode{c} that has a
3543-
\tcode{virtual} base class of type \tcode{V}. Given the class \tcode{C}
3543+
\keyword{virtual} base class of type \tcode{V}. Given the class \tcode{C}
35443544
defined above, an object of class \tcode{C} will have one subobject of
35453545
class \tcode{V}, as shown in \fref{class.virt}.
35463546
\indextext{DAG!multiple inheritance}%
@@ -3558,7 +3558,7 @@
35583558
class Z : public B { @\commentellip@ };
35593559
class AA : public X, public Y, public Z { @\commentellip@ };
35603560
\end{codeblock}
3561-
For an object of class \tcode{AA}, all \tcode{virtual} occurrences of
3561+
For an object of class \tcode{AA}, all \keyword{virtual} occurrences of
35623562
base class \tcode{B} in the class lattice of \tcode{AA} correspond to a
35633563
single \tcode{B} subobject within the object of type \tcode{AA}, and
35643564
every other occurrence of a (non-virtual) base class \tcode{B} in the
@@ -3584,11 +3584,11 @@
35843584

35853585
\pnum
35863586
A non-static member function is a \defnadj{virtual}{function}
3587-
if it is first declared with the keyword \tcode{virtual} or
3587+
if it is first declared with the keyword \keyword{virtual} or
35883588
if it overrides a virtual member function declared in a base class
35893589
(see below).
35903590
\begin{footnote}
3591-
The use of the \tcode{virtual} specifier in the
3591+
The use of the \keyword{virtual} specifier in the
35923592
declaration of an overriding function is valid but redundant (has empty
35933593
semantics).
35943594
\end{footnote}
@@ -3813,7 +3813,7 @@
38133813

38143814
\pnum
38153815
\begin{note}
3816-
The \tcode{virtual} specifier implies membership, so a virtual function
3816+
The \keyword{virtual} specifier implies membership, so a virtual function
38173817
cannot be a non-member\iref{dcl.fct.spec} function. Nor can a virtual
38183818
function be a static member, since a virtual function call relies on a
38193819
specific object for determining which function to invoke. A virtual
@@ -4733,7 +4733,7 @@
47334733
(\ref{temp.pre}, \ref{temp.friend}).
47344734
\end{note}
47354735
If the
4736-
type specifier in a \tcode{friend} declaration designates a (possibly
4736+
type specifier in a \keyword{friend} declaration designates a (possibly
47374737
cv-qualified) class type, that class is declared as a friend; otherwise, the
47384738
friend declaration is ignored.
47394739
\begin{example}
@@ -6380,7 +6380,7 @@
63806380
has the same \grammarterm{parameter-declaration-clause} and
63816381
trailing \grammarterm{requires-clause} as
63826382
the respective three-way comparison operator.
6383-
It is declared with \tcode{friend}, \tcode{virtual}, \keyword{constexpr},
6383+
It is declared with \keyword{friend}, \keyword{virtual}, \keyword{constexpr},
63846384
or \keyword{consteval} if
63856385
the three-way comparison operator function is so declared.
63866386
If the three-way comparison operator function
@@ -6635,7 +6635,7 @@
66356635
Any allocation function for a class
66366636
\tcode{T}
66376637
is a static member (even if not explicitly declared
6638-
\tcode{static}).
6638+
\keyword{static}).
66396639

66406640
\pnum
66416641
\begin{example}
@@ -6661,7 +6661,7 @@
66616661
Any deallocation function for a class
66626662
\tcode{X}
66636663
is a static member (even if not explicitly declared
6664-
\tcode{static}).
6664+
\keyword{static}).
66656665
\begin{example}
66666666
\begin{codeblock}
66676667
class X {
@@ -6678,7 +6678,7 @@
66786678

66796679
\pnum
66806680
Since member allocation and deallocation functions are
6681-
\tcode{static}
6681+
\keyword{static}
66826682
they cannot be virtual.
66836683
\begin{note}
66846684
However, when the

0 commit comments

Comments
 (0)