Skip to content

Commit 866c145

Browse files
jensmaurertkoeppe
authored andcommitted
[variant] Use \tcode for type designators, not math mode. (#1125)
Fixes #1115.
1 parent 22c396b commit 866c145

File tree

1 file changed

+61
-61
lines changed

1 file changed

+61
-61
lines changed

source/utilities.tex

Lines changed: 61 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -4220,7 +4220,7 @@
42204220

42214221
\pnum
42224222
In the descriptions that follow, let $i$ be in the range \range{0}{sizeof...(Types)},
4223-
and $T_i$ be the $i^{th}$ type in \tcode{Types...}.
4223+
and \tcode{T}$_i$ be the $i^{th}$ type in \tcode{Types...}.
42244224

42254225
\indexlibrary{\idxcode{variant}!constructor}%
42264226
\begin{itemdecl}
@@ -4230,25 +4230,25 @@
42304230
\begin{itemdescr}
42314231
\pnum
42324232
\effects
4233-
Constructs a \tcode{variant} holding a value-initialized value of type $T_0$.
4233+
Constructs a \tcode{variant} holding a value-initialized value of type \tcode{T}$_0$.
42344234

42354235
\pnum
42364236
\postconditions
42374237
\tcode{valueless_by_exception()} is \tcode{false} and \tcode{index()} is \tcode{0}.
42384238

42394239
\pnum
42404240
\throws
4241-
Any exception thrown by the value-initialization of $T_0$.
4241+
Any exception thrown by the value-initialization of \tcode{T}$_0$.
42424242

42434243
\pnum
42444244
\remarks
42454245
This function shall be \tcode{constexpr} if and only if the
4246-
value-initialization of the alternative type $T_0$ would satisfy the
4246+
value-initialization of the alternative type \tcode{T}$_0$ would satisfy the
42474247
requirements for a \tcode{constexpr} function.
42484248
The expression inside \tcode{noexcept} is equivalent to
4249-
\tcode{is_nothrow_default_constructible_v<$T_0$>}.
4249+
\tcode{is_nothrow_default_constructible_v<\tcode{T}$_0$>}.
42504250
This function shall not participate in overload resolution unless
4251-
\tcode{is_default_constructible_v<$T_0$>} is \tcode{true}.
4251+
\tcode{is_default_constructible_v<\tcode{T}$_0$>} is \tcode{true}.
42524252
\begin{note} See also class \tcode{monostate}. \end{note}
42534253
\end{itemdescr}
42544254

@@ -4267,12 +4267,12 @@
42674267

42684268
\pnum
42694269
\throws
4270-
Any exception thrown by direct-initializing any $T_i$ for all $i$.
4270+
Any exception thrown by direct-initializing any \tcode{T}$_i$ for all $i$.
42714271

42724272
\pnum
42734273
\remarks
42744274
This function shall not participate in overload resolution unless
4275-
\tcode{is_copy_constructible_v<$T_i$>} is \tcode{true} for all $i$.
4275+
\tcode{is_copy_constructible_v<\tcode{T}$_i$>} is \tcode{true} for all $i$.
42764276
\end{itemdescr}
42774277

42784278
\indexlibrary{\idxcode{variant}!constructor}%
@@ -4290,14 +4290,14 @@
42904290

42914291
\pnum
42924292
\throws
4293-
Any exception thrown by move-constructing any $T_i$ for all $i$.
4293+
Any exception thrown by move-constructing any \tcode{T}$_i$ for all $i$.
42944294

42954295
\pnum
42964296
\remarks
42974297
The expression inside \tcode{noexcept} is equivalent to the logical AND of
4298-
\tcode{is_nothrow_move_constructible_v<$T_i$>} for all $i$.
4298+
\tcode{is_nothrow_move_constructible_v<\tcode{T}$_i$>} for all $i$.
42994299
This function shall not participate in overload resolution unless
4300-
\tcode{is_move_constructible_v<$T_i$>} is \tcode{true} for all $i$.
4300+
\tcode{is_move_constructible_v<\tcode{T}$_i$>} is \tcode{true} for all $i$.
43014301
\end{itemdescr}
43024302

43034303
\indexlibrary{\idxcode{variant}!constructor}%
@@ -4307,25 +4307,25 @@
43074307

43084308
\begin{itemdescr}
43094309
\pnum
4310-
Let $T_j$ be a type that is determined as follows:
4311-
build an imaginary function \tcode{\textit{FUN}($T_i$)} for each alternative type $T_i$. The overload \tcode{\textit{FUN}($T_j$)} selected by overload
4310+
Let \tcode{T}$_j$ be a type that is determined as follows:
4311+
build an imaginary function \tcode{\textit{FUN}(\tcode{T}$_i$)} for each alternative type \tcode{T}$_i$. The overload \tcode{\textit{FUN}(\tcode{T}$_j$)} selected by overload
43124312
resolution for the expression \tcode{\textit{FUN}(std::forward<T>(\brk{}t))} defines
4313-
the alternative $T_j$ which is the type of the contained value after
4313+
the alternative \tcode{T}$_j$ which is the type of the contained value after
43144314
construction.
43154315

43164316
\pnum
43174317
\effects
4318-
Initializes \tcode{*this} to hold the alternative type $T_j$ and
4318+
Initializes \tcode{*this} to hold the alternative type \tcode{T}$_j$ and
43194319
direct-initializes the contained value as if direct-non-list-initializing it
43204320
with \tcode{std::forward<T>(t)}.
43214321

43224322
\pnum
43234323
\postconditions
4324-
\tcode{holds_alternative<$T_j$>(*this)} is \tcode{true}.
4324+
\tcode{holds_alternative<T$_j$>(*this)} is \tcode{true}.
43254325

43264326
\pnum
43274327
\throws
4328-
Any exception thrown by the initialization of the selected alternative $T_j$.
4328+
Any exception thrown by the initialization of the selected alternative \tcode{T}$_j$.
43294329

43304330
\pnum
43314331
\remarks
@@ -4334,7 +4334,7 @@
43344334
unless \tcode{decay_t<T>} is neither
43354335
a specialization of \tcode{in_place_type_t}
43364336
nor a specialization of \tcode{in_place_index_t},
4337-
unless \tcode{is_constructible_v<$T_j$, T>} is \tcode{true},
4337+
unless \tcode{is_constructible_v<T$_j$, T>} is \tcode{true},
43384338
and unless the expression
43394339
\tcode{\textit{FUN}(}\brk\tcode{std::forward<T>(t))} (with \tcode{\textit{FUN}}
43404340
being the above-mentioned set of imaginary functions) is well formed.
@@ -4349,8 +4349,8 @@
43494349

43504350
\pnum
43514351
The expression inside \tcode{noexcept} is equivalent to
4352-
\tcode{is_nothrow_constructible_v<$T_j$, T>}.
4353-
If $T_j$'s selected constructor is a constexpr constructor,
4352+
\tcode{is_nothrow_constructible_v<T$_j$, T>}.
4353+
If \tcode{T}$_j$'s selected constructor is a constexpr constructor,
43544354
this constructor shall be a constexpr constructor.
43554355
\end{itemdescr}
43564356

@@ -4418,7 +4418,7 @@
44184418
\begin{itemdescr}
44194419
\pnum
44204420
\effects
4421-
Initializes the contained value as if constructing an object of type $T_I$
4421+
Initializes the contained value as if constructing an object of type \tcode{T}$_I$
44224422
with the arguments \tcode{std::forward<Args>(args)...}.
44234423

44244424
\pnum
@@ -4427,13 +4427,13 @@
44274427

44284428
\pnum
44294429
\throws
4430-
Any exception thrown by calling the selected constructor of $T_I$.
4430+
Any exception thrown by calling the selected constructor of \tcode{T}$_I$.
44314431

44324432
\pnum
44334433
\remarks
44344434
This function shall not participate in overload resolution unless \tcode{I} is
4435-
less than \tcode{sizeof...(Types)} and \tcode{is_constructible_v<$T_I$, Args...>} is \tcode{true}.
4436-
If $T_I$'s selected constructor is a \tcode{constexpr} constructor, this
4435+
less than \tcode{sizeof...(Types)} and \tcode{is_constructible_v<T$_I$, Args...>} is \tcode{true}.
4436+
If \tcode{T}$_I$'s selected constructor is a \tcode{constexpr} constructor, this
44374437
constructor shall be a constexpr constructor.
44384438
\end{itemdescr}
44394439

@@ -4447,7 +4447,7 @@
44474447
\pnum
44484448
\effects
44494449
Initializes the contained value as if constructing an object of type
4450-
$T_I$ with the arguments \tcode{il, std::forward<Args>(args)...}.
4450+
\tcode{T}$_I$ with the arguments \tcode{il, std::forward<Args>(args)...}.
44514451

44524452
\pnum
44534453
\postconditions
@@ -4457,8 +4457,8 @@
44574457
\remarks
44584458
This function shall not participate in overload resolution unless \tcode{I} is
44594459
less than \tcode{sizeof...(Types)} and
4460-
\tcode{is_constructible_v<$T_I$, initializer_list<U>\&, Args...>} is \tcode{true}.
4461-
If $T_I$'s selected constructor is a \tcode{constexpr} constructor, this
4460+
\tcode{is_constructible_v<T$_I$, initializer_list<U>\&, Args...>} is \tcode{true}.
4461+
If \tcode{T}$_I$'s selected constructor is a \tcode{constexpr} constructor, this
44624462
constructor shall be a constexpr constructor.
44634463
\end{itemdescr}
44644464

@@ -4511,7 +4511,7 @@
45114511

45124512
\pnum
45134513
\remarks
4514-
If \tcode{is_trivially_destructible_v<$T_i$> == true} for all $T_i$
4514+
If \tcode{is_trivially_destructible_v<T$_i$> == true} for all \tcode{T}$_i$
45154515
then this destructor shall be a trivial destructor.
45164516
\end{itemdescr}
45174517

@@ -4538,8 +4538,8 @@
45384538
copies the value contained in \tcode{rhs} to a temporary, then destroys any
45394539
value contained in \tcode{*this}. Sets \tcode{*this} to hold the same
45404540
alternative index as \tcode{rhs} and initializes the value contained in
4541-
\tcode{*this} as if direct-non-list-initializing an object of type $T_j$
4542-
with \tcode{std::forward<$T_j$>(TMP),} with \tcode{TMP} being the temporary and
4541+
\tcode{*this} as if direct-non-list-initializing an object of type \tcode{T}$_j$
4542+
with \tcode{std::forward<T$_j$>(TMP),} with \tcode{TMP} being the temporary and
45434543
$j$ being \tcode{rhs.index()}.
45444544
\end{itemize}
45454545

@@ -4552,15 +4552,15 @@
45524552
\pnum
45534553
\remarks
45544554
This function shall not participate in overload resolution unless
4555-
\tcode{is_copy_constructible_v<$T_i$> \&\& is_move_constructible_v<$T_i$> \&\& is_copy_assignable_v<$T_i$>}
4555+
\tcode{is_copy_constructible_v<T$_i$> \&\& is_move_constructible_v<T$_i$> \&\& is_copy_assignable_v<T$_i$>}
45564556
is \tcode{true} for all $i$.
45574557
\begin{itemize}
4558-
\item If an exception is thrown during the call to $T_j$'s copy assignment,
4558+
\item If an exception is thrown during the call to \tcode{T}$_j$'s copy assignment,
45594559
the state of the contained value is as defined by the exception safety
4560-
guarantee of $T_j$'s copy assignment; \tcode{index()} will be $j$.
4561-
\item If an exception is thrown during the call to $T_j$'s copy construction
4560+
guarantee of \tcode{T}$_j$'s copy assignment; \tcode{index()} will be $j$.
4561+
\item If an exception is thrown during the call to \tcode{T}$_j$'s copy construction
45624562
(with $j$ being \tcode{rhs.index()}), \tcode{*this} will remain unchanged.
4563-
\item If an exception is thrown during the call to $T_j$'s move construction,
4563+
\item If an exception is thrown during the call to \tcode{T}$_j$'s move construction,
45644564
the \tcode{variant} will hold no value.
45654565
\end{itemize}
45664566
\end{itemdescr}
@@ -4585,7 +4585,7 @@
45854585
\item
45864586
destroys any value contained in \tcode{*this}. Sets \tcode{*this} to hold the
45874587
same alternative index as \tcode{rhs} and initializes the value contained in
4588-
\tcode{*this} as if direct-non-list-initializing an object of type $T_j$
4588+
\tcode{*this} as if direct-non-list-initializing an object of type \tcode{T}$_j$
45894589
with \tcode{get<$j$>(std::move(rhs))} with $j$ being \tcode{rhs.index()}.
45904590
\end{itemize}
45914591

@@ -4595,16 +4595,16 @@
45954595
\pnum
45964596
\remarks
45974597
This function shall not participate in overload resolution unless
4598-
\tcode{is_move_constructible_v<$T_i$> \&\& is_move_assignable_v<$T_i$>} is
4598+
\tcode{is_move_constructible_v<T$_i$> \&\& is_move_assignable_v<T$_i$>} is
45994599
\tcode{true} for all $i$.
46004600
The expression inside \tcode{noexcept} is equivalent to:
4601-
\tcode{is_nothrow_move_constructible_v<$T_i$> \&\& is_nothrow_move_assignable_v<$T_i$>} for all $i$.
4601+
\tcode{is_nothrow_move_constructible_v<T$_i$> \&\& is_nothrow_move_assignable_v<T$_i$>} for all $i$.
46024602
\begin{itemize}
4603-
\item If an exception is thrown during the call to $T_j$'s move construction
4603+
\item If an exception is thrown during the call to \tcode{T}$_j$'s move construction
46044604
(with $j$ being \tcode{rhs.index())}, the \tcode{variant} will hold no value.
4605-
\item If an exception is thrown during the call to $T_j$'s move assignment,
4605+
\item If an exception is thrown during the call to \tcode{T}$_j$'s move assignment,
46064606
the state of the contained value is as defined by the exception safety
4607-
guarantee of $T_j$'s move assignment; \tcode{index()} will be $j$.
4607+
guarantee of \tcode{T}$_j$'s move assignment; \tcode{index()} will be $j$.
46084608
\end{itemize}
46094609
\end{itemdescr}
46104610

@@ -4615,25 +4615,25 @@
46154615

46164616
\begin{itemdescr}
46174617
\pnum
4618-
Let $T_j$ be a type that is determined as follows:
4619-
build an imaginary function \tcode{\textit{FUN}($T_i$)} for each alternative type
4620-
$T_i$. The overload \tcode{\textit{FUN}($T_j$)} selected by overload
4618+
Let \tcode{T}$_j$ be a type that is determined as follows:
4619+
build an imaginary function \tcode{\textit{FUN}(T$_i$)} for each alternative type
4620+
\tcode{T}$_i$. The overload \tcode{\textit{FUN}(T$_j$)} selected by overload
46214621
resolution for the expression \tcode{\textit{FUN}(std::forward<T>(\brk{}t))} defines
4622-
the alternative $T_j$ which is the type of the contained value after
4622+
the alternative \tcode{T}$_j$ which is the type of the contained value after
46234623
assignment.
46244624

46254625
\pnum
46264626
\effects
4627-
If \tcode{*this} holds a $T_j$, assigns \tcode{std::forward<T>(t)} to
4627+
If \tcode{*this} holds a \tcode{T}$_j$, assigns \tcode{std::forward<T>(t)} to
46284628
the value contained in \tcode{*this}. Otherwise, destroys any value contained
4629-
in \tcode{*this}, sets \tcode{*this} to hold the alternative type $T_j$
4629+
in \tcode{*this}, sets \tcode{*this} to hold the alternative type \tcode{T}$_j$
46304630
as selected by the imaginary function overload resolution described above,
46314631
and direct-initializes the contained value as if direct-non-list-initializing
46324632
it with \tcode{std::forward<T>(t)}.
46334633

46344634
\pnum
46354635
\postconditions
4636-
\tcode{holds_alternative<$T_j$>(*this)} is \tcode{true}, with $T_j$
4636+
\tcode{holds_alternative<T$_j$>(*this)} is \tcode{true}, with \tcode{T}$_j$
46374637
selected by the imaginary function overload resolution described above.
46384638

46394639
\pnum
@@ -4643,7 +4643,7 @@
46434643
\remarks
46444644
This function shall not participate in overload resolution unless
46454645
\tcode{is_same_v<decay_t<T>, variant>} is \tcode{false}, unless
4646-
\tcode{is_assignable_v<$T_j$\&, T> \&\& is_constructible_v<$T_j$, T>} is \tcode{true},
4646+
\tcode{is_assignable_v<T$_j$\&, T> \&\& is_constructible_v<T$_j$, T>} is \tcode{true},
46474647
and unless the expression \tcode{\textit{FUN}(std::forward<T>(t))} (with
46484648
\tcode{\textit{FUN}} being the above-mentioned set of imaginary functions)
46494649
is well formed.
@@ -4659,7 +4659,7 @@
46594659

46604660
\pnum
46614661
The expression inside \tcode{noexcept} is equivalent to:
4662-
\tcode{is_nothrow_assignable_v<$T_j$\&, T> \&\& is_nothrow_constructible_v<$T_j$, T>}.
4662+
\tcode{is_nothrow_assignable_v<T$_j$\&, T> \&\& is_nothrow_constructible_v<T$_j$, T>}.
46634663
\begin{itemize}
46644664
\item If an exception is thrown during the assignment of \tcode{std::forward<T>(t)}
46654665
to the value contained in \tcode{*this}, the state of the contained value and
@@ -4722,7 +4722,7 @@
47224722
\effects
47234723
Destroys the currently contained value if \tcode{valueless_by_exception()}
47244724
is \tcode{false}. Then direct-initializes the contained value as if
4725-
constructing a value of type $T_I$ with the arguments
4725+
constructing a value of type \tcode{T}$_I$ with the arguments
47264726
\tcode{std::forward<Ar\-gs>(args)...}.
47274727

47284728
\pnum
@@ -4736,7 +4736,7 @@
47364736
\pnum
47374737
\remarks
47384738
This function shall not participate in overload resolution unless
4739-
\tcode{is_constructible_v<$T_I$, Args...>} is \tcode{true}.
4739+
\tcode{is_constructible_v<T$_I$, Args...>} is \tcode{true}.
47404740
If an exception is thrown during the initialization of the contained value,
47414741
the \tcode{variant} might not hold a value.
47424742
\end{itemdescr}
@@ -4755,7 +4755,7 @@
47554755
\effects
47564756
Destroys the currently contained value if \tcode{valueless_by_exception()}
47574757
is \tcode{false}. Then direct-initializes the contained value as if
4758-
constructing a value of type $T_I$ with the arguments
4758+
constructing a value of type \tcode{T}$_I$ with the arguments
47594759
\tcode{il, std::forward<Args>(args)...}.
47604760

47614761
\pnum
@@ -4769,7 +4769,7 @@
47694769
\pnum
47704770
\remarks
47714771
This function shall not participate in overload resolution unless
4772-
\tcode{is_constructible_v<$T_I$, initializer_list<U>\&, Args...>} is \tcode{true}.
4772+
\tcode{is_constructible_v<T$_I$, initializer_list<U>\&, Args...>} is \tcode{true}.
47734773
If an exception is thrown during the initialization of the contained value,
47744774
the \tcode{variant} might not hold a value.
47754775
\end{itemdescr}
@@ -4821,8 +4821,8 @@
48214821

48224822
\begin{itemdescr}
48234823
\pnum
4824-
\requires Lvalues of type \tcode{$T_i$} shall be swappable~(\ref{swappable.requirements}) and
4825-
\tcode{is_move_constructible_v<$T_i$>} shall be \tcode{true} for all $i$.
4824+
\requires Lvalues of type \tcode{T}$_i$ shall be swappable~(\ref{swappable.requirements}) and
4825+
\tcode{is_move_constructible_v<T$_i$>} shall be \tcode{true} for all $i$.
48264826

48274827
\pnum
48284828
\effects
@@ -4841,20 +4841,20 @@
48414841
any exception thrown by \tcode{swap(get<$i$>(*this), get<$i$>(rhs))}
48424842
with $i$ being \tcode{index()}.
48434843
Otherwise, any exception thrown by the move constructor
4844-
of \tcode{$T_i$} or \tcode{$T_j$}
4844+
of \tcode{T}$_i$ or \tcode{T}$_j$
48454845
with $i$ being \tcode{index()} and $j$ being \tcode{rhs.index()}.
48464846

48474847
\pnum
48484848
\remarks
48494849
If an exception is thrown during the call to function \tcode{swap(get<$i$>(*this), get<$i$>(rhs))},
48504850
the states of the contained values of \tcode{*this} and of \tcode{rhs} are
48514851
determined by the exception safety guarantee of \tcode{swap} for lvalues of
4852-
$T_i$ with $i$ being \tcode{index()}.
4852+
\tcode{T}$_i$ with $i$ being \tcode{index()}.
48534853
If an exception is thrown during the exchange of the values of \tcode{*this}
48544854
and \tcode{rhs}, the states of the values of \tcode{*this} and of \tcode{rhs}
48554855
are determined by the exception safety guarantee of \tcode{variant}'s move constructor.
48564856
The expression inside \tcode{noexcept} is equivalent to the logical AND of
4857-
\tcode{is_nothrow_move_constructible_v<$T_i$> \&\& is_nothrow_swappable_v<$T_i$>} for all $i$.
4857+
\tcode{is_nothrow_move_constructible_v<T$_i$> \&\& is_nothrow_swappable_v<T$_i$>} for all $i$.
48584858
\end{itemdescr}
48594859

48604860
\rSec2[variant.helper]{\tcode{variant} helper classes}
@@ -4924,7 +4924,7 @@
49244924
\requires \tcode{I < sizeof...(Types)}.
49254925

49264926
\pnum
4927-
\textit{Value:} The type $T_I$.
4927+
\textit{Value:} The type \tcode{T}$_I$.
49284928
\end{itemdescr}
49294929

49304930
\rSec2[variant.get]{Value access}
@@ -5244,7 +5244,7 @@
52445244

52455245
\pnum
52465246
\remarks This function shall not participate in overload resolution
5247-
unless \tcode{is_move_constructible_v<$T_i$> \&\& is_swappable_v<$T_i$>}
5247+
unless \tcode{is_move_constructible_v<T$_i$> \&\& is_swappable_v<T$_i$>}
52485248
is \tcode{true} for all $i$.
52495249
The expression inside \tcode{noexcept} is equivalent to \tcode{noexcept(v.swap(w))}.
52505250
\end{itemdescr}

0 commit comments

Comments
 (0)