Skip to content

Commit b1cd588

Browse files
jensmaurertkoeppe
authored andcommitted
[std] Use \keyword for 'new', 'delete', 'this', 'nullptr'.
1 parent fb316b4 commit b1cd588

17 files changed

+91
-91
lines changed

source/atomics.tex

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1735,7 +1735,7 @@
17351735

17361736
\pnum
17371737
\effects
1738-
Atomically replaces the value pointed to by \tcode{this}
1738+
Atomically replaces the value pointed to by \keyword{this}
17391739
with the value of \tcode{desired}. Memory is affected according to the value of
17401740
\tcode{order}.
17411741
\end{itemdescr}
@@ -1791,7 +1791,7 @@
17911791

17921792
\pnum
17931793
\returns
1794-
Atomically returns the value pointed to by \tcode{this}.
1794+
Atomically returns the value pointed to by \keyword{this}.
17951795
\end{itemdescr}
17961796

17971797
\indexlibrarymember{operator \placeholder{type}}{atomic}%
@@ -1834,14 +1834,14 @@
18341834

18351835
\pnum
18361836
\effects
1837-
Atomically replaces the value pointed to by \tcode{this}
1837+
Atomically replaces the value pointed to by \keyword{this}
18381838
with \tcode{desired}.
18391839
Memory is affected according to the value of \tcode{order}.
18401840
These operations are atomic read-modify-write operations\iref{intro.multithread}.
18411841

18421842
\pnum
18431843
\returns
1844-
Atomically returns the value pointed to by \tcode{this} immediately before the effects.
1844+
Atomically returns the value pointed to by \keyword{this} immediately before the effects.
18451845
\end{itemdescr}
18461846

18471847
\indexlibraryglobal{atomic_compare_exchange_weak}%
@@ -1889,10 +1889,10 @@
18891889
\pnum
18901890
\effects
18911891
Retrieves the value in \tcode{expected}. It then atomically
1892-
compares the value representation of the value pointed to by \tcode{this}
1892+
compares the value representation of the value pointed to by \keyword{this}
18931893
for equality with that previously retrieved from \tcode{expected},
18941894
and if true, replaces the value pointed to
1895-
by \tcode{this} with that in \tcode{desired}.
1895+
by \keyword{this} with that in \tcode{desired}.
18961896
If and only if the comparison is \tcode{true}, memory is affected according to the
18971897
value of \tcode{success}, and if the comparison is false, memory is affected according
18981898
to the value of \tcode{failure}. When only one \tcode{memory_order} argument is
@@ -1903,11 +1903,11 @@
19031903
\tcode{memory_order::relaxed}.
19041904
If and only if the comparison is false then, after the atomic operation,
19051905
the value in \tcode{expected} is replaced by the value
1906-
pointed to by \tcode{this} during the atomic comparison.
1906+
pointed to by \keyword{this} during the atomic comparison.
19071907
If the operation returns \tcode{true}, these
19081908
operations are atomic read-modify-write
19091909
operations\iref{intro.multithread} on the memory
1910-
pointed to by \tcode{this}.
1910+
pointed to by \keyword{this}.
19111911
Otherwise, these operations are atomic load operations on that memory.
19121912

19131913
\pnum
@@ -1958,7 +1958,7 @@
19581958
\pnum
19591959
\remarks
19601960
A weak compare-and-exchange operation may fail spuriously. That is, even when
1961-
the contents of memory referred to by \tcode{expected} and \tcode{this} are
1961+
the contents of memory referred to by \tcode{expected} and \keyword{this} are
19621962
equal, it may return \tcode{false} and store back to \tcode{expected} the same memory
19631963
contents that were originally there.
19641964
\begin{note}
@@ -2277,14 +2277,14 @@
22772277
\pnum
22782278
\effects
22792279
Atomically replaces the value pointed to by
2280-
\tcode{this} with the result of the computation applied to the
2281-
value pointed to by \tcode{this} and the given \tcode{operand}.
2280+
\keyword{this} with the result of the computation applied to the
2281+
value pointed to by \keyword{this} and the given \tcode{operand}.
22822282
Memory is affected according to the value of \tcode{order}.
22832283
These operations are atomic read-modify-write operations\iref{intro.multithread}.
22842284

22852285
\pnum
22862286
\returns
2287-
Atomically, the value pointed to by \tcode{this} immediately before the effects.
2287+
Atomically, the value pointed to by \keyword{this} immediately before the effects.
22882288

22892289
\pnum
22902290
\indextext{signed integer representation!two's complement}%
@@ -2439,15 +2439,15 @@
24392439

24402440
\pnum
24412441
\effects
2442-
Atomically replaces the value pointed to by \tcode{this}
2442+
Atomically replaces the value pointed to by \keyword{this}
24432443
with the result of the computation applied to the value pointed
2444-
to by \tcode{this} and the given \tcode{operand}.
2444+
to by \keyword{this} and the given \tcode{operand}.
24452445
Memory is affected according to the value of \tcode{order}.
24462446
These operations are atomic read-modify-write operations\iref{intro.multithread}.
24472447

24482448
\pnum
24492449
\returns
2450-
Atomically, the value pointed to by \tcode{this} immediately before the effects.
2450+
Atomically, the value pointed to by \keyword{this} immediately before the effects.
24512451

24522452
\pnum
24532453
\remarks
@@ -2620,14 +2620,14 @@
26202620
\pnum
26212621
\effects
26222622
Atomically replaces the value pointed to by
2623-
\tcode{this} with the result of the computation applied to the
2624-
value pointed to by \tcode{this} and the given \tcode{operand}.
2623+
\keyword{this} with the result of the computation applied to the
2624+
value pointed to by \keyword{this} and the given \tcode{operand}.
26252625
Memory is affected according to the value of \tcode{order}.
26262626
These operations are atomic read-modify-write operations\iref{intro.multithread}.
26272627

26282628
\pnum
26292629
\returns
2630-
Atomically, the value pointed to by \tcode{this} immediately before the effects.
2630+
Atomically, the value pointed to by \keyword{this} immediately before the effects.
26312631

26322632
\pnum
26332633
\remarks
@@ -2876,7 +2876,7 @@
28762876

28772877
\pnum
28782878
\effects
2879-
Atomically replaces the value pointed to by \tcode{this} with
2879+
Atomically replaces the value pointed to by \keyword{this} with
28802880
the value of \tcode{desired} as if by \tcode{p.swap(desired)}.
28812881
Memory is affected according to the value of \tcode{order}.
28822882
\end{itemdescr}
@@ -2980,7 +2980,7 @@
29802980
If the operation returns \tcode{true},
29812981
\tcode{expected} is not accessed after the atomic update and
29822982
the operation is an atomic read-modify-write operation\iref{intro.multithread}
2983-
on the memory pointed to by \tcode{this}.
2983+
on the memory pointed to by \keyword{this}.
29842984
Otherwise, the operation is an atomic load operation on that memory, and
29852985
\tcode{expected} is updated with the existing value
29862986
read from the atomic object in the attempted atomic update.
@@ -3183,7 +3183,7 @@
31833183

31843184
\pnum
31853185
\effects
3186-
Atomically replaces the value pointed to by \tcode{this} with
3186+
Atomically replaces the value pointed to by \keyword{this} with
31873187
the value of \tcode{desired} as if by \tcode{p.swap(desired)}.
31883188
Memory is affected according to the value of \tcode{order}.
31893189
\end{itemdescr}
@@ -3286,7 +3286,7 @@
32863286
If the operation returns \tcode{true},
32873287
\tcode{expected} is not accessed after the atomic update and
32883288
the operation is an atomic read-modify-write operation\iref{intro.multithread}
3289-
on the memory pointed to by \tcode{this}.
3289+
on the memory pointed to by \keyword{this}.
32903290
Otherwise, the operation is an atomic load operation on that memory, and
32913291
\tcode{expected} is updated with the existing value
32923292
read from the atomic object in the attempted atomic update.
@@ -3498,7 +3498,7 @@
34983498

34993499
\pnum
35003500
\returns
3501-
Atomically returns the value pointed to by \tcode{object} or \tcode{this}.
3501+
Atomically returns the value pointed to by \tcode{object} or \keyword{this}.
35023502
\end{itemdescr}
35033503

35043504
\indexlibraryglobal{atomic_flag_test_and_set}%
@@ -3516,7 +3516,7 @@
35163516
\begin{itemdescr}
35173517
\pnum
35183518
\effects
3519-
Atomically sets the value pointed to by \tcode{object} or by \tcode{this} to \tcode{true}. Memory is affected according to the value of
3519+
Atomically sets the value pointed to by \tcode{object} or by \keyword{this} to \tcode{true}. Memory is affected according to the value of
35203520
\tcode{order}. These operations are atomic read-modify-write operations\iref{intro.multithread}.
35213521

35223522
\pnum
@@ -3544,7 +3544,7 @@
35443544

35453545
\pnum
35463546
\effects
3547-
Atomically sets the value pointed to by \tcode{object} or by \tcode{this} to
3547+
Atomically sets the value pointed to by \tcode{object} or by \keyword{this} to
35483548
\tcode{false}. Memory is affected according to the value of \tcode{order}.
35493549
\end{itemdescr}
35503550

@@ -3569,7 +3569,7 @@
35693569
For \tcode{atomic_flag_wait},
35703570
let \tcode{order} be \tcode{memory_order::seq_cst}.
35713571
Let \tcode{flag} be \tcode{object} for the non-member functions and
3572-
\tcode{this} for the member functions.
3572+
\keyword{this} for the member functions.
35733573

35743574
\pnum
35753575
\expects

source/basic.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3419,7 +3419,7 @@
34193419
void B::mutate() {
34203420
new (this) D2; // reuses storage --- ends the lifetime of \tcode{*this}
34213421
f(); // undefined behavior
3422-
... = this; // OK, \tcode{this} points to valid memory
3422+
... = this; // OK, \keyword{this} points to valid memory
34233423
}
34243424

34253425
void g() {

source/classes.tex

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,7 @@
10031003
\indextext{member function!const volatile}%
10041004
\begin{note}
10051005
A non-static member function can be declared with
1006-
\grammarterm{cv-qualifier}{s}, which affect the type of the \tcode{this}
1006+
\grammarterm{cv-qualifier}{s}, which affect the type of the \keyword{this}
10071007
pointer\iref{expr.prim.this},
10081008
and/or a \grammarterm{ref-qualifier}\iref{dcl.fct};
10091009
both affect overload resolution\iref{over.match.funcs}
@@ -2257,7 +2257,7 @@
22572257
the destructor is invoked via a null pointer value), the program has
22582258
undefined behavior.
22592259
\begin{note}
2260-
Invoking \tcode{delete} on a null pointer does not call the
2260+
Invoking \keyword{delete} on a null pointer does not call the
22612261
destructor; see \ref{expr.delete}.
22622262
\end{note}
22632263
\begin{example}
@@ -2671,7 +2671,7 @@
26712671

26722672
\pnum
26732673
\begin{note}
2674-
A static member function does not have a \tcode{this}
2674+
A static member function does not have a \keyword{this}
26752675
pointer\iref{expr.prim.this}.
26762676
A static member function cannot be qualified with \keyword{const},
26772677
\tcode{volatile}, or \keyword{virtual}\iref{dcl.fct}.
@@ -4962,8 +4962,8 @@
49624962
void D2::mem(B* pb, D1* p1) {
49634963
pb->i = 1; // error
49644964
p1->i = 2; // error
4965-
i = 3; // OK (access through \tcode{this})
4966-
B::i = 4; // OK (access through \tcode{this}, qualification ignored)
4965+
i = 3; // OK (access through \keyword{this})
4966+
B::i = 4; // OK (access through \keyword{this}, qualification ignored)
49674967
int B::* pmi_B = &B::i; // error
49684968
int B::* pmi_B2 = &D2::i; // OK
49694969
j = 5; // OK (because \tcode{j} refers to static member)
@@ -5845,7 +5845,7 @@
58455845
if the value of the object or any of its subobjects is
58465846
accessed through a glvalue that is not obtained, directly or indirectly, from
58475847
the constructor's
5848-
\tcode{this}
5848+
\keyword{this}
58495849
pointer, the value of the object or subobject thus obtained is unspecified.
58505850
\begin{example}
58515851
\begin{codeblock}

source/compatibility.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@
12881288
\keyword{constexpr},
12891289
\tcode{decltype},
12901290
\keyword{noexcept},
1291-
\tcode{nullptr},
1291+
\keyword{nullptr},
12921292
\tcode{static_assert},
12931293
and
12941294
\tcode{thread_local}.

source/containers.tex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1352,7 +1352,7 @@
13521352
\effects
13531353
Constructs a \exposid{node-handle} object initializing
13541354
\tcode{ptr_} with \tcode{nh.ptr_}. Move constructs \tcode{alloc_} with
1355-
\tcode{nh.alloc_}. Assigns \tcode{nullptr} to \tcode{nh.ptr_} and assigns
1355+
\tcode{nh.alloc_}. Assigns \keyword{nullptr} to \tcode{nh.ptr_} and assigns
13561356
\tcode{nullopt} to \tcode{nh.alloc_}.
13571357
\end{itemdescr}
13581358

@@ -1383,7 +1383,7 @@
13831383
move assigns \tcode{nh.alloc_} to \tcode{alloc_}.
13841384
\item
13851385
Assigns
1386-
\tcode{nullptr} to \tcode{nh.ptr_} and assigns \tcode{nullopt} to
1386+
\keyword{nullptr} to \tcode{nh.ptr_} and assigns \tcode{nullopt} to
13871387
\tcode{nh.alloc_}.
13881388
\end{itemize}
13891389

source/declarations.tex

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,7 +2263,7 @@
22632263
and as an argument of
22642264
\tcode{sizeof},
22652265
\tcode{alignof},
2266-
\tcode{new},
2266+
\keyword{new},
22672267
or
22682268
\tcode{typeid},
22692269
the name of a type shall be specified.
@@ -4042,7 +4042,7 @@
40424042
\pnum
40434043
\begin{note}
40444044
The keyword
4045-
\tcode{this}
4045+
\keyword{this}
40464046
cannot appear in a default argument of a member function;
40474047
see~\ref{expr.prim.this}.
40484048
\begin{example}
@@ -6042,7 +6042,7 @@
60426042

60436043
\pnum
60446044
\begin{note}
6045-
A \grammarterm{cv-qualifier-seq} affects the type of \tcode{this}
6045+
A \grammarterm{cv-qualifier-seq} affects the type of \keyword{this}
60466046
in the body of a member function; see~\ref{expr.prim.this}.
60476047
\end{note}
60486048

@@ -6471,12 +6471,12 @@
64716471
in the scope of the promise type\iref{class.member.lookup} finds
64726472
any declarations, then the result
64736473
of a call to an allocation function used to obtain storage for the coroutine
6474-
state is assumed to return \tcode{nullptr} if it fails to obtain storage,
6474+
state is assumed to return \keyword{nullptr} if it fails to obtain storage,
64756475
and if a global allocation function is selected,
64766476
the \tcode{::operator new(size_t, nothrow_t)} form is used.
64776477
The allocation function used in this case shall have a non-throwing
64786478
\grammarterm{noexcept-specifier}.
6479-
If the allocation function returns \tcode{nullptr}, the coroutine returns
6479+
If the allocation function returns \keyword{nullptr}, the coroutine returns
64806480
control to the caller of the coroutine and the return value is obtained by a
64816481
call to \tcode{T::get_return_object_on_allocation_failure()}, where \tcode{T}
64826482
is the promise type.

source/expressions.tex

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@
12401240

12411241
\pnum
12421242
Otherwise, if a \grammarterm{member-declarator} declares a non-static data
1243-
member\iref{class.mem} of a class \tcode{X}, the expression \tcode{this} is
1243+
member\iref{class.mem} of a class \tcode{X}, the expression \keyword{this} is
12441244
a prvalue of type ``pointer to \tcode{X}''
12451245
wherever \tcode{X} is the current class
12461246
within the
@@ -2000,7 +2000,7 @@
20002000
void f() {
20012001
[=]()->int {
20022002
return operator()(this->x + y); // equivalent to \tcode{S1::operator()(this->x + (*this).y)}
2003-
// \tcode{this} has type \tcode{S1*}
2003+
// \keyword{this} has type \tcode{S1*}
20042004
};
20052005
}
20062006
};
@@ -2109,7 +2109,7 @@
21092109
[=, *this]{ }; // OK
21102110
[=, this]{ }; // OK, equivalent to \tcode{[=]}
21112111
[i, i]{ }; // error: \tcode{i} repeated
2112-
[this, *this]{ }; // error: \tcode{this} appears twice
2112+
[this, *this]{ }; // error: \keyword{this} appears twice
21132113
}
21142114
\end{codeblock}
21152115
\end{example}
@@ -2289,7 +2289,7 @@
22892289
x += m; // OK: \tcode{m} implicitly captured by \tcode{m4} and explicitly captured by \tcode{m3}
22902290
x += i; // error: \tcode{i} is odr-used but not odr-usable
22912291
// due to intervening function and class scopes
2292-
x += f; // OK: \tcode{this} captured implicitly by \tcode{m4} and explicitly by \tcode{m3}
2292+
x += f; // OK: \keyword{this} captured implicitly by \tcode{m4} and explicitly by \tcode{m3}
22932293
};
22942294
};
22952295
}
@@ -2350,7 +2350,7 @@
23502350
the captured entity is not \tcode{*\keyword{this}}, or
23512351
\item
23522352
it is explicitly captured with a capture that is not of the form
2353-
\tcode{this},
2353+
\keyword{this},
23542354
\tcode{\&} \grammarterm{identifier}, or
23552355
\tcode{\&} \grammarterm{identifier} \grammarterm{initializer}.
23562356
\end{itemize}
@@ -4906,7 +4906,7 @@
49064906
(new int) (*[10])(); // error
49074907
\end{codeblock}
49084908

4909-
Instead, the explicitly parenthesized version of the \tcode{new}
4909+
Instead, the explicitly parenthesized version of the \keyword{new}
49104910
operator can be used to create objects of compound
49114911
types\iref{basic.compound}:
49124912

@@ -5227,7 +5227,7 @@
52275227
a placement allocation function, except when referencing
52285228
the library function \tcode{operator new[](std::size_t, void*)}.
52295229
The amount of overhead may vary from one
5230-
invocation of \tcode{new} to another.
5230+
invocation of \keyword{new} to another.
52315231
\end{example}
52325232

52335233
\pnum

0 commit comments

Comments
 (0)