Skip to content

Commit cf0fdfb

Browse files
committed
[std] Use \keyword for void.
1 parent 1e45f31 commit cf0fdfb

18 files changed

+143
-143
lines changed

source/basic.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -5148,7 +5148,7 @@
51485148

51495149
\pnum
51505150
\indextext{terminology!pointer}%
5151-
The type of a pointer to \cv{}~\tcode{void} or a pointer to an object type is
5151+
The type of a pointer to \cv{}~\keyword{void} or a pointer to an object type is
51525152
called an \defn{object pointer type}.
51535153
\begin{note}
51545154
A pointer to \keyword{void}

source/classes.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -2500,10 +2500,10 @@
25002500
A conversion function is never used to convert a (possibly cv-qualified) object
25012501
to the (possibly cv-qualified) same object type (or a reference to it),
25022502
to a (possibly cv-qualified) base class of that type (or a reference to it),
2503-
or to \cv{}~\tcode{void}.
2503+
or to \cv{}~\keyword{void}.
25042504
\begin{footnote}
25052505
These conversions are considered
2506-
as standard conversions for the purposes of overload resolution~(\ref{over.best.ics}, \ref{over.ics.ref}) and therefore initialization\iref{dcl.init} and explicit casts\iref{expr.static.cast}. A conversion to \tcode{void} does not invoke any conversion function\iref{expr.static.cast}.
2506+
as standard conversions for the purposes of overload resolution~(\ref{over.best.ics}, \ref{over.ics.ref}) and therefore initialization\iref{dcl.init} and explicit casts\iref{expr.static.cast}. A conversion to \keyword{void} does not invoke any conversion function\iref{expr.static.cast}.
25072507
Even though never directly called to perform a conversion,
25082508
such conversion functions can be declared and can potentially
25092509
be reached through a call to a virtual conversion function in a base class.
@@ -2699,7 +2699,7 @@
26992699
The declaration of a non-inline
27002700
static data member in its class definition
27012701
is not a definition and may be of an incomplete type other than
2702-
\cv{}~\tcode{void}.
2702+
\cv{}~\keyword{void}.
27032703
\indextext{operator use!scope resolution}%
27042704
\begin{note}
27052705
The \grammarterm{initializer} in the definition of a

source/compatibility.tex

+3-3
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@
521521
\diffref{forward.list,list}
522522
\change
523523
Return types of \tcode{remove}, \tcode{remove_if}, and \tcode{unique}
524-
changed from \tcode{void} to \tcode{container::size_type}.
524+
changed from \keyword{void} to \tcode{container::size_type}.
525525
\rationale
526526
Improve efficiency and convenience of finding number of removed elements.
527527
\effect
@@ -1641,7 +1641,7 @@
16411641

16421642
\diffref{sequence.reqmts,associative.reqmts}
16431643
\change
1644-
Signature changes: from \tcode{void} return types.
1644+
Signature changes: from \keyword{void} return types.
16451645
\rationale
16461646
Old signature threw away useful information that may be expensive
16471647
to recalculate.
@@ -1654,7 +1654,7 @@
16541654
\item \tcode{insert(pos, beg, end)} for \tcode{vector}, \tcode{deque}, \tcode{list}, \tcode{forward_list}
16551655
\end{itemize}
16561656

1657-
Valid \CppIII{} code that relies on these functions returning \tcode{void}
1657+
Valid \CppIII{} code that relies on these functions returning \keyword{void}
16581658
(e.g., code that creates a pointer to member function that points to one
16591659
of these functions) will fail to compile with this revision of \Cpp{}.
16601660

source/concepts.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@
662662
\begin{note}
663663
Whenever \tcode{ranges::swap(E1, E2)} is a valid expression, it
664664
exchanges the values denoted by
665-
\tcode{E1} and \tcode{E2} and has type \tcode{void}.
665+
\tcode{E1} and \tcode{E2} and has type \keyword{void}.
666666
\end{note}
667667

668668
\begin{itemdecl}

source/containers.tex

+25-25
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
linear \\ \rowsep
194194

195195
\tcode{a.\~X()} &
196-
\tcode{void} &
196+
\keyword{void} &
197197
&
198198
\effects destroys every element of \tcode{a}; any memory obtained is deallocated. &
199199
linear \\ \rowsep
@@ -243,13 +243,13 @@
243243
linear \\ \rowsep
244244

245245
\tcode{a.swap(b)} &
246-
\tcode{void} &
246+
\keyword{void} &
247247
&
248248
\effects exchanges the contents of \tcode{a} and \tcode{b} &
249249
(Note A) \\ \rowsep
250250

251251
\tcode{swap(a, b)} &
252-
\tcode{void} &
252+
\keyword{void} &
253253
Equivalent to \tcode{a.swap(b)} &
254254
&
255255
(Note A) \\ \rowsep
@@ -732,7 +732,7 @@
732732
linear \\ \rowsep
733733

734734
\tcode{a.swap(b)} &
735-
\tcode{void} &
735+
\keyword{void} &
736736
\effects exchanges the contents of \tcode{a} and \tcode{b} &
737737
constant \\ \rowsep
738738

@@ -961,14 +961,14 @@
961961
\effects\ Erases the elements in the range \tcode{[q1, q2)}. \\ \rowsep
962962

963963
\tcode{a.clear()} &
964-
\tcode{void} &
964+
\keyword{void} &
965965
\effects Destroys all elements in \tcode{a}. Invalidates all references, pointers, and
966966
iterators referring to the elements of \tcode{a} and may invalidate the past-the-end iterator.\br
967967
\ensures \tcode{a.empty()} is \tcode{true}.\br
968968
\complexity Linear. \\ \rowsep
969969

970970
\tcode{a.assign(i,j)} &
971-
\tcode{void} &
971+
\keyword{void} &
972972
\expects \tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}
973973
and assignable from \tcode{*i}. For \tcode{vector}, if the iterator does not
974974
meet the forward iterator requirements\iref{forward.iterators}, \tcode{T}
@@ -984,11 +984,11 @@
984984
Each iterator in the range \range{i}{j} shall be dereferenced exactly once. \\ \rowsep
985985

986986
\tcode{a.assign(il)} &
987-
\tcode{void} &
987+
\keyword{void} &
988988
\tcode{a.assign(il.begin(), il.end())}. \\ \rowsep
989989

990990
\tcode{a.assign(n,t)} &
991-
\tcode{void} &
991+
\keyword{void} &
992992
\expects \tcode{T} is
993993
\oldconcept{CopyInsertable} into \tcode{X}
994994
and \oldconcept{CopyAssignable}.
@@ -1151,7 +1151,7 @@
11511151
\\ \rowsep
11521152

11531153
\tcode{a.push_front(t)} &
1154-
\tcode{void} &
1154+
\keyword{void} &
11551155
\effects Prepends a copy of \tcode{t}.\br
11561156
\expects \tcode{T} is
11571157
\oldconcept{CopyInsertable} into \tcode{X}.
@@ -1162,7 +1162,7 @@
11621162
\\ \rowsep
11631163

11641164
\tcode{a.push_front(rv)} &
1165-
\tcode{void} &
1165+
\keyword{void} &
11661166
\effects Prepends a copy of \tcode{rv}.\br
11671167
\expects \tcode{T} is
11681168
\oldconcept{MoveInsertable} into \tcode{X}.
@@ -1173,7 +1173,7 @@
11731173
\\ \rowsep
11741174

11751175
\tcode{a.push_back(t)} &
1176-
\tcode{void} &
1176+
\keyword{void} &
11771177
\effects Appends a copy of \tcode{t}.\br
11781178
\expects \tcode{T} is
11791179
\oldconcept{CopyInsertable} into \tcode{X}.
@@ -1185,7 +1185,7 @@
11851185
\\ \rowsep
11861186

11871187
\tcode{a.push_back(rv)} &
1188-
\tcode{void} &
1188+
\keyword{void} &
11891189
\effects Appends a copy of \tcode{rv}.\br
11901190
\expects \tcode{T} is
11911191
\oldconcept{MoveInsertable} into \tcode{X}.
@@ -1197,7 +1197,7 @@
11971197
\\ \rowsep
11981198

11991199
\tcode{a.pop_front()} &
1200-
\tcode{void} &
1200+
\keyword{void} &
12011201
\effects Destroys the first element.\br
12021202
\expects \tcode{a.empty()} is \tcode{false}. &
12031203
\tcode{deque},
@@ -1206,7 +1206,7 @@
12061206
\\ \rowsep
12071207

12081208
\tcode{a.pop_back()} &
1209-
\tcode{void} &
1209+
\keyword{void} &
12101210
\effects Destroys the last element.\br
12111211
\expects \tcode{a.empty()} is \tcode{false}. &
12121212
\tcode{basic_string},
@@ -1935,7 +1935,7 @@
19351935
is inserted right before \tcode{p}. \\ \rowsep
19361936

19371937
\tcode{a.\brk{}insert(\brk{}i, j)} &
1938-
\tcode{void} &
1938+
\keyword{void} &
19391939
\expects \tcode{value_type} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}.
19401940
Neither \tcode{i} nor \tcode{j} are iterators into \tcode{a}.\br
19411941
\effects Inserts each element from the range \range{i}{j} if and only if there
@@ -1944,7 +1944,7 @@
19441944
$N \log (\tcode{a.size()} + N)$, where $N$ has the value \tcode{distance(i, j)} \\ \rowsep
19451945

19461946
\tcode{a.\brk{}insert(\brk{}il)} &
1947-
\tcode{void} &
1947+
\keyword{void} &
19481948
\effects
19491949
Equivalent to \tcode{a.insert(il.begin(), il.end())} &
19501950
\\ \rowsep
@@ -2008,7 +2008,7 @@
20082008

20092009
\indexordmem{merge}%
20102010
\tcode{a.merge(a2)} &
2011-
\tcode{void} &
2011+
\keyword{void} &
20122012
\expects \tcode{a.get_allocator() == a2.get_allocator()}.\br
20132013
\effects Attempts to extract each element in \tcode{a2} and insert it into \tcode{a}
20142014
using the comparison object of \tcode{a}. In containers with unique keys,
@@ -2056,7 +2056,7 @@
20562056

20572057
\indexordmem{clear}%
20582058
\tcode{a.clear()} &
2059-
\tcode{void} &
2059+
\keyword{void} &
20602060
\effects Equivalent to \tcode{a.erase(a.begin(), a.end())}.\br
20612061
\ensures \tcode{a.empty()} is \tcode{true}. &
20622062
linear in \tcode{a.size()}. \\ \rowsep
@@ -2747,7 +2747,7 @@
27472747
\\ \rowsep
27482748
%
27492749
\tcode{a.insert(i, j)}
2750-
& \tcode{void}
2750+
& \keyword{void}
27512751
& \expects \tcode{value_type} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}.
27522752
Neither \tcode{i} nor \tcode{j} are iterators into \tcode{a}.\br
27532753
\effects Equivalent to \tcode{a.insert(t)} for each element in \tcode{[i,j)}.%
@@ -2756,7 +2756,7 @@
27562756
\\ \rowsep
27572757
%
27582758
\tcode{a.insert(il)}
2759-
& \tcode{void}
2759+
& \keyword{void}
27602760
& Same as \tcode{a.insert(il.begin(), il.end())}.
27612761
& Same as \tcode{a.insert(} \tcode{il.begin(),} \tcode{il.end())}.
27622762
\\ \rowsep
@@ -2820,7 +2820,7 @@
28202820
%
28212821
\indexunordmem{merge}%
28222822
\tcode{a.merge(a2)} &
2823-
\tcode{void} &
2823+
\keyword{void} &
28242824
\expects \tcode{a.get_allocator() == a2.get_allocator()}.\br
28252825
Attempts to extract each element in \tcode{a2} and insert it into \tcode{a}
28262826
using the hash function and key equality predicate of \tcode{a}.
@@ -2869,7 +2869,7 @@
28692869
%
28702870
\indexunordmem{clear}%
28712871
\tcode{a.clear()}
2872-
& \tcode{void}
2872+
& \keyword{void}
28732873
& \effects Erases all elements in the container.\br
28742874
\ensures \tcode{a.empty()} is \tcode{true}%
28752875
& Linear in \tcode{a.size()}.
@@ -3034,23 +3034,23 @@
30343034
\\ \rowsep
30353035
%
30363036
\tcode{a.max_load_factor(z)}
3037-
& \tcode{void}
3037+
& \keyword{void}
30383038
& \expects \tcode{z} is positive.
30393039
May change the container's maximum load factor, using \tcode{z} as a hint.%
30403040
& Constant
30413041
\\ \rowsep
30423042
%
30433043
\indexunordmem{rehash}%
30443044
\tcode{a.rehash(n)}
3045-
& \tcode{void}
3045+
& \keyword{void}
30463046
& \ensures \tcode{a.bucket_count() >= a.size() / a.max_load_factor()} and
30473047
\tcode{a.bucket_count() >= n}.%
30483048
& Average case linear in \tcode{a.size()}, worst case quadratic.
30493049
\\ \rowsep
30503050

30513051
\indexunordmem{reserve}%
30523052
\tcode{a.reserve(n)} &
3053-
\tcode{void} &
3053+
\keyword{void} &
30543054
Same as \tcode{a.rehash(ceil(n /} \tcode{a.max_load_factor()))}. &
30553055
Average case linear in \tcode{a.size()}, worst case quadratic. \\
30563056

source/declarations.tex

+13-13
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,7 @@
14001400
\tcode{float} & ``\tcode{float}'' \\
14011401
\tcode{double} & ``\tcode{double}'' \\
14021402
\tcode{long double} & ``\tcode{long double}'' \\
1403-
\tcode{void} & ``\tcode{void}'' \\
1403+
\keyword{void} & ``\tcode{void}'' \\
14041404
\end{simpletypetable}
14051405

14061406
\pnum
@@ -1768,7 +1768,7 @@
17681768
body.
17691769
\begin{example}
17701770
\begin{codeblock}
1771-
auto f() { } // OK, return type is \tcode{void}
1771+
auto f() { } // OK, return type is \keyword{void}
17721772
auto* g() { } // error: cannot deduce \tcode{auto*} from \tcode{void()}
17731773
\end{codeblock}
17741774
\end{example}
@@ -1925,7 +1925,7 @@
19251925
\end{itemize}
19261926

19271927
In the case of a \tcode{return} statement with no operand
1928-
or with an operand of type \tcode{void},
1928+
or with an operand of type \keyword{void},
19291929
\tcode{T} shall be either
19301930
\opt{\grammarterm{type-constraint}} \tcode{decltype(auto)} or
19311931
\cv{}~\opt{\grammarterm{type-constraint}} \tcode{auto}.
@@ -2850,7 +2850,7 @@
28502850
\end{note}
28512851
\indextext{\idxcode{void\&}}%
28522852
A declarator that specifies the type
2853-
``reference to \cv{}~\tcode{void}''
2853+
``reference to \cv{}~\keyword{void}''
28542854
is ill-formed.
28552855

28562856

@@ -3091,7 +3091,7 @@
30913091
of a class\iref{class.static},
30923092
a member with reference type,
30933093
or
3094-
``\cv{}~\tcode{void}''.
3094+
``\cv{}~\keyword{void}''.
30953095

30963096
\pnum
30973097
\begin{note}
@@ -3147,10 +3147,10 @@
31473147
a reference type,
31483148
a function type,
31493149
an array of unknown bound, or
3150-
\cv{}~\tcode{void}.
3150+
\cv{}~\keyword{void}.
31513151
\begin{note}
31523152
An array can be constructed
3153-
from one of the fundamental types (except \tcode{void}),
3153+
from one of the fundamental types (except \keyword{void}),
31543154
from a pointer,
31553155
from a pointer to member,
31563156
from a class,
@@ -3437,10 +3437,10 @@
34373437
\grammarterm{parameter-declaration-clause}
34383438
is empty, the function takes no arguments.
34393439
A parameter list consisting of a single unnamed parameter of
3440-
non-dependent type \tcode{void} is equivalent to an empty parameter
3440+
non-dependent type \keyword{void} is equivalent to an empty parameter
34413441
list.
34423442
\indextext{parameter!\idxcode{void}}%
3443-
Except for this special case, a parameter shall not have type \cv{}~\tcode{void}.
3443+
Except for this special case, a parameter shall not have type \cv{}~\keyword{void}.
34443444
A parameter with volatile-qualified type is deprecated;
34453445
see~\ref{depr.volatile.type}.
34463446
If the
@@ -3605,7 +3605,7 @@
36053605
\pnum
36063606
\indextext{function return type|see{return type}}%
36073607
\indextext{return type}%
3608-
The return type shall be a non-array object type, a reference type, or \cv{}~\tcode{void}.
3608+
The return type shall be a non-array object type, a reference type, or \cv{}~\keyword{void}.
36093609

36103610
\pnum
36113611
A volatile-qualified return type is deprecated;
@@ -5994,7 +5994,7 @@
59945994

59955995
\pnum
59965996
In a \grammarterm{function-definition},
5997-
either \tcode{void} \grammarterm{declarator} \tcode{;}
5997+
either \keyword{void} \grammarterm{declarator} \tcode{;}
59985998
or \grammarterm{declarator} \tcode{;}
59995999
shall be a well-formed function declaration
60006000
as described in~\ref{dcl.fct}.
@@ -8833,7 +8833,7 @@
88338833
\recommended
88348834
Appearance of a nodiscard call as
88358835
a potentially-evaluated discarded-value expression\iref{expr.prop}
8836-
is discouraged unless explicitly cast to \tcode{void}.
8836+
is discouraged unless explicitly cast to \keyword{void}.
88378837
Implementations should issue a warning in such cases.
88388838
\begin{note}
88398839
This is typically because discarding the return value
@@ -8859,7 +8859,7 @@
88598859
void launch_missiles();
88608860
void test_missiles() {
88618861
my_scopeguard(); // warning encouraged
8862-
(void)my_scopeguard(), // warning not encouraged, cast to \tcode{void}
8862+
(void)my_scopeguard(), // warning not encouraged, cast to \keyword{void}
88638863
launch_missiles(); // comma operator, statement continues
88648864
my_unique(42); // warning encouraged
88658865
my_unique(); // warning not encouraged

0 commit comments

Comments
 (0)