diff --git a/source/algorithms.tex b/source/algorithms.tex index 5cf722f6c6..78abc30d6b 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -156,7 +156,7 @@ \tcode{pred(*first)} contextually converted to \tcode{bool}\iref{conv}. The function object \tcode{pred} shall not apply any non-constant function through the dereferenced iterator. -Given a glvalue \tcode{u} of type (possibly \tcode{const}) \tcode{T} +Given a glvalue \tcode{u} of type (possibly \keyword{const}) \tcode{T} that designates the same object as \tcode{*first}, \tcode{pred(u)} shall be a valid expression that is equal to \tcode{pred(*first)}. @@ -181,9 +181,9 @@ \tcode{binary_pred(*first1, value)} contextually converted to \tcode{bool}\iref{conv}. \tcode{binary_pred} shall not apply any non-constant function through the dereferenced iterators. -Given a glvalue \tcode{u} of type (possibly \tcode{const}) \tcode{T1} +Given a glvalue \tcode{u} of type (possibly \keyword{const}) \tcode{T1} that designates the same object as \tcode{*first1}, and -a glvalue \tcode{v} of type (possibly \tcode{const}) \tcode{T2} +a glvalue \tcode{v} of type (possibly \keyword{const}) \tcode{T2} that designates the same object as \tcode{*first2}, \tcode{binary_pred(u, *first2)}, \tcode{binary_pred(*first1, v)}, and diff --git a/source/atomics.tex b/source/atomics.tex index e0e0561dd2..61ed8993c1 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -1138,10 +1138,10 @@ \tcode{unsigned long}, \tcode{long long}, \tcode{unsigned long long}, -\tcode{char8_t}, -\tcode{char16_t}, -\tcode{char32_t}, -\tcode{wchar_t}, +\keyword{char8_t}, +\keyword{char16_t}, +\keyword{char32_t}, +\keyword{wchar_t}, and any other types needed by the typedefs in the header \libheaderref{cstdint}. For each such type \tcode{\placeholder{integral}}, the specialization \tcode{atomic_ref<\placeholder{integral}>} provides @@ -1681,7 +1681,7 @@ \begin{itemdescr} \pnum -The \tcode{static} data member \tcode{is_always_lock_free} is \tcode{true} +The \keyword{static} data member \tcode{is_always_lock_free} is \tcode{true} if the atomic type's operations are always lock-free, and \tcode{false} otherwise. \begin{note} The value of \tcode{is_always_lock_free} is consistent with the value of @@ -1735,7 +1735,7 @@ \pnum \effects -Atomically replaces the value pointed to by \tcode{this} +Atomically replaces the value pointed to by \keyword{this} with the value of \tcode{desired}. Memory is affected according to the value of \tcode{order}. \end{itemdescr} @@ -1791,7 +1791,7 @@ \pnum \returns -Atomically returns the value pointed to by \tcode{this}. +Atomically returns the value pointed to by \keyword{this}. \end{itemdescr} \indexlibrarymember{operator \placeholder{type}}{atomic}% @@ -1834,14 +1834,14 @@ \pnum \effects -Atomically replaces the value pointed to by \tcode{this} +Atomically replaces the value pointed to by \keyword{this} with \tcode{desired}. Memory is affected according to the value of \tcode{order}. These operations are atomic read-modify-write operations\iref{intro.multithread}. \pnum \returns -Atomically returns the value pointed to by \tcode{this} immediately before the effects. +Atomically returns the value pointed to by \keyword{this} immediately before the effects. \end{itemdescr} \indexlibraryglobal{atomic_compare_exchange_weak}% @@ -1889,10 +1889,10 @@ \pnum \effects Retrieves the value in \tcode{expected}. It then atomically -compares the value representation of the value pointed to by \tcode{this} +compares the value representation of the value pointed to by \keyword{this} for equality with that previously retrieved from \tcode{expected}, and if true, replaces the value pointed to -by \tcode{this} with that in \tcode{desired}. +by \keyword{this} with that in \tcode{desired}. If and only if the comparison is \tcode{true}, memory is affected according to the value of \tcode{success}, and if the comparison is false, memory is affected according to the value of \tcode{failure}. When only one \tcode{memory_order} argument is @@ -1903,11 +1903,11 @@ \tcode{memory_order::relaxed}. If and only if the comparison is false then, after the atomic operation, the value in \tcode{expected} is replaced by the value -pointed to by \tcode{this} during the atomic comparison. +pointed to by \keyword{this} during the atomic comparison. If the operation returns \tcode{true}, these operations are atomic read-modify-write operations\iref{intro.multithread} on the memory -pointed to by \tcode{this}. +pointed to by \keyword{this}. Otherwise, these operations are atomic load operations on that memory. \pnum @@ -1958,7 +1958,7 @@ \pnum \remarks A weak compare-and-exchange operation may fail spuriously. That is, even when -the contents of memory referred to by \tcode{expected} and \tcode{this} are +the contents of memory referred to by \tcode{expected} and \keyword{this} are equal, it may return \tcode{false} and store back to \tcode{expected} the same memory contents that were originally there. \begin{note} @@ -2114,10 +2114,10 @@ \tcode{unsigned long}, \tcode{long long}, \tcode{unsigned long long}, -\tcode{char8_t}, -\tcode{char16_t}, -\tcode{char32_t}, -\tcode{wchar_t}, +\keyword{char8_t}, +\keyword{char16_t}, +\keyword{char32_t}, +\keyword{wchar_t}, and any other types needed by the typedefs in the header \libheaderref{cstdint}. For each such type \tcode{\placeholder{integral}}, the specialization \tcode{atomic<\placeholder{integral}>} provides additional atomic operations appropriate to integral types. @@ -2277,14 +2277,14 @@ \pnum \effects Atomically replaces the value pointed to by -\tcode{this} with the result of the computation applied to the -value pointed to by \tcode{this} and the given \tcode{operand}. +\keyword{this} with the result of the computation applied to the +value pointed to by \keyword{this} and the given \tcode{operand}. Memory is affected according to the value of \tcode{order}. These operations are atomic read-modify-write operations\iref{intro.multithread}. \pnum \returns -Atomically, the value pointed to by \tcode{this} immediately before the effects. +Atomically, the value pointed to by \keyword{this} immediately before the effects. \pnum \indextext{signed integer representation!two's complement}% @@ -2439,15 +2439,15 @@ \pnum \effects -Atomically replaces the value pointed to by \tcode{this} +Atomically replaces the value pointed to by \keyword{this} with the result of the computation applied to the value pointed -to by \tcode{this} and the given \tcode{operand}. +to by \keyword{this} and the given \tcode{operand}. Memory is affected according to the value of \tcode{order}. These operations are atomic read-modify-write operations\iref{intro.multithread}. \pnum \returns -Atomically, the value pointed to by \tcode{this} immediately before the effects. +Atomically, the value pointed to by \keyword{this} immediately before the effects. \pnum \remarks @@ -2620,14 +2620,14 @@ \pnum \effects Atomically replaces the value pointed to by -\tcode{this} with the result of the computation applied to the -value pointed to by \tcode{this} and the given \tcode{operand}. +\keyword{this} with the result of the computation applied to the +value pointed to by \keyword{this} and the given \tcode{operand}. Memory is affected according to the value of \tcode{order}. These operations are atomic read-modify-write operations\iref{intro.multithread}. \pnum \returns -Atomically, the value pointed to by \tcode{this} immediately before the effects. +Atomically, the value pointed to by \keyword{this} immediately before the effects. \pnum \remarks @@ -2876,7 +2876,7 @@ \pnum \effects -Atomically replaces the value pointed to by \tcode{this} with +Atomically replaces the value pointed to by \keyword{this} with the value of \tcode{desired} as if by \tcode{p.swap(desired)}. Memory is affected according to the value of \tcode{order}. \end{itemdescr} @@ -2980,7 +2980,7 @@ If the operation returns \tcode{true}, \tcode{expected} is not accessed after the atomic update and the operation is an atomic read-modify-write operation\iref{intro.multithread} -on the memory pointed to by \tcode{this}. +on the memory pointed to by \keyword{this}. Otherwise, the operation is an atomic load operation on that memory, and \tcode{expected} is updated with the existing value read from the atomic object in the attempted atomic update. @@ -3183,7 +3183,7 @@ \pnum \effects -Atomically replaces the value pointed to by \tcode{this} with +Atomically replaces the value pointed to by \keyword{this} with the value of \tcode{desired} as if by \tcode{p.swap(desired)}. Memory is affected according to the value of \tcode{order}. \end{itemdescr} @@ -3286,7 +3286,7 @@ If the operation returns \tcode{true}, \tcode{expected} is not accessed after the atomic update and the operation is an atomic read-modify-write operation\iref{intro.multithread} -on the memory pointed to by \tcode{this}. +on the memory pointed to by \keyword{this}. Otherwise, the operation is an atomic load operation on that memory, and \tcode{expected} is updated with the existing value read from the atomic object in the attempted atomic update. @@ -3498,7 +3498,7 @@ \pnum \returns -Atomically returns the value pointed to by \tcode{object} or \tcode{this}. +Atomically returns the value pointed to by \tcode{object} or \keyword{this}. \end{itemdescr} \indexlibraryglobal{atomic_flag_test_and_set}% @@ -3516,7 +3516,7 @@ \begin{itemdescr} \pnum \effects -Atomically sets the value pointed to by \tcode{object} or by \tcode{this} to \tcode{true}. Memory is affected according to the value of +Atomically sets the value pointed to by \tcode{object} or by \keyword{this} to \tcode{true}. Memory is affected according to the value of \tcode{order}. These operations are atomic read-modify-write operations\iref{intro.multithread}. \pnum @@ -3544,7 +3544,7 @@ \pnum \effects -Atomically sets the value pointed to by \tcode{object} or by \tcode{this} to +Atomically sets the value pointed to by \tcode{object} or by \keyword{this} to \tcode{false}. Memory is affected according to the value of \tcode{order}. \end{itemdescr} @@ -3569,7 +3569,7 @@ For \tcode{atomic_flag_wait}, let \tcode{order} be \tcode{memory_order::seq_cst}. Let \tcode{flag} be \tcode{object} for the non-member functions and -\tcode{this} for the member functions. +\keyword{this} for the member functions. \pnum \expects diff --git a/source/basic.tex b/source/basic.tex index 55ab76e009..822934d641 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -100,7 +100,7 @@ automatic storage duration\iref{basic.stc.auto}, a structured binding\iref{dcl.struct.bind} whose corresponding variable is such an entity, -or the \tcode{*this} object\iref{expr.prim.this}. +or the \tcode{*\keyword{this}} object\iref{expr.prim.this}. \pnum Some names denote types or templates. In general, @@ -165,7 +165,7 @@ it contains the \indextext{declaration!\idxcode{extern}}% -\tcode{extern} specifier\iref{dcl.stc} or a +\keyword{extern} specifier\iref{dcl.stc} or a \grammarterm{linkage-specification} \begin{footnote} Appearing inside the brace-enclosed @@ -181,7 +181,7 @@ definition~(\ref{class.mem}, \ref{class.static}), \item it declares a static data member outside a class definition -and the variable was defined within the class with the \tcode{constexpr} +and the variable was defined within the class with the \keyword{constexpr} specifier (this usage is deprecated; see \ref{depr.static.constexpr}), \item \indextext{declaration!class name}% @@ -204,7 +204,7 @@ \item it is a \indextext{declaration!\idxcode{typedef}}% -\tcode{typedef} declaration\iref{dcl.typedef}, +\keyword{typedef} declaration\iref{dcl.typedef}, \item it is an \grammarterm{alias-declaration}\iref{dcl.typedef}, \item it is @@ -452,7 +452,7 @@ A structured binding is odr-used if it appears as a potentially-evaluated expression. \pnum -\tcode{*this} is odr-used if \tcode{this} appears as a potentially-evaluated expression +\tcode{*\keyword{this}} is odr-used if \keyword{this} appears as a potentially-evaluated expression (including as the result of the implicit transformation in the body of a non-static member function~(\ref{class.mfct.non-static})). @@ -487,14 +487,14 @@ A local entity\iref{basic.pre} is \defn{odr-usable} in a scope\iref{basic.scope.scope} if: \begin{itemize} -\item either the local entity is not \tcode{*this}, or +\item either the local entity is not \tcode{*\keyword{this}}, or an enclosing class or non-lambda function parameter scope exists and, if the innermost such scope is a function parameter scope, it corresponds to a non-static member function, and \item for each intervening scope\iref{basic.scope.scope} between the point at which the entity is introduced and the scope -(where \tcode{*this} is considered to be introduced +(where \tcode{*\keyword{this}} is considered to be introduced within the innermost enclosing class or non-lambda function definition scope), either: \begin{itemize} @@ -588,14 +588,14 @@ type \tcode{T} (\ref{conv}, \ref{expr.type.conv}, \ref{expr.dynamic.cast}, \ref{expr.static.cast}, \ref{expr.cast}), or \item an expression that is not a null pointer constant, and has type -other than \cv{}~\tcode{void*}, is converted to the type pointer to \tcode{T} +other than \cv{}~\tcode{\keyword{void}*}, is converted to the type pointer to \tcode{T} or reference to \tcode{T} using a standard conversion\iref{conv}, -a \tcode{dynamic_cast}\iref{expr.dynamic.cast} or -a \tcode{static_cast}\iref{expr.static.cast}, or +a \keyword{dynamic_cast}\iref{expr.dynamic.cast} or +a \keyword{static_cast}\iref{expr.static.cast}, or \item a class member access operator is applied to an expression of type \tcode{T}\iref{expr.ref}, or -\item the \tcode{typeid} operator\iref{expr.typeid} or the -\tcode{sizeof} operator\iref{expr.sizeof} is applied to an operand of +\item the \keyword{typeid} operator\iref{expr.typeid} or the +\keyword{sizeof} operator\iref{expr.sizeof} is applied to an operand of type \tcode{T}, or \item a function with a return type or argument type of type \tcode{T} is defined\iref{basic.def} or called\iref{expr.call}, or @@ -603,7 +603,7 @@ defined\iref{class.derived}, or \item an lvalue of type \tcode{T} is assigned to\iref{expr.ass}, or \item the type \tcode{T} is the subject of an -\tcode{alignof} expression\iref{expr.alignof}, or +\keyword{alignof} expression\iref{expr.alignof}, or \item an \grammarterm{exception-declaration} has type \tcode{T}, reference to \tcode{T}, or pointer to \tcode{T}\iref{except.handle}. \end{itemize} @@ -1097,7 +1097,7 @@ \pnum The locus of a \grammarterm{for-range-declaration} -of a range-based \tcode{for} statement\iref{stmt.ranged} +of a range-based \keyword{for} statement\iref{stmt.ranged} is immediately after the \grammarterm{for-range-initializer}. \pnum @@ -1106,7 +1106,7 @@ \begin{codeblock} typedef unsigned char T; template struct A { }; \end{codeblock} @@ -1135,7 +1135,7 @@ that belong to the nearest enclosing namespace or block scope, but they do not bind names anywhere\iref{class.friend}. Function declarations at block scope and -variable declarations with the \tcode{extern} specifier at block scope +variable declarations with the \keyword{extern} specifier at block scope declare entities that belong to the nearest enclosing namespace, but they do not bind names in it. @@ -1681,7 +1681,7 @@ using B1::f; using B2::f; void g() { - f(); // Ambiguous conversion of \tcode{this} + f(); // Ambiguous conversion of \keyword{this} f(0); // Unambiguous (static) f(0.0); // Unambiguous (only one \tcode{B2}) int B1::* mpB1 = &D::i; // Unambiguous @@ -2570,11 +2570,11 @@ \begin{itemize} \item a variable, variable template, function, or function template that is - explicitly declared \tcode{static}; or + explicitly declared \keyword{static}; or \item a non-template variable of non-volatile const-qualified type, unless \begin{itemize} - \item it is explicitly declared \tcode{extern}, or + \item it is explicitly declared \keyword{extern}, or \item it is inline or exported, or \item it was previously declared and the prior declaration did not have internal linkage; or @@ -2584,7 +2584,7 @@ \end{itemize} \begin{note} An instantiated variable template that has const-qualified type -can have external or module linkage, even if not declared \tcode{extern}. +can have external or module linkage, even if not declared \keyword{extern}. \end{note} \pnum @@ -3084,7 +3084,7 @@ \indextext{object!providing storage for}% If a complete object is created\iref{expr.new} in storage associated with another object \placeholder{e} -of type ``array of $N$ \tcode{unsigned char}'' or +of type ``array of $N$ \tcode{\keyword{unsigned} \keyword{char}}'' or of type ``array of $N$ \tcode{std::byte}''\iref{cstddef.syn}, that array \defn{provides storage} for the created object if: @@ -3285,7 +3285,7 @@ The array object provides storage for these objects. \end{note} Any implicit or explicit invocation of a function -named \tcode{operator new} or \tcode{operator new[]} +named \tcode{\keyword{operator} \keyword{new}} or \tcode{\keyword{operator} \keyword{new}[]} implicitly creates objects in the returned region of storage and returns a pointer to a suitable created object. \begin{note} @@ -3377,7 +3377,7 @@ Otherwise, such a pointer refers to allocated storage\iref{basic.stc.dynamic.allocation}, and using the pointer as -if the pointer were of type \tcode{void*} is +if the pointer were of type \tcode{\keyword{void}*} is well-defined. Indirection through such a pointer is permitted but the resulting lvalue may only be used in limited ways, as described below. The program has undefined behavior if: @@ -3393,15 +3393,15 @@ to a virtual base class, or \item the pointer is used as the operand of a - \tcode{static_cast}\iref{expr.static.cast}, except when the conversion - is to pointer to \cv{}~\tcode{void}, or to pointer to \cv{}~\tcode{void} + \keyword{static_cast}\iref{expr.static.cast}, except when the conversion + is to pointer to \cv{}~\keyword{void}, or to pointer to \cv{}~\keyword{void} and subsequently to pointer to - \cv{}~\tcode{char}, - \cv{}~\tcode{unsigned char}, or + \cv{}~\keyword{char}, + \cv{}~\tcode{\keyword{unsigned} \keyword{char}}, or \cv{}~\tcode{std::byte}\iref{cstddef.syn}, or \item the pointer is used as the operand of a - \tcode{dynamic_cast}\iref{expr.dynamic.cast}. + \keyword{dynamic_cast}\iref{expr.dynamic.cast}. \end{itemize} \begin{example} \begin{codeblock} @@ -3419,7 +3419,7 @@ void B::mutate() { new (this) D2; // reuses storage --- ends the lifetime of \tcode{*this} f(); // undefined behavior - ... = this; // OK, \tcode{this} points to valid memory + ... = this; // OK, \keyword{this} points to valid memory } void g() { @@ -3450,8 +3450,8 @@ \item the glvalue is used to call a non-static member function of the object, or \item the glvalue is bound to a reference to a virtual base class\iref{dcl.init.ref}, or \item the glvalue is used as the operand of a -\tcode{dynamic_cast}\iref{expr.dynamic.cast} or as the operand of -\tcode{typeid}. +\keyword{dynamic_cast}\iref{expr.dynamic.cast} or as the operand of +\keyword{typeid}. \end{itemize} \pnum @@ -3710,7 +3710,7 @@ \pnum \indextext{object!local static@local \tcode{static}}% -The keyword \tcode{static} can be used to declare +The keyword \keyword{static} can be used to declare a block variable\iref{basic.scope.block} with static storage duration. \begin{note} \ref{stmt.dcl} and \ref{basic.start.term} describe the @@ -3719,13 +3719,13 @@ \pnum \indextext{member!class static@class \tcode{static}}% -The keyword \tcode{static} applied to a class data member in a class +The keyword \keyword{static} applied to a class data member in a class definition gives the data member static storage duration. \rSec3[basic.stc.thread]{Thread storage duration} \pnum -All variables declared with the \tcode{thread_local} keyword have +All variables declared with the \keyword{thread_local} keyword have \defnadj{thread}{storage duration}. The storage for these entities lasts for the duration of the thread in which they are created. There is a distinct object or reference @@ -3744,7 +3744,7 @@ \pnum \indextext{storage duration!local object}% Variables that belong to a block or parameter scope and are -not explicitly declared \tcode{static}, \tcode{thread_local}, or \tcode{extern} have +not explicitly declared \keyword{static}, \keyword{thread_local}, or \keyword{extern} have \defnadj{automatic}{storage duration}. The storage for these entities lasts until the block in which they are created exits. @@ -3773,9 +3773,9 @@ \indextext{\idxcode{delete}}% \grammarterm{delete-expression}{s}\iref{expr.delete}. A \Cpp{} implementation provides access to, and management of, dynamic storage via the global -\defn{allocation functions} \tcode{operator new} and \tcode{operator -new[]} and the global \defn{deallocation functions} \tcode{operator -delete} and \tcode{operator delete[]}. +\defn{allocation functions} \tcode{\keyword{operator} \keyword{new}} and \tcode{\keyword{operator} +\keyword{new}[]} and the global \defn{deallocation functions} \tcode{\keyword{operator} +\keyword{delete}} and \tcode{\keyword{operator} \keyword{delete}[]}. \begin{note} The non-allocating forms described in \ref{new.delete.placement} do not perform allocation or deallocation. @@ -3811,9 +3811,10 @@ \end{codeblock} These implicit declarations introduce only the function names -\tcode{operator} \tcode{new}, \tcode{operator} \tcode{new[]}, -\tcode{op\-er\-a\-tor} \tcode{delete}, and \tcode{operator} -\tcode{delete[]}. +\tcode{\keyword{operator} \keyword{new}}, +\tcode{\keyword{operator} \keyword{new}[]}, +\tcode{\keyword{operator} \keyword{delete}}, and +\tcode{\keyword{operator} \keyword{delete}[]}. \begin{note} The implicit declarations do not introduce the names \tcode{std}, @@ -3846,7 +3847,7 @@ \indextext{function!allocation}% An allocation function that is not a class member function shall belong to the global scope and not have a name with internal linkage. -The return type shall be \tcode{void*}. The first +The return type shall be \tcode{\keyword{void}*}. The first parameter shall have type \tcode{std::size_t}\iref{support.types}. The first parameter shall not have an associated default argument\iref{dcl.fct.default}. The value of the first parameter @@ -3879,7 +3880,7 @@ returned from a request for zero size is undefined. \begin{footnote} The intent is -to have \tcode{operator new()} implementable by +to have \tcode{\keyword{operator} \keyword{new}()} implementable by calling \tcode{std::malloc()} or \tcode{std::calloc()}, so the rules are substantially the same. \Cpp{} differs from C in requiring a zero request to return a non-null pointer. @@ -3897,7 +3898,7 @@ the storage will have the alignment specified by the value of this argument. \item - Otherwise, if the allocation function is named \tcode{operator new[]}, + Otherwise, if the allocation function is named \tcode{\keyword{operator} \keyword{new}[]}, the storage is aligned for any object that does not have new-extended alignment\iref{basic.align} and is no larger than the requested size. @@ -3955,19 +3956,19 @@ and its second parameter is of type \tcode{std::destroying_delete_t}. A destroying operator delete -shall be a class member function named \tcode{operator delete}. +shall be a class member function named \tcode{\keyword{operator} \keyword{delete}}. \begin{note} Array deletion cannot use a destroying operator delete. \end{note} \pnum \indextext{\idxcode{delete}!overloading and}% -Each deallocation function shall return \tcode{void}. +Each deallocation function shall return \keyword{void}. If the function is a destroying operator delete declared in class type \tcode{C}, the type of its first parameter shall be \tcode{C*}; otherwise, the type of its first -parameter shall be \tcode{void*}. A deallocation function may have more +parameter shall be \tcode{\keyword{void}*}. A deallocation function may have more than one parameter. \indextext{deallocation function!usual}% A \defn{usual deallocation function} is a deallocation function @@ -3978,9 +3979,9 @@ \item optionally, a parameter of type \tcode{std::size_t}, \begin{footnote} -The global \tcode{operator delete(void*, std::size_t)} +The global \tcode{\keyword{operator} \keyword{delete}(\keyword{void}*, std::size_t)} precludes use of an -allocation function \tcode{void operator new(std::size_t, std::size_t)} as a placement +allocation function \tcode{\keyword{void} \keyword{operator} \keyword{new}(std::size_t, std::size_t)} as a placement allocation function~(\ref{diff.cpp11.basic}). \end{footnote} then @@ -4030,12 +4031,12 @@ and is one of the following: \begin{itemize} \item the value returned by a call to the \Cpp{} standard library implementation of -\tcode{::operator new(std::\brk{}size_t)} or -\tcode{::operator new(std::size_t, std::align_val_t)}% +\tcode{::\keyword{operator} \keyword{new}(std::\brk{}size_t)} or +\tcode{::\keyword{operator} \keyword{new}(std::size_t, std::align_val_t)}% ;% \begin{footnote} This subclause does not impose restrictions -on indirection through pointers to memory not allocated by \tcode{::operator new}. This +on indirection through pointers to memory not allocated by \tcode{::\keyword{operator} \keyword{new}}. This maintains the ability of many \Cpp{} implementations to use binary libraries and components written in other languages. In particular, this applies to C binaries, because indirection through pointers to memory allocated by \tcode{std::malloc} is not restricted. @@ -4052,9 +4053,9 @@ conversion~(\ref{conv.ptr}, \ref{expr.type.conv}, \ref{expr.static.cast}, \ref{expr.cast}) of a safely-derived pointer value; -\item the result of a \tcode{reinterpret_cast} of a safely-derived pointer value; +\item the result of a \keyword{reinterpret_cast} of a safely-derived pointer value; -\item the result of a \tcode{reinterpret_cast} of an integer representation of a +\item the result of a \keyword{reinterpret_cast} of an integer representation of a safely-derived pointer value; \item the value of an object whose value was copied from a traceable pointer object, @@ -4069,7 +4070,7 @@ only if its type is at least as large as \tcode{std::intptr_t} and it is one of the following: \begin{itemize} -\item the result of a \tcode{reinterpret_cast} of a safely-derived pointer value; +\item the result of a \keyword{reinterpret_cast} of a safely-derived pointer value; \item the result of a valid conversion of an integer representation of a safely-derived pointer value; @@ -4081,7 +4082,7 @@ \item the result of an additive or bitwise operation, one of whose operands is an integer representation of a safely-derived pointer value \tcode{P}, if that result converted by \tcode{reinterpret_cast} would compare equal to a safely-derived -pointer computable from \tcode{reinterpret_cast(P)}. +pointer computable from \tcode{\keyword{reinterpret_cast}<\keyword{void}*>(P)}. \end{itemize} \pnum @@ -4128,7 +4129,7 @@ A \defnadj{fundamental}{alignment} is represented by an alignment less than or equal to the greatest alignment supported by the implementation in all contexts, which is equal to -\tcode{alignof(std::max_align_t)}\iref{support.types}. +\tcode{\keyword{alignof}(std::max_align_t)}\iref{support.types}. The alignment required for a type may be different when it is used as the type of a complete object and when it is used as the type of a subobject. \begin{example} @@ -4138,17 +4139,17 @@ \end{codeblock} When \tcode{D} is the type of a complete object, it will have a subobject of -type \tcode{B}, so it must be aligned appropriately for a \tcode{long double}. +type \tcode{B}, so it must be aligned appropriately for a \tcode{\keyword{long} \keyword{double}}. If \tcode{D} appears as a subobject of another object that also has \tcode{B} as a virtual base class, the \tcode{B} subobject might be part of a different subobject, reducing the alignment requirements on the \tcode{D} subobject. \end{example} -The result of the \tcode{alignof} operator reflects the alignment +The result of the \keyword{alignof} operator reflects the alignment requirement of the type in the complete-object case. \pnum An \defnadj{extended}{alignment} is represented by an alignment -greater than \tcode{alignof(std::max_align_t)}. It is \impldef{support for extended alignments} +greater than \tcode{\keyword{alignof}(std::max_align_t)}. It is \impldef{support for extended alignments} whether any extended alignments are supported and the contexts in which they are supported\iref{dcl.align}. A type having an extended alignment requirement is an \defnadj{over-aligned}{type}. @@ -4161,7 +4162,7 @@ \pnum Alignments are represented as values of the type \tcode{std::size_t}. -Valid alignments include only those values returned by an \tcode{alignof} +Valid alignments include only those values returned by an \keyword{alignof} expression for the fundamental types plus an additional \impldef{alignment additional values} set of values, which may be empty. @@ -4175,7 +4176,7 @@ \pnum The alignment requirement of a complete type can be queried using an -\tcode{alignof} expression\iref{expr.alignof}. Furthermore, +\keyword{alignof} expression\iref{expr.alignof}. Furthermore, the narrow character types\iref{basic.fundamental} shall have the weakest alignment requirement. \begin{note} @@ -4255,7 +4256,7 @@ \item for certain unevaluated operands~(\ref{expr.typeid}, \ref{expr.sizeof}), and \item -when a prvalue that has type other than \cv{}~\tcode{void} appears as a discarded-value expression\iref{expr.prop}. +when a prvalue that has type other than \cv{}~\keyword{void} appears as a discarded-value expression\iref{expr.prop}. \end{itemize} \end{note} \begin{example} @@ -4392,10 +4393,10 @@ \item a \begin{itemize} - \item \tcode{const_cast}\iref{expr.const.cast}, - \item \tcode{static_cast}\iref{expr.static.cast}, - \item \tcode{dynamic_cast}\iref{expr.dynamic.cast}, or - \item \tcode{reinterpret_cast}\iref{expr.reinterpret.cast} + \item \keyword{const_cast}\iref{expr.const.cast}, + \item \keyword{static_cast}\iref{expr.static.cast}, + \item \keyword{dynamic_cast}\iref{expr.dynamic.cast}, or + \item \keyword{reinterpret_cast}\iref{expr.reinterpret.cast} \end{itemize} converting, without a user-defined conversion, a glvalue operand that is one of these expressions @@ -4545,10 +4546,10 @@ and \tcode{T2} are bound to the reference parameters of -\tcode{operator+}; +\tcode{\keyword{operator}+}; these temporaries are destroyed at the end of the full-expression containing the call to -\tcode{operator+}. +\tcode{\keyword{operator}+}. The temporary \tcode{T3} bound to the reference @@ -4600,8 +4601,8 @@ \tcode{T}, whether or not the object holds a valid value of type \tcode{T}, the underlying bytes\iref{intro.memory} making up the object can be copied into an array of -\tcode{char}, -\tcode{unsigned char}, or +\keyword{char}, +\tcode{\keyword{unsigned} \keyword{char}}, or \tcode{std::byte}\iref{cstddef.syn}. \begin{footnote} By using, for example, the library @@ -4647,9 +4648,9 @@ \pnum The \defnx{object representation}{representation!object} of an object of type \tcode{T} is the -sequence of \placeholder{N} \tcode{unsigned char} objects taken up +sequence of \placeholder{N} \tcode{\keyword{unsigned} \keyword{char}} objects taken up by the object of type \tcode{T}, where \placeholder{N} equals -\tcode{sizeof(T)}. +\tcode{\keyword{sizeof}(T)}. The \defnx{value representation}{representation!value} of an object of type \tcode{T} is the set of bits that participate in representing a value of type \tcode{T}. @@ -4675,16 +4676,16 @@ The size and layout of an instance of an incompletely-defined object type is unknown. \end{footnote} -Incompletely-defined object types and \cv{}~\tcode{void} are +Incompletely-defined object types and \cv{}~\keyword{void} are \defnx{incomplete types}{type!incomplete}\iref{basic.fundamental}. \begin{note} Objects cannot be defined to have an incomplete type\iref{basic.def}. \end{note} \pnum -A class type (such as ``\tcode{class X}'') can be incomplete at one +A class type (such as ``\tcode{\keyword{class} X}'') can be incomplete at one point in a translation unit and complete later on; the type -``\tcode{class X}'' is the same type at both points. The declared type +``\tcode{\keyword{class} X}'' is the same type at both points. The declared type of an array object can be an array of incomplete class type and therefore incomplete; if the class type is completed later on in the translation unit, the array type becomes complete; the array type at @@ -4693,7 +4694,7 @@ point in a translation unit and complete later on; the array types at those two points (``array of unknown bound of \tcode{T}'' and ``array of \tcode{N} \tcode{T}'') are different types. The type of a pointer to array of -unknown bound, or of a type defined by a \tcode{typedef} declaration to +unknown bound, or of a type defined by a \keyword{typedef} declaration to be an array of unknown bound, cannot be completed. \begin{example} \indextext{type!example of incomplete}% @@ -4732,7 +4733,7 @@ \pnum An \defn{object type} is a (possibly cv-qualified) type that is not -a function type, not a reference type, and not \cv{}~\tcode{void}. +a function type, not a reference type, and not \cv{}~\keyword{void}. \pnum \indextext{class!trivial}% @@ -4762,7 +4763,7 @@ \pnum A type is a \defnadj{literal}{type} if it is: \begin{itemize} -\item \cv{}~\tcode{void}; or +\item \cv{}~\keyword{void}; or \item a scalar type; or \item a reference type; or \item an array of literal type; or @@ -4809,8 +4810,8 @@ \indextext{type!\idxcode{int}}% \indextext{type!\idxcode{long}}% \indextext{type!\idxcode{long long}}% -``\tcode{signed char}'', ``\tcode{short int}'', ``\tcode{int}'', -``\tcode{long int}'', and ``\tcode{long long int}''. In +``\tcode{\keyword{signed} \keyword{char}}'', ``\tcode{\keyword{short} \keyword{int}}'', ``\keyword{int}'', +``\tcode{\keyword{long} \keyword{int}}'', and ``\tcode{\keyword{long} \keyword{long} \keyword{int}}''. In this list, each type provides at least as much storage as those preceding it in the list. \indextext{type!extended signed integer}% @@ -4841,9 +4842,9 @@ \indextext{type!\idxcode{unsigned int}}% \indextext{type!\idxcode{unsigned long}}% \indextext{type!\idxcode{unsigned long long}}% -``\tcode{unsigned char}'', ``\tcode{unsigned short int}'', -``\tcode{unsigned int}'', ``\tcode{unsigned long int}'', and -``\tcode{unsigned long long int}''. +``\tcode{\keyword{unsigned} \keyword{char}}'', ``\tcode{\keyword{unsigned} \keyword{short} \keyword{int}}'', +``\tcode{\keyword{unsigned} \keyword{int}}'', ``\tcode{\keyword{unsigned} \keyword{long} \keyword{int}}'', and +``\tcode{\keyword{unsigned} \keyword{long} \keyword{long} \keyword{int}}''. \indextext{type!extended unsigned integer}% Likewise, for each of the extended signed integer types, there exists a corresponding \defn{extended unsigned integer type}. @@ -4884,11 +4885,11 @@ \topline \lhdr{Type} & \rhdr{Minimum width $N$} \\ \capsep -\tcode{signed char} & 8 \\ -\tcode{short int} & 16 \\ -\tcode{int} & 16 \\ -\tcode{long int} & 32 \\ -\tcode{long long int} & 64 \\ +\tcode{\keyword{signed} \keyword{char}} & 8 \\ +\tcode{\keyword{short} \keyword{int}} & 16 \\ +\keyword{int} & 16 \\ +\tcode{\keyword{long} \keyword{int}} & 32 \\ +\tcode{\keyword{long} \keyword{long} \keyword{int}} & 64 \\ \end{floattable} \pnum @@ -4945,15 +4946,15 @@ \indextext{type!\idxcode{signed char}}% \indextext{character!\idxcode{signed}}% \indextext{type!\idxcode{unsigned char}}% -Type \tcode{char} is a distinct type +Type \keyword{char} is a distinct type that has an \impldef{underlying type of \tcode{char}} choice of -``\tcode{signed char}'' or ``\tcode{unsigned char}'' as its underlying type. -The values of type \tcode{char} can represent distinct codes +``\tcode{\keyword{signed} \keyword{char}}'' or ``\tcode{\keyword{unsigned} \keyword{char}}'' as its underlying type. +The values of type \keyword{char} can represent distinct codes for all members of the implementation's basic character set. -The three types \tcode{char}, \tcode{signed char}, and \tcode{unsigned char} +The three types \keyword{char}, \tcode{\keyword{signed} \keyword{char}}, and \tcode{\keyword{unsigned} \keyword{char}} are collectively called \defnx{ordinary character types}{type!ordinary character}. -The ordinary character types and \tcode{char8_t} +The ordinary character types and \keyword{char8_t} are collectively called \defnx{narrow character types}{narrow character type}. For narrow character types, each possible bit pattern of the object representation represents @@ -4970,10 +4971,10 @@ \indextext{\idxcode{wchar_t}|see{type, \tcode{wchar_t}}}% \indextext{type!\idxcode{wchar_t}}% \indextext{type!underlying!\idxcode{wchar_t}}% -Type \tcode{wchar_t} is a distinct type that has +Type \keyword{wchar_t} is a distinct type that has an \impldef{underlying type of \tcode{wchar_t}} signed or unsigned integer type as its underlying type. -The values of type \tcode{wchar_t} can represent +The values of type \keyword{wchar_t} can represent distinct codes for all members of the largest extended character set specified among the supported locales\iref{locale}. @@ -4981,15 +4982,15 @@ \indextext{\idxcode{char8_t}|see{type, \tcode{char8_t}}}% \indextext{type!\idxcode{char8_t}}% \indextext{type!underlying!\idxcode{char8_t}}% -Type \tcode{char8_t} denotes a distinct type -whose underlying type is \tcode{unsigned char}. +Type \keyword{char8_t} denotes a distinct type +whose underlying type is \tcode{\keyword{unsigned} \keyword{char}}. \indextext{\idxcode{char16_t}|see{type, \tcode{char16_t}}}% \indextext{\idxcode{char32_t}|see{type, \tcode{char32_t}}}% \indextext{type!\idxcode{char16_t}}% \indextext{type!\idxcode{char32_t}}% \indextext{type!underlying!\idxcode{char16_t}}% \indextext{type!underlying!\idxcode{char32_t}}% -Types \tcode{char16_t} and \tcode{char32_t} denote distinct types +Types \keyword{char16_t} and \keyword{char32_t} denote distinct types whose underlying types are \tcode{uint_least16_t} and \tcode{uint_least32_t}, respectively, in \libheaderref{cstdint}. @@ -5001,19 +5002,19 @@ value representation, and alignment requirements as an \impldef{underlying type of \tcode{bool}} unsigned integer type. -The values of type \tcode{bool} are -\tcode{true} and \tcode{false}. +The values of type \keyword{bool} are +\keyword{true} and \keyword{false}. \begin{note} -There are no \tcode{signed}, \tcode{unsigned}, -\tcode{short}, or \tcode{long bool} types or values. +There are no \keyword{signed}, \keyword{unsigned}, +\keyword{short}, or \tcode{\keyword{long} \keyword{bool}} types or values. \end{note} \pnum \indextext{type!integral}% Types -\tcode{bool}, -\tcode{char}, \tcode{wchar_t}, -\tcode{char8_t}, \tcode{char16_t}, \tcode{char32_t}, +\keyword{bool}, +\keyword{char}, \keyword{wchar_t}, +\keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, and the signed and unsigned integer types are collectively called \defnx{integral types}{integral type}. @@ -5028,17 +5029,17 @@ \indextext{floating-point type|see{type, floating-point}}% There are three \defnx{floating-point types}{type!floating-point}: \indextext{type!\idxcode{float}}% -\tcode{float}, +\keyword{float}, \indextext{type!\idxcode{double}}% -\tcode{double}, +\keyword{double}, and \indextext{type!\idxcode{long double}}% -\tcode{long double}. The type \tcode{double} provides at least as much -precision as \tcode{float}, and the type \tcode{long double} provides at -least as much precision as \tcode{double}. The set of values of the type -\tcode{float} is a subset of the set of values of the type -\tcode{double}; the set of values of the type \tcode{double} is a subset -of the set of values of the type \tcode{long double}. The value +\tcode{\keyword{long} \keyword{double}}. The type \keyword{double} provides at least as much +precision as \keyword{float}, and the type \tcode{\keyword{long} \keyword{double}} provides at +least as much precision as \keyword{double}. The set of values of the type +\keyword{float} is a subset of the set of values of the type +\keyword{double}; the set of values of the type \keyword{double} is a subset +of the set of values of the type \tcode{\keyword{long} \keyword{double}}. The value representation of floating-point types is \impldef{value representation of floating-point types}. \indextext{floating-point type!implementation-defined}% @@ -5056,26 +5057,26 @@ \pnum \indextext{type!\idxcode{void}}% -A type \cv{}~\tcode{void} +A type \cv{}~\keyword{void} is an incomplete type that cannot be completed; such a type has an empty set of values. It is used as the return type for functions that do not return a value. Any expression can be -explicitly converted to type \cv{}~\tcode{void}~(\ref{expr.type.conv}, +explicitly converted to type \cv{}~\keyword{void}~(\ref{expr.type.conv}, \ref{expr.static.cast}, \ref{expr.cast}). -An expression of type \cv{}~\tcode{void} shall +An expression of type \cv{}~\keyword{void} shall be used only as an expression statement\iref{stmt.expr}, as an operand of a comma expression\iref{expr.comma}, as a second or third operand of \tcode{?:}\iref{expr.cond}, as the operand of -\tcode{typeid}, \tcode{noexcept}, or \tcode{decltype}, as -the expression in a \tcode{return} statement\iref{stmt.return} for a function -with the return type \cv{}~\tcode{void}, or as the operand of an explicit conversion -to type \cv{}~\tcode{void}. +\keyword{typeid}, \keyword{noexcept}, or \keyword{decltype}, as +the expression in a \keyword{return} statement\iref{stmt.return} for a function +with the return type \cv{}~\keyword{void}, or as the operand of an explicit conversion +to type \cv{}~\keyword{void}. \pnum A value of type \tcode{std::nullptr_t} is a null pointer constant\iref{conv.ptr}. Such values participate in the pointer and the pointer-to-member conversions~(\ref{conv.ptr}, \ref{conv.mem}). -\tcode{sizeof(std::nullptr_t)} shall be equal to \tcode{sizeof(void*)}. +\tcode{\keyword{sizeof}(std::nullptr_t)} shall be equal to \tcode{\keyword{sizeof}(\keyword{void}*)}. \pnum \indextext{type!fundamental}% @@ -5095,9 +5096,9 @@ \item \defnx{arrays}{type!array} of objects of a given type, \ref{dcl.array}; \item \defnx{functions}{type!function}, which have parameters of given types and return -\tcode{void} or references or objects of a given type, \ref{dcl.fct}; +\keyword{void} or references or objects of a given type, \ref{dcl.fct}; -\item \defnx{pointers}{type!pointer} to \cv{}~\tcode{void} or objects or functions (including +\item \defnx{pointers}{type!pointer} to \cv{}~\keyword{void} or objects or functions (including static members of classes) of a given type, \ref{dcl.ptr}; \item @@ -5147,11 +5148,11 @@ \pnum \indextext{terminology!pointer}% -The type of a pointer to \cv{}~\tcode{void} or a pointer to an object type is +The type of a pointer to \cv{}~\keyword{void} or a pointer to an object type is called an \defn{object pointer type}. \begin{note} -A pointer to \tcode{void} -does not have a pointer-to-object type, however, because \tcode{void} is not +A pointer to \keyword{void} +does not have a pointer-to-object type, however, because \keyword{void} is not an object type. \end{note} The type of a pointer that can designate a function @@ -5159,8 +5160,8 @@ A pointer to an object of type \tcode{T} is referred to as a ``pointer to \tcode{T}''. \begin{example} -A pointer to an object of type \tcode{int} is -referred to as ``pointer to \tcode{int}'' and a pointer to an object of +A pointer to an object of type \keyword{int} is +referred to as ``pointer to \keyword{int}'' and a pointer to an object of class \tcode{X} is called a ``pointer to \tcode{X}''. \end{example} Except for pointers to static members, text referring to ``pointers'' @@ -5244,7 +5245,7 @@ then they have the same address, and it is possible to obtain a pointer to one from a pointer to the other -via a \tcode{reinterpret_cast}\iref{expr.reinterpret.cast}. +via a \keyword{reinterpret_cast}\iref{expr.reinterpret.cast}. \begin{note} An array object and its first element are not pointer-interconvertible, even though they have the same address. @@ -5253,12 +5254,12 @@ \pnum \indextext{pointer|seealso{\tcode{void*}}}% \indextext{\idxcode{void*}!type}% -A pointer to \cv{}~\tcode{void} +A pointer to \cv{}~\keyword{void} can be used to point to objects of unknown type. Such a pointer shall be able to hold any object pointer. -An object of type \cv{}~\tcode{void*} +An object of type \cv{}~\tcode{\keyword{void}*} shall have the same representation and alignment -requirements as \cv{}~\tcode{char*}. +requirements as \cv{}~\tcode{\keyword{char}*}. \rSec2[basic.type.qualifier]{CV-qualifiers} @@ -5269,7 +5270,7 @@ A type mentioned in~\ref{basic.fundamental} and~\ref{basic.compound} is a \defnadj{cv-unqualified}{type}. Each type which is a cv-unqualified object type or is -\tcode{void}\iref{basic.types} has three corresponding cv-qualified +\keyword{void}\iref{basic.types} has three corresponding cv-qualified versions of its type: a \defn{const-qualified} version, a \defn{volatile-qualified} version, and a \defn{const-volatile-qualified} version. The @@ -5279,14 +5280,14 @@ \grammarterm{type-id}\iref{dcl.name}, or \grammarterm{new-type-id}\iref{expr.new} when the object is created. \begin{itemize} -\item A \defnadj{const}{object} is an object of type \tcode{const T} or a +\item A \defnadj{const}{object} is an object of type \tcode{\keyword{const} T} or a non-mutable subobject of a const object. \item A \defnadj{volatile}{object} is an object of type - \tcode{volatile T} or a subobject of a volatile object. + \tcode{\keyword{volatile} T} or a subobject of a volatile object. \item A \defnadj{const volatile}{object} is an object of type - \tcode{const volatile T}, a non-mutable subobject of a const volatile object, + \tcode{\keyword{const} \keyword{volatile} T}, a non-mutable subobject of a const volatile object, a const subobject of a volatile object, or a non-mutable volatile subobject of a const object. \end{itemize} @@ -5324,7 +5325,7 @@ const CA arr2 = { 0 }; \end{codeblock} The type of both \tcode{arr1} and \tcode{arr2} is ``array of 5 -\tcode{const char}'', and the array type is considered to be +\tcode{\keyword{const} \keyword{char}}'', and the array type is considered to be const-qualified. \end{example} \indextext{type|)} @@ -5341,35 +5342,35 @@ \tref{basic.type.qualifier.rel} shows the relations that constitute this ordering. -\begin{floattable}{Relations on \tcode{const} and \tcode{volatile}}{basic.type.qualifier.rel} +\begin{floattable}{Relations on \keyword{const} and \keyword{volatile}}{basic.type.qualifier.rel} {ccc} \topline -\cvqual{no cv-qualifier} &<& \tcode{const} \\ -\cvqual{no cv-qualifier} &<& \tcode{volatile} \\ -\cvqual{no cv-qualifier} &<& \tcode{const volatile} \\ -\tcode{const} &<& \tcode{const volatile} \\ -\tcode{volatile} &<& \tcode{const volatile} \\ +\cvqual{no cv-qualifier} &<& \keyword{const} \\ +\cvqual{no cv-qualifier} &<& \keyword{volatile} \\ +\cvqual{no cv-qualifier} &<& \tcode{\keyword{const} \keyword{volatile}} \\ +\keyword{const} &<& \tcode{\keyword{const} \keyword{volatile}} \\ +\keyword{volatile} &<& \tcode{\keyword{const} \keyword{volatile}} \\ \end{floattable} \pnum In this document, the notation \cv{} (or \cvqual{cv1}, \cvqual{cv2}, etc.), used in the description of types, represents an arbitrary set of cv-qualifiers, i.e., one of -\{\tcode{const}\}, \{\tcode{volatile}\}, \{\tcode{const}, -\tcode{volatile}\}, or the empty set. +\{\keyword{const}\}, \{\keyword{volatile}\}, \{\keyword{const}, +\keyword{volatile}\}, or the empty set. For a type \cv{}~\tcode{T}, the \defnx{top-level cv-qualifiers}{cv-qualifier!top-level} of that type are those denoted by \cv. \begin{example} The type corresponding to the \grammarterm{type-id} -\tcode{const int\&} +\tcode{\keyword{const} \keyword{int}\&} has no top-level cv-qualifiers. The type corresponding to the \grammarterm{type-id} -\tcode{volatile int * const} -has the top-level cv-qualifier \tcode{const}. +\tcode{\keyword{volatile} \keyword{int} * \keyword{const}} +has the top-level cv-qualifier \keyword{const}. For a class type \tcode{C}, the type corresponding to the \grammarterm{type-id} -\tcode{void (C::* volatile)(int) const} -has the top-level cv-qualifier \tcode{volatile}. +\tcode{\keyword{void} (C::* \keyword{volatile})(\keyword{int}) \keyword{const}} +has the top-level cv-qualifier \keyword{volatile}. \end{example} \rSec2[conv.rank]{Integer conversion rank}% @@ -5379,18 +5380,18 @@ Every integer type has an \term{integer conversion rank} defined as follows: \begin{itemize} -\item No two signed integer types other than \tcode{char} and \tcode{signed -char} (if \tcode{char} is signed) have the same rank, even if they have +\item No two signed integer types other than \keyword{char} and \tcode{\keyword{signed} +\keyword{char}} (if \keyword{char} is signed) have the same rank, even if they have the same representation. \item The rank of a signed integer type is greater than the rank of any signed integer type with a smaller width. -\item The rank of \tcode{long long int} is greater -than the rank of \tcode{long int}, which is greater than -the rank of \tcode{int}, which is greater than the rank of -\tcode{short int}, which is greater than the rank of -\tcode{signed char}. +\item The rank of \tcode{\keyword{long} \keyword{long} \keyword{int}} is greater +than the rank of \tcode{\keyword{long} \keyword{int}}, which is greater than +the rank of \keyword{int}, which is greater than the rank of +\tcode{\keyword{short} \keyword{int}}, which is greater than the rank of +\tcode{\keyword{signed} \keyword{char}}. \item The rank of any unsigned integer type equals the rank of the corresponding signed integer type. @@ -5398,8 +5399,8 @@ \item The rank of any standard integer type is greater than the rank of any extended integer type with the same width. -\item The rank of \tcode{char} equals the rank of \tcode{signed char} -and \tcode{unsigned char}. +\item The rank of \keyword{char} equals the rank of \tcode{\keyword{signed} \keyword{char}} +and \tcode{\keyword{unsigned} \keyword{char}}. \item The rank of \tcode{bool} is less than the rank of all other standard integer types. @@ -5408,8 +5409,8 @@ \indextext{type!\idxcode{wchar_t}}% \indextext{type!\idxcode{char16_t}}% \indextext{type!\idxcode{char32_t}}% -The ranks of \tcode{char8_t}, \tcode{char16_t}, \tcode{char32_t}, and -\tcode{wchar_t} equal the ranks of their underlying +The ranks of \keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, and +\keyword{wchar_t} equal the ranks of their underlying types\iref{basic.fundamental}. \item The rank of any extended signed integer type relative to another @@ -5541,7 +5542,7 @@ if (S(3).v()) // full-expression includes lvalue-to-rvalue and \tcode{int} to \tcode{bool} conversions, // performed before temporary is deleted at end of full-expression { } - bool b = noexcept(S()); // exception specification of destructor of \tcode{S} considered for \tcode{noexcept} + bool b = noexcept(S()); // exception specification of destructor of \tcode{S} considered for \keyword{noexcept} // full-expression is destruction of \tcode{s2} at end of block } @@ -5565,7 +5566,7 @@ \pnum \indextext{value computation|(}% -Reading an object designated by a \tcode{volatile} +Reading an object designated by a \keyword{volatile} glvalue\iref{basic.lval}, modifying an object, calling a library I/O function, or calling a function that does any of those operations are all @@ -5577,7 +5578,7 @@ initiation of side effects. When a call to a library I/O function returns or an access through a volatile glvalue is evaluated the side effect is considered complete, even though some external actions implied -by the call (such as the I/O itself) or by the \tcode{volatile} access +by the call (such as the I/O itself) or by the \keyword{volatile} access may not have completed yet. \pnum @@ -6113,13 +6114,13 @@ \end{note} \pnum -Two accesses to the same object of type \tcode{volatile std::sig_atomic_t} do not +Two accesses to the same object of type \tcode{\keyword{volatile} std::sig_atomic_t} do not result in a data race if both occur in the same thread, even if one or more occurs in a signal handler. For each signal handler invocation, evaluations performed by the thread invoking a signal handler can be divided into two groups $A$ and $B$, such that no evaluations in $B$ happen before evaluations in $A$, and the -evaluations of such \tcode{volatile std::sig_atomic_t} objects take values as though +evaluations of such \tcode{\keyword{volatile} std::sig_atomic_t} objects take values as though all evaluations in $A$ happened before the execution of the signal handler and the execution of the signal handler happened before all evaluations in $B$. @@ -6381,12 +6382,12 @@ An implementation shall not predefine the \tcode{main} function. Its type shall have \Cpp{} language linkage and it shall have a declared return type of type -\tcode{int}, but otherwise its type is \impldef{parameters to \tcode{main}}. +\keyword{int}, but otherwise its type is \impldef{parameters to \tcode{main}}. \indextext{\idxcode{main} function!implementation-defined parameters to}% An implementation shall allow both \begin{itemize} -\item a function of \tcode{()} returning \tcode{int} and -\item a function of \tcode{(int}, pointer to pointer to \tcode{char)} returning \tcode{int} +\item a function of \tcode{()} returning \keyword{int} and +\item a function of \tcode{(\keyword{int}}, pointer to pointer to \tcode{\keyword{char})} returning \keyword{int} \end{itemize} \indextext{\idxcode{argc}}% \indextext{\idxcode{argv}}% @@ -6418,7 +6419,7 @@ The linkage\iref{basic.link} of \tcode{main} is \impldef{linkage of \tcode{main}}. A program that defines \tcode{main} as deleted or that declares \tcode{main} to be -\tcode{inline}, \tcode{static}, or \tcode{constexpr} is ill-formed. +\keyword{inline}, \keyword{static}, or \keyword{constexpr} is ill-formed. The function \tcode{main} shall not be a coroutine\iref{dcl.fct.def.coroutine}. The \tcode{main} function shall not be declared with a \grammarterm{linkage-specification}\iref{dcl.link}. @@ -6452,12 +6453,12 @@ \pnum \indextext{termination!program}% \indextext{\idxcode{main} function!return from}% -A \tcode{return} statement\iref{stmt.return} in \tcode{main} has the effect of leaving the main +A \keyword{return} statement\iref{stmt.return} in \tcode{main} has the effect of leaving the main function (destroying any objects with automatic storage duration) and calling \tcode{std::exit} with the return value as the argument. If control flows off the end of the \grammarterm{compound-statement} of \tcode{main}, -the effect is equivalent to a \tcode{return} with operand \tcode{0} +the effect is equivalent to a \keyword{return} with operand \tcode{0} (see also \ref{except.handle}). \indextext{\idxcode{main} function|)} diff --git a/source/classes.tex b/source/classes.tex index d775b1a0b5..a5a7cc27a0 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -255,11 +255,11 @@ \pnum A \defnadj{standard-layout}{struct} is a standard-layout class -defined with the \grammarterm{class-key} \tcode{struct} or the -\grammarterm{class-key} \tcode{class}. +defined with the \grammarterm{class-key} \keyword{struct} or the +\grammarterm{class-key} \keyword{class}. A \defnadj{standard-layout}{union} is a standard-layout class defined with the -\grammarterm{class-key} \tcode{union}. +\grammarterm{class-key} \keyword{union}. \pnum \begin{note} @@ -360,7 +360,7 @@ int stat(struct stat*); // \tcode{stat} now also names a function void f() { - struct stat* ps; // \tcode{struct} prefix needed to name \tcode{struct stat} + struct stat* ps; // \keyword{struct} prefix needed to name \tcode{struct stat} stat(ps); // call \tcode{stat} function } \end{codeblock} @@ -432,7 +432,7 @@ \end{codeblock} first specifies \tcode{A} to be the name of a class and then redefines it as the name of a pointer to an object of that class. This means that -the elaborated form \tcode{class} \tcode{A} must be used to refer to the +the elaborated form \keyword{class} \tcode{A} must be used to refer to the class. Such artistry with names can be confusing and is best avoided. \end{note} @@ -548,7 +548,7 @@ \pnum A data member or member function -may be declared \tcode{static} in its \grammarterm{member-declaration}, +may be declared \keyword{static} in its \grammarterm{member-declaration}, in which case it is a \defnadj{static}{member} (see~\ref{class.static}) (a \defnadj{static}{data member}\iref{class.static.data} or \defnadj{static}{member function}\iref{class.static.mfct}, respectively) @@ -658,8 +658,8 @@ exception specification of that constructor. \pnum -A member shall not be declared with the \tcode{extern} -\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}. +A member shall not be declared with the \keyword{extern} +\grammarterm{storage-class-specifier}. Within a class definition, a member shall not be declared with the \keyword{thread_local} \grammarterm{storage-class-specifier} unless also declared \keyword{static}. \pnum The \grammarterm{decl-specifier-seq} may be omitted in constructor, destructor, @@ -866,7 +866,7 @@ it is inline\iref{dcl.inline}. \begin{note} A member function is also inline if it is declared -\tcode{inline}, \tcode{constexpr}, or \tcode{consteval}. +\keyword{inline}, \keyword{constexpr}, or \keyword{consteval}. \end{note} \pnum @@ -1003,7 +1003,7 @@ \indextext{member function!const volatile}% \begin{note} A non-static member function can be declared with -\grammarterm{cv-qualifier}{s}, which affect the type of the \tcode{this} +\grammarterm{cv-qualifier}{s}, which affect the type of the \keyword{this} pointer\iref{expr.prim.this}, and/or a \grammarterm{ref-qualifier}\iref{dcl.fct}; both affect overload resolution\iref{over.match.funcs} @@ -1141,8 +1141,8 @@ \end{itemize} Constructors do not have names. In a constructor declaration, each \grammarterm{decl-specifier} in the optional -\grammarterm{decl-specifier-seq} shall be \tcode{friend}, \tcode{inline}, -\tcode{constexpr}, or an \grammarterm{explicit-specifier}. +\grammarterm{decl-specifier-seq} shall be \keyword{friend}, \keyword{inline}, +\keyword{constexpr}, or an \grammarterm{explicit-specifier}. \begin{example} \begin{codeblock} struct S { @@ -1194,14 +1194,14 @@ \indextext{\idxcode{const}!constructor and}% \indextext{\idxcode{volatile}!constructor and}% A constructor can be invoked for a -\tcode{const}, +\keyword{const}, \tcode{volatile} or -\tcode{const} +\keyword{const} \tcode{volatile} object. \indextext{restriction!constructor}% -\tcode{const} +\keyword{const} and \tcode{volatile} semantics\iref{dcl.type.cv} are not applied on an object under construction. @@ -1317,7 +1317,7 @@ the program is ill-formed. If that user-written default constructor would satisfy the requirements of a constexpr constructor\iref{dcl.constexpr}, the implicitly-defined -default constructor is \tcode{constexpr}. +default constructor is \keyword{constexpr}. Before the defaulted default constructor for a class is implicitly defined, all the non-user-provided default constructors for its base classes and @@ -1431,7 +1431,7 @@ only has a copy constructor with a parameter of type \tcode{X\&}, an initializer of type -\tcode{const} +\keyword{const} \tcode{X} or \tcode{volatile} @@ -1496,10 +1496,10 @@ \tcode{M} (or array thereof) has a copy constructor whose first parameter is of type -\tcode{const} +\keyword{const} \tcode{M\&} or -\tcode{const} +\keyword{const} \tcode{volatile} \tcode{M\&}. \begin{footnote} @@ -1621,7 +1621,7 @@ \end{note} If the implicitly-defined constructor would satisfy the requirements of a constexpr constructor\iref{dcl.constexpr}, the implicitly-defined -constructor is \tcode{constexpr}. +constructor is \keyword{constexpr}. \pnum Before the defaulted copy/move constructor for a class is @@ -1846,7 +1846,7 @@ \item a variant member with a non-trivial corresponding assignment operator and \tcode{X} is a union-like class, or -\item a non-static data member of \tcode{const} non-class +\item a non-static data member of \keyword{const} non-class type (or array thereof), or \item a non-static data member of reference type, or @@ -1920,7 +1920,7 @@ to assign to an object of its class type), when it is needed for constant evaluation\iref{expr.const}, or when it is explicitly defaulted after its first declaration. -The implicitly-defined copy/move assignment operator is \tcode{constexpr} if +The implicitly-defined copy/move assignment operator is \keyword{constexpr} if \begin{itemize} \item \tcode{X} is a literal type, and @@ -2036,11 +2036,11 @@ Each \grammarterm{decl-specifier} of the \grammarterm{decl-specifier-seq} of a prospective destructor declaration (if any) shall be -\tcode{friend}, -\tcode{inline}, -\tcode{virtual}, -\tcode{constexpr}, or -\tcode{consteval}. +\keyword{friend}, +\keyword{inline}, +\keyword{virtual}, +\keyword{constexpr}, or +\keyword{consteval}. \pnum \indextext{generated destructor|see{destructor, default}}% @@ -2079,13 +2079,13 @@ \indextext{\idxcode{const}!destructor and}% \indextext{\idxcode{volatile}!destructor and}% A destructor can be invoked for a -\tcode{const}, +\keyword{const}, \tcode{volatile} or -\tcode{const} +\keyword{const} \tcode{volatile} object. -\tcode{const} +\keyword{const} and \tcode{volatile} semantics\iref{dcl.type.cv} are not applied on an object under destruction. @@ -2257,7 +2257,7 @@ the destructor is invoked via a null pointer value), the program has undefined behavior. \begin{note} -Invoking \tcode{delete} on a null pointer does not call the +Invoking \keyword{delete} on a null pointer does not call the destructor; see \ref{expr.delete}. \end{note} \begin{example} @@ -2492,7 +2492,7 @@ Such functions are called \defnx{conversion functions}{conversion function}. A \grammarterm{decl-specifier} in the \grammarterm{decl-specifier-seq} of a conversion function (if any) shall be neither -a \grammarterm{defining-type-specifier} nor \tcode{static}. +a \grammarterm{defining-type-specifier} nor \keyword{static}. \indextext{conversion!type of}% The type of the conversion function\iref{dcl.fct} is ``function taking no parameter returning @@ -2500,10 +2500,10 @@ A conversion function is never used to convert a (possibly cv-qualified) object to the (possibly cv-qualified) same object type (or a reference to it), to a (possibly cv-qualified) base class of that type (or a reference to it), -or to \cv{}~\tcode{void}. +or to \cv{}~\keyword{void}. \begin{footnote} These conversions are considered -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}. +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}. Even though never directly called to perform a conversion, such conversion functions can be declared and can potentially be reached through a call to a virtual conversion function in a base class. @@ -2653,7 +2653,7 @@ \pnum Static members obey the usual class member access rules\iref{class.access}. When used in the declaration of a class -member, the \tcode{static} specifier shall only be used in the member +member, the \keyword{static} specifier shall only be used in the member declarations that appear within the \grammarterm{member-specification} of the class definition. \begin{note} @@ -2671,10 +2671,10 @@ \pnum \begin{note} -A static member function does not have a \tcode{this} +A static member function does not have a \keyword{this} pointer\iref{expr.prim.this}. -A static member function cannot be qualified with \tcode{const}, -\tcode{volatile}, or \tcode{virtual}\iref{dcl.fct}. +A static member function cannot be qualified with \keyword{const}, +\tcode{volatile}, or \keyword{virtual}\iref{dcl.fct}. \end{note} \rSec3[class.static.data]{Static data members} @@ -2682,13 +2682,13 @@ \pnum A static data member is not part of the subobjects of a class. If a -static data member is declared \tcode{thread_local} there is one copy of +static data member is declared \keyword{thread_local} there is one copy of the member per thread. If a static data member is not declared -\tcode{thread_local} there is one copy of the data member that is shared by all +\keyword{thread_local} there is one copy of the data member that is shared by all the objects of the class. \pnum -A static data member shall not be \tcode{mutable}\iref{dcl.stc}. +A static data member shall not be \keyword{mutable}\iref{dcl.stc}. A static data member shall not be a direct member\iref{class.mem} of an unnamed\iref{class.pre} or local\iref{class.local} class or of a (possibly indirectly) nested class\iref{class.nest} thereof. @@ -2699,7 +2699,7 @@ The declaration of a non-inline static data member in its class definition is not a definition and may be of an incomplete type other than -\cv{}~\tcode{void}. +\cv{}~\keyword{void}. \indextext{operator use!scope resolution}% \begin{note} The \grammarterm{initializer} in the definition of a @@ -2738,7 +2738,7 @@ \end{note} \pnum -If a non-volatile non-inline \tcode{const} static data member is +If a non-volatile non-inline \keyword{const} static data member is of integral or enumeration type, its declaration in the class definition can specify a \grammarterm{brace-or-equal-initializer} in which every @@ -2749,7 +2749,7 @@ namespace scope definition shall not contain an \grammarterm{initializer}. The declaration of an inline static data member (which is a definition) may specify a \grammarterm{brace-or-equal-initializer}. If the -member is declared with the \tcode{constexpr} specifier, it may be +member is declared with the \keyword{constexpr} specifier, it may be redeclared in namespace scope with no initializer (this usage is deprecated; see \ref{depr.static.constexpr}). Declarations of other static data members shall not specify a \grammarterm{brace-or-equal-initializer}. @@ -2828,7 +2828,7 @@ A non-const reference shall not be bound to a bit-field\iref{dcl.init.ref}. \begin{note} -If the initializer for a reference of type \tcode{const} \tcode{T\&} is +If the initializer for a reference of type \keyword{const} \tcode{T\&} is an lvalue that refers to a bit-field, the reference is bound to a temporary initialized to hold the value of the bit-field; the reference is not bound to the bit-field directly. See~\ref{dcl.init.ref}. @@ -2942,7 +2942,7 @@ \pnum A \defn{union} is a class defined with the \grammarterm{class-key} -\tcode{union}. +\keyword{union}. \pnum In a union, @@ -3091,7 +3091,7 @@ the use of a placement \grammarterm{new-expression}. \end{note} \begin{example} -Consider an object \tcode{u} of a \tcode{union} type \tcode{U} having non-static data members +Consider an object \tcode{u} of a \keyword{union} type \tcode{U} having non-static data members \tcode{m} of type \tcode{M} and \tcode{n} of type \tcode{N}. If \tcode{M} has a non-trivial destructor and \tcode{N} has a non-trivial constructor (for instance, if they declare or inherit virtual functions), the active member of \tcode{u} can be safely switched from \tcode{m} to @@ -3144,7 +3144,7 @@ \indextext{\idxcode{union}!global anonymous}% \indextext{scope!anonymous \tcode{union} at namespace}% Anonymous unions declared in the scope of a namespace with external linkage -shall be declared \tcode{static}. Anonymous unions declared at +shall be declared \keyword{static}. Anonymous unions declared at block scope shall be declared with any storage class allowed for a block variable, or with no storage class. A storage class is not allowed in a declaration of an anonymous union in a class scope. @@ -3489,8 +3489,8 @@ \pnum \indextext{base class!virtual}% A base class specifier that does not contain the keyword -\tcode{virtual} specifies a \defnadj{non-virtual}{base class}. A base -class specifier that contains the keyword \tcode{virtual} specifies a +\keyword{virtual} specifies a \defnadj{non-virtual}{base class}. A base +class specifier that contains the keyword \keyword{virtual} specifies a \defnadj{virtual}{base class}. For each distinct occurrence of a non-virtual base class in the class lattice of the most derived class, the most derived object\iref{intro.object} shall contain a @@ -3540,7 +3540,7 @@ \end{importgraphic} For an object \tcode{c} of class type \tcode{C}, a single subobject of type \tcode{V} is shared by every base class subobject of \tcode{c} that has a -\tcode{virtual} base class of type \tcode{V}. Given the class \tcode{C} +\keyword{virtual} base class of type \tcode{V}. Given the class \tcode{C} defined above, an object of class \tcode{C} will have one subobject of class \tcode{V}, as shown in \fref{class.virt}. \indextext{DAG!multiple inheritance}% @@ -3558,7 +3558,7 @@ class Z : public B { @\commentellip@ }; class AA : public X, public Y, public Z { @\commentellip@ }; \end{codeblock} -For an object of class \tcode{AA}, all \tcode{virtual} occurrences of +For an object of class \tcode{AA}, all \keyword{virtual} occurrences of base class \tcode{B} in the class lattice of \tcode{AA} correspond to a single \tcode{B} subobject within the object of type \tcode{AA}, and every other occurrence of a (non-virtual) base class \tcode{B} in the @@ -3584,11 +3584,11 @@ \pnum A non-static member function is a \defnadj{virtual}{function} -if it is first declared with the keyword \tcode{virtual} or +if it is first declared with the keyword \keyword{virtual} or if it overrides a virtual member function declared in a base class (see below). \begin{footnote} -The use of the \tcode{virtual} specifier in the +The use of the \keyword{virtual} specifier in the declaration of an overriding function is valid but redundant (has empty semantics). \end{footnote} @@ -3813,7 +3813,7 @@ \pnum \begin{note} -The \tcode{virtual} specifier implies membership, so a virtual function +The \keyword{virtual} specifier implies membership, so a virtual function cannot be a non-member\iref{dcl.fct.spec} function. Nor can a virtual function be a static member, since a virtual function call relies on a specific object for determining which function to invoke. A virtual @@ -3940,10 +3940,10 @@ \indextext{function!virtual|)} \pnum -A \tcode{consteval} virtual function shall not override -a virtual function that is not \tcode{consteval}. -A \tcode{consteval} virtual function shall not be overridden by -a virtual function that is not \tcode{consteval}. +A \keyword{consteval} virtual function shall not override +a virtual function that is not \keyword{consteval}. +A \keyword{consteval} virtual function shall not be overridden by +a virtual function that is not \keyword{consteval}. \rSec2[class.abstract]{Abstract classes}% @@ -4110,12 +4110,12 @@ \indextext{default access control|see{access control, default}}% \indextext{access control!default}% Members of a class defined with the keyword -\tcode{class} +\keyword{class} are -\tcode{private} +\keyword{private} by default. Members of a class defined with the keywords -\tcode{struct} or \tcode{union} +\keyword{struct} or \keyword{union} are public by default. \begin{example} \begin{codeblock} @@ -4278,7 +4278,7 @@ \begin{example} \begin{codeblock} class X { - int a; // \tcode{X::a} is private by default: \tcode{class} used + int a; // \tcode{X::a} is private by default: \keyword{class} used public: int b; // \tcode{X::b} is public int c; // \tcode{X::c} is public @@ -4291,7 +4291,7 @@ \begin{example} \begin{codeblock} struct S { - int a; // \tcode{S::a} is public by default: \tcode{struct} used + int a; // \tcode{S::a} is public by default: \keyword{struct} used protected: int b; // \tcode{S::b} is protected private: @@ -4352,19 +4352,19 @@ \pnum If a class is declared to be a base class\iref{class.derived} for another class using the -\tcode{public} +\keyword{public} access specifier, the public members of the base class are accessible as public members of the derived class and protected members of the base class are accessible as protected members of the derived class. If a class is declared to be a base class for another class using the -\tcode{protected} +\keyword{protected} access specifier, the public and protected members of the base class are accessible as protected members of the derived class. If a class is declared to be a base class for another class using the -\tcode{private} +\keyword{private} access specifier, the public and protected members of the base class are accessible as private @@ -4380,15 +4380,15 @@ In the absence of an \grammarterm{access-specifier} for a base class, -\tcode{public} +\keyword{public} is assumed when the derived class is defined with the \grammarterm{class-key} -\tcode{struct} +\keyword{struct} and -\tcode{private} +\keyword{private} is assumed when the class is defined with the \grammarterm{class-key} -\tcode{class}. +\keyword{class}. \begin{example} \begin{codeblock} class B { @\commentellip@ }; @@ -4733,7 +4733,7 @@ (\ref{temp.pre}, \ref{temp.friend}). \end{note} If the -type specifier in a \tcode{friend} declaration designates a (possibly +type specifier in a \keyword{friend} declaration designates a (possibly cv-qualified) class type, that class is declared as a friend; otherwise, the friend declaration is ignored. \begin{example} @@ -4962,8 +4962,8 @@ void D2::mem(B* pb, D1* p1) { pb->i = 1; // error p1->i = 2; // error - i = 3; // OK (access through \tcode{this}) - B::i = 4; // OK (access through \tcode{this}, qualification ignored) + i = 3; // OK (access through \keyword{this}) + B::i = 4; // OK (access through \keyword{this}, qualification ignored) int B::* pmi_B = &B::i; // error int B::* pmi_B2 = &D2::i; // OK j = 5; // OK (because \tcode{j} refers to static member) @@ -5625,7 +5625,7 @@ Similarly, an object under construction can be the operand of the \tcode{typeid} operator\iref{expr.typeid} or of a -\tcode{dynamic_cast}\iref{expr.dynamic.cast}. +\keyword{dynamic_cast}\iref{expr.dynamic.cast}. However, if these operations are performed in a \grammarterm{ctor-initializer} (or in a function called directly or indirectly from a @@ -5667,7 +5667,7 @@ \ref{class.cdtor} describes the result of virtual function calls, \tcode{typeid} and -\tcode{dynamic_cast}s +\keyword{dynamic_cast}s during construction for the well-defined cases; that is, describes the polymorphic behavior of an object under construction. @@ -5845,7 +5845,7 @@ if the value of the object or any of its subobjects is accessed through a glvalue that is not obtained, directly or indirectly, from the constructor's -\tcode{this} +\keyword{this} pointer, the value of the object or subobject thus obtained is unspecified. \begin{example} \begin{codeblock} @@ -6004,24 +6004,24 @@ \indextext{destruction!dynamic cast and}% \indextext{cast!dynamic!construction and}% \indextext{cast!dynamic!destruction and}% -\tcode{dynamic_cast}s\iref{expr.dynamic.cast} can be used during construction +\keyword{dynamic_cast}s\iref{expr.dynamic.cast} can be used during construction or destruction\iref{class.base.init}. When a -\tcode{dynamic_cast} +\keyword{dynamic_cast} is used in a constructor (including the \grammarterm{mem-initializer} or default member initializer for a non-static data member) or in a destructor, or used in a function called (directly or indirectly) from a constructor or destructor, if the operand of the -\tcode{dynamic_cast} +\keyword{dynamic_cast} refers to the object under construction or destruction, this object is considered to be a most derived object that has the type of the constructor or destructor's class. If the operand of the -\tcode{dynamic_cast} +\keyword{dynamic_cast} refers to the object under construction or destruction and the static type of the operand is not a pointer to or object of the constructor or destructor's own class or one of its bases, the -\tcode{dynamic_cast} +\keyword{dynamic_cast} results in undefined behavior. \begin{example} \begin{codeblock} @@ -6346,11 +6346,11 @@ \begin{itemize} \item -for an \tcode{operator<=>} whose return type is not \tcode{auto}, +for an \tcode{operator<=>} whose return type is not \keyword{auto}, when determining whether a synthesized three-way comparison is defined, \item -for an \tcode{operator<=>} whose return type is \tcode{auto} or +for an \tcode{operator<=>} whose return type is \keyword{auto} or for an \tcode{operator==}, for a comparison between an element of the expanded list of subobjects and itself, or @@ -6380,8 +6380,8 @@ has the same \grammarterm{parameter-declaration-clause} and trailing \grammarterm{requires-clause} as the respective three-way comparison operator. -It is declared with \tcode{friend}, \tcode{virtual}, \tcode{constexpr}, -or \tcode{consteval} if +It is declared with \keyword{friend}, \keyword{virtual}, \keyword{constexpr}, +or \keyword{consteval} if the three-way comparison operator function is so declared. If the three-way comparison operator function has no \grammarterm{noexcept-specifier}, @@ -6528,7 +6528,7 @@ \begin{itemize} \item -If \tcode{R} is \tcode{auto}, then +If \tcode{R} is \keyword{auto}, then let $\cv{}_i~\tcode{R}_i$ be the type of the expression $\tcode{x}_i\tcode{ <=> }\tcode{x}_i$. The operator function is defined as deleted @@ -6635,7 +6635,7 @@ Any allocation function for a class \tcode{T} is a static member (even if not explicitly declared -\tcode{static}). +\keyword{static}). \pnum \begin{example} @@ -6661,7 +6661,7 @@ Any deallocation function for a class \tcode{X} is a static member (even if not explicitly declared -\tcode{static}). +\keyword{static}). \begin{example} \begin{codeblock} class X { @@ -6678,7 +6678,7 @@ \pnum Since member allocation and deallocation functions are -\tcode{static} +\keyword{static} they cannot be virtual. \begin{note} However, when the diff --git a/source/compatibility.tex b/source/compatibility.tex index 24163a3422..2251bd3c1d 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -69,13 +69,13 @@ Required for new features. \begin{itemize} \item -The \tcode{char8_t} keyword is added to differentiate +The \keyword{char8_t} keyword is added to differentiate the types of ordinary and UTF-8 literals\iref{lex.string}. \item The \tcode{concept} keyword is added to enable the definition of concepts\iref{temp.concept}. \item -The \tcode{consteval} keyword is added to +The \keyword{consteval} keyword is added to declare immediate functions\iref{dcl.constexpr}. \item The \keyword{constinit} keyword is added to @@ -90,10 +90,10 @@ \end{itemize} \effectafteritemize Valid \CppXVII{} code using -\tcode{char8_t}, +\keyword{char8_t}, \tcode{concept}, -\tcode{consteval}, -\tcode{constinit}, +\keyword{consteval}, +\keyword{constinit}, \tcode{co_await}, \tcode{co_yield}, \tcode{co_return}, or \tcode{requires} as an identifier is not valid in this revision of \Cpp{}. @@ -132,7 +132,7 @@ const auto *u8s = u8"text"; // \tcode{u8s} previously deduced as \tcode{const char*}; now deduced as \tcode{const char8_t*} const char *ps = u8s; // ill-formed; previously well-formed -auto u8c = u8'c'; // \tcode{u8c} previously deduced as \tcode{char}; now deduced as \tcode{char8_t} +auto u8c = u8'c'; // \tcode{u8c} previously deduced as \tcode{char}; now deduced as \keyword{char8_t} char *pc = &u8c; // ill-formed; previously well-formed std::string s = u8"text"; // ill-formed; previously well-formed @@ -294,10 +294,10 @@ \diffref{class.ctor,class.conv.fct} \change The class name can no longer be used parenthesized -immediately after an \tcode{explicit} \grammarterm{decl-specifier} +immediately after an \keyword{explicit} \grammarterm{decl-specifier} in a constructor declaration. The \grammarterm{conversion-function-id} can no longer be used parenthesized -immediately after an \tcode{explicit} \grammarterm{decl-specifier} +immediately after an \keyword{explicit} \grammarterm{decl-specifier} in a conversion function declaration. \rationale Necessary for new functionality. @@ -443,12 +443,12 @@ \change Remove \tcode{throw()} exception specification. \rationale -Removal of obsolete feature that has been replaced by \tcode{noexcept}. +Removal of obsolete feature that has been replaced by \keyword{noexcept}. \effect A valid \CppXVII{} function declaration, member function declaration, function pointer declaration, or function reference declaration that uses \tcode{throw()} for its exception specification will be rejected as ill-formed in this -revision of \Cpp{}. It should simply be replaced with \tcode{noexcept} for no +revision of \Cpp{}. It should simply be replaced with \keyword{noexcept} for no change of meaning since \CppXVII{}. \begin{note} There is no way to write a function declaration @@ -521,7 +521,7 @@ \diffref{forward.list,list} \change Return types of \tcode{remove}, \tcode{remove_if}, and \tcode{unique} -changed from \tcode{void} to \tcode{container::size_type}. +changed from \keyword{void} to \tcode{container::size_type}. \rationale Improve efficiency and convenience of finding number of removed elements. \effect @@ -591,14 +591,14 @@ \diffref{ostream.inserters.character} \change Overload resolution for ostream inserters -used with \tcode{wchar_t}, \tcode{char16_t}, or \tcode{char32_t} types. +used with \keyword{wchar_t}, \keyword{char16_t}, or \keyword{char32_t} types. \rationale Removal of surprising behavior. \effect Valid \CppXVII{} code that passes -\tcode{wchar_t}, \tcode{char16_t}, or \tcode{char32_t} characters or strings +\keyword{wchar_t}, \keyword{char16_t}, or \keyword{char32_t} characters or strings to \tcode{basic_ostream::operator<<} or -that passes \tcode{char16_t} or \tcode{char32_t} characters or strings +that passes \keyword{char16_t} or \keyword{char32_t} characters or strings to \tcode{basic_ostream::operator<<} is now ill-formed. \begin{codeblock} std::cout << u"text"; // previously formatted the string as a pointer value; @@ -641,7 +641,7 @@ \rationale The deprecated support relied on a limited convention that could not be extended to support the general case or new language features. It has been -superseded by direct language support with \tcode{decltype}, and by the +superseded by direct language support with \keyword{decltype}, and by the \tcode{std::bind} and \tcode{std::not_fn} function templates. \effect A valid \CppXVII{} program that relies on the presence of \tcode{result_type}, @@ -704,7 +704,7 @@ \rationale The traits had unreliable or awkward interfaces. The \tcode{is_literal_type} trait provided no way to detect which subset of constructors and member -functions of a type were declared \tcode{constexpr}. The \tcode{result_of} +functions of a type were declared \keyword{constexpr}. The \tcode{result_of} trait had a surprising syntax that could not report the result of a regular function type. It has been superseded by the \tcode{invoke_result} trait. \effect @@ -789,17 +789,17 @@ \diffref{dcl.stc} \indextext{\idxcode{register} storage class}% \change -Removal of \tcode{register} \grammarterm{storage-class-specifier}. +Removal of \keyword{register} \grammarterm{storage-class-specifier}. \rationale Enable repurposing of deprecated keyword in future revisions of \Cpp{}. \effect -A valid \CppXIV{} declaration utilizing the \tcode{register} +A valid \CppXIV{} declaration utilizing the \keyword{register} \grammarterm{storage-class-specifier} is ill-formed in this revision of \Cpp{}. The specifier can simply be removed to retain the original meaning. \diffref{dcl.spec.auto} \change -\tcode{auto} deduction from \grammarterm{braced-init-list}. +\keyword{auto} deduction from \grammarterm{braced-init-list}. \rationale More intuitive deduction behavior. \effect @@ -1165,10 +1165,10 @@ \diffref{dcl.constexpr} \change -\tcode{constexpr} non-static member functions are not implicitly -\tcode{const} member functions. +\keyword{constexpr} non-static member functions are not implicitly +\keyword{const} member functions. \rationale -Necessary to allow \tcode{constexpr} member functions to mutate +Necessary to allow \keyword{constexpr} member functions to mutate the object. \effect Valid \CppXI{} code may fail to compile in this revision of \Cpp{}. @@ -1283,15 +1283,15 @@ Added to \tref{lex.key}, the following identifiers are new keywords: \tcode{alignas}, \tcode{alignof}, -\tcode{char16_t}, -\tcode{char32_t}, -\tcode{constexpr}, -\tcode{decltype}, -\tcode{noexcept}, -\tcode{nullptr}, -\tcode{static_assert}, +\keyword{char16_t}, +\keyword{char32_t}, +\keyword{constexpr}, +\keyword{decltype}, +\keyword{noexcept}, +\keyword{nullptr}, +\keyword{static_assert}, and -\tcode{thread_local}. +\keyword{thread_local}. Valid \CppIII{} code using these identifiers is invalid in this revision of \Cpp{}. \diffref{lex.icon} @@ -1352,15 +1352,15 @@ \diffref{dcl.spec} \change -Remove \tcode{auto} as a storage class specifier. +Remove \keyword{auto} as a storage class specifier. \rationale New feature. \effect -Valid \CppIII{} code that uses the keyword \tcode{auto} as a storage class +Valid \CppIII{} code that uses the keyword \keyword{auto} as a storage class specifier may be invalid in this revision of \Cpp{}. In this revision of \Cpp{}, -\tcode{auto} indicates that the type of a variable is to be deduced +\keyword{auto} indicates that the type of a variable is to be deduced from its initializer expression. \diffref{dcl.init.list} @@ -1533,7 +1533,7 @@ \tcode{operator new} may throw exceptions other than \tcode{std::bad_alloc}. \rationale -Consistent application of \tcode{noexcept}. +Consistent application of \keyword{noexcept}. \effect Valid \CppIII{} code that assumes that global \tcode{operator new} only throws \tcode{std::bad_alloc} may execute differently in this revision of \Cpp{}. @@ -1597,7 +1597,7 @@ Allow small-string optimization. \effect Valid \CppIII{} code may execute differently in this revision of \Cpp{}. -Some \tcode{const} member functions, such as \tcode{data} and \tcode{c_str}, +Some \keyword{const} member functions, such as \tcode{data} and \tcode{c_str}, no longer invalidate iterators. \rSec2[diff.cpp03.containers]{\ref{containers}: containers library} @@ -1641,7 +1641,7 @@ \diffref{sequence.reqmts,associative.reqmts} \change -Signature changes: from \tcode{void} return types. +Signature changes: from \keyword{void} return types. \rationale Old signature threw away useful information that may be expensive to recalculate. @@ -1654,7 +1654,7 @@ \item \tcode{insert(pos, beg, end)} for \tcode{vector}, \tcode{deque}, \tcode{list}, \tcode{forward_list} \end{itemize} -Valid \CppIII{} code that relies on these functions returning \tcode{void} +Valid \CppIII{} code that relies on these functions returning \keyword{void} (e.g., code that creates a pointer to member function that points to one of these functions) will fail to compile with this revision of \Cpp{}. @@ -1722,7 +1722,7 @@ \diffref{istream.sentry,ostream.sentry,iostate.flags} \change -Specify use of \tcode{explicit} in existing boolean conversion functions. +Specify use of \keyword{explicit} in existing boolean conversion functions. \rationale Clarify intentions, avoid workarounds. \effect @@ -1848,7 +1848,7 @@ from ``array of \textit{some-integer-type}'' to ``array of \tcode{const char32_t}''. The type of a wide string literal is changed -from ``array of \tcode{wchar_t}'' +from ``array of \keyword{wchar_t}'' to ``array of \tcode{const wchar_t}''. \rationale This avoids calling an inappropriate overloaded function, @@ -1910,7 +1910,7 @@ \diffref{basic.scope} \change -A \tcode{struct} is a scope in \Cpp{}, not in C. +A \keyword{struct} is a scope in \Cpp{}, not in C. For example, \begin{codeblock} struct X { @@ -1926,15 +1926,15 @@ \difficulty Semantic transformation. \howwide -C programs use \tcode{struct} extremely frequently, but the -change is only noticeable when \tcode{struct}, enumeration, or enumerator -names are referred to outside the \tcode{struct}. +C programs use \keyword{struct} extremely frequently, but the +change is only noticeable when \keyword{struct}, enumeration, or enumerator +names are referred to outside the \keyword{struct}. The latter is probably rare. \diffref{basic.link} [also \ref{dcl.type}] \change -A name of file scope that is explicitly declared \tcode{const}, and not explicitly -declared \tcode{extern}, has internal linkage, while in C it would have external linkage. +A name of file scope that is explicitly declared \keyword{const}, and not explicitly +declared \keyword{extern}, has internal linkage, while in C it would have external linkage. \rationale Because const objects may be used as values during translation in \Cpp{}, this feature urges programmers to provide an explicit initializer @@ -1965,7 +1965,7 @@ \change C allows ``compatible types'' in several places, \Cpp{} does not.\\ For example, -otherwise-identical \tcode{struct} types with different tag names +otherwise-identical \keyword{struct} types with different tag names are ``compatible'' in C but are distinctly different types in \Cpp{}. \rationale @@ -2147,7 +2147,7 @@ \diffref{dcl.stc} \change -In \Cpp{}, the \tcode{static} or \tcode{extern} specifiers can only be applied to names of objects or functions.\\ +In \Cpp{}, the \keyword{static} or \keyword{extern} specifiers can only be applied to names of objects or functions.\\ Using these specifiers with type declarations is illegal in \Cpp{}. In C, these specifiers are ignored when used on type declarations. @@ -2161,7 +2161,7 @@ \rationale Storage class specifiers don't have any meaning when associated with a type. -In \Cpp{}, class members can be declared with the \tcode{static} storage +In \Cpp{}, class members can be declared with the \keyword{static} storage class specifier. Allowing storage class specifiers on type declarations could render the code confusing for users. @@ -2174,7 +2174,7 @@ \diffref{dcl.stc} \change -In \Cpp{}, \tcode{register} is not a storage class specifier. +In \Cpp{}, \keyword{register} is not a storage class specifier. \rationale The storage class specifier had no effect in \Cpp{}. \effect @@ -2200,7 +2200,7 @@ \rationale For ease of use, \Cpp{} doesn't require that a type name be prefixed -with the keywords \tcode{class}, \tcode{struct} or \tcode{union} when used in object +with the keywords \keyword{class}, \keyword{struct} or \keyword{union} when used in object declarations or type casts. Example: @@ -2270,7 +2270,7 @@ \diffref{dcl.spec.auto} \change -The keyword \tcode{auto} cannot be used as a storage class specifier. +The keyword \keyword{auto} cannot be used as a storage class specifier. \begin{codeblock} void f() { @@ -2279,9 +2279,9 @@ \end{codeblock} \rationale -Allowing the use of \tcode{auto} to deduce the type +Allowing the use of \keyword{auto} to deduce the type of a variable from its initializer results in undesired interpretations of -\tcode{auto} as a storage class specifier in certain contexts. +\keyword{auto} as a storage class specifier in certain contexts. \effect Deletion of semantically well-defined feature. \difficulty @@ -2487,7 +2487,7 @@ can be attributed to the new \Cpp{} name space definition where a name can be declared as a type and as a non-type in a single scope causing the non-type name to hide the type name and requiring that -the keywords \tcode{class}, \tcode{struct}, \tcode{union} or \tcode{enum} be used to refer to the type name. +the keywords \keyword{class}, \keyword{struct}, \keyword{union} or \keyword{enum} be used to refer to the type name. This new name space definition provides important notational conveniences to \Cpp{} programmers and helps making the use of the user-defined types as similar as possible to the use of fundamental @@ -2525,7 +2525,7 @@ Several alternatives were debated at length. Changing the parameter to \tcode{volatile} -\tcode{const} +\keyword{const} \tcode{X\&} would greatly complicate the generation of efficient code for class objects. @@ -2546,7 +2546,7 @@ be provided. If non-volatile semantics are required, an explicit -\tcode{const_cast} +\keyword{const_cast} can be used. \howwide Seldom. @@ -2689,9 +2689,9 @@ \rSec3[diff.char16]{Types \tcode{char16_t} and \tcode{char32_t}} \pnum -The types \tcode{char16_t} and \tcode{char32_t} +The types \keyword{char16_t} and \keyword{char32_t} are distinct types rather than typedefs to existing integral types. -The tokens \tcode{char16_t} and \tcode{char32_t} +The tokens \keyword{char16_t} and \keyword{char32_t} are keywords in \Cpp{}\iref{lex.key}. They do not appear as macro or type names defined in \libheaderref{cuchar}. @@ -2699,9 +2699,9 @@ \rSec3[diff.wchar.t]{Type \tcode{wchar_t}} \pnum -The type \tcode{wchar_t} is a distinct type rather than a typedef to an +The type \keyword{wchar_t} is a distinct type rather than a typedef to an existing integral type. -The token \tcode{wchar_t} +The token \keyword{wchar_t} is a keyword in \Cpp{}\iref{lex.key}. It does not appear as a macro or type name defined in any of \libheaderref{cstddef}, @@ -2712,7 +2712,7 @@ \indexhdr{assert.h}% \pnum -The token \tcode{static_assert} is a keyword in \Cpp{}. +The token \keyword{static_assert} is a keyword in \Cpp{}. It does not appear as a macro name defined in \libheaderref{cassert}. diff --git a/source/concepts.tex b/source/concepts.tex index cfeae673ff..a9f98714f1 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -549,7 +549,7 @@ \item \tcode{lhs} is equal to \tcode{rcopy}, unless \tcode{rhs} is a non-const xvalue that refers to \tcode{lcopy}. -\item If \tcode{rhs} is a non-\tcode{const} xvalue, the resulting state of the +\item If \tcode{rhs} is a non-\keyword{const} xvalue, the resulting state of the object to which it refers is valid but unspecified\iref{lib.types.movedfrom}. \item Otherwise, if \tcode{rhs} is a glvalue, the object to which it refers is @@ -662,7 +662,7 @@ \begin{note} Whenever \tcode{ranges::swap(E1, E2)} is a valid expression, it exchanges the values denoted by -\tcode{E1} and \tcode{E2} and has type \tcode{void}. +\tcode{E1} and \tcode{E2} and has type \keyword{void}. \end{note} \begin{itemdecl} @@ -808,7 +808,7 @@ \item \tcode{T(rv)} is equal to \tcode{u2}. -\item If \tcode{T} is not \tcode{const}, \tcode{rv}'s resulting state is valid +\item If \tcode{T} is not \keyword{const}, \tcode{rv}'s resulting state is valid but unspecified\iref{lib.types.movedfrom}; otherwise, it is unchanged. \end{itemize} \end{itemdescr} @@ -827,7 +827,7 @@ \begin{itemdescr} \pnum If \tcode{T} is an object type, then let \tcode{v} be an lvalue of type -(possibly \tcode{const}) \tcode{T} or an rvalue of type \tcode{const T}. +(possibly \keyword{const}) \tcode{T} or an rvalue of type \tcode{const T}. \tcode{T} models \libconcept{copy_constructible} only if \begin{itemize} diff --git a/source/containers.tex b/source/containers.tex index f5650449e0..f7a0a65be6 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -193,7 +193,7 @@ linear \\ \rowsep \tcode{a.\~X()} & - \tcode{void} & + \keyword{void} & & \effects destroys every element of \tcode{a}; any memory obtained is deallocated. & linear \\ \rowsep @@ -243,13 +243,13 @@ linear \\ \rowsep \tcode{a.swap(b)} & - \tcode{void} & + \keyword{void} & & \effects exchanges the contents of \tcode{a} and \tcode{b} & (Note A) \\ \rowsep \tcode{swap(a, b)} & - \tcode{void} & + \keyword{void} & Equivalent to \tcode{a.swap(b)} & & (Note A) \\ \rowsep @@ -538,7 +538,7 @@ and an \tcode{allocator_type} identical to \tcode{allocator_traits::rebind_alloc} and given an lvalue \tcode{m} of type \tcode{A}, a pointer \tcode{p} of type \tcode{T*}, -an expression \tcode{v} of type (possibly \tcode{const}) \tcode{T}, +an expression \tcode{v} of type (possibly \keyword{const}) \tcode{T}, and an rvalue \tcode{rv} of type \tcode{T}, the following terms are defined. If \tcode{X} is not allocator-aware, the terms below are defined as if \tcode{A} were @@ -732,7 +732,7 @@ linear \\ \rowsep \tcode{a.swap(b)} & - \tcode{void} & + \keyword{void} & \effects exchanges the contents of \tcode{a} and \tcode{b} & constant \\ \rowsep @@ -760,7 +760,7 @@ \pnum For purposes of avoiding data races\iref{res.on.data.races}, implementations shall -consider the following functions to be \tcode{const}: \tcode{begin}, \tcode{end}, +consider the following functions to be \keyword{const}: \tcode{begin}, \tcode{end}, \tcode{rbegin}, \tcode{rend}, \tcode{front}, \tcode{back}, \tcode{data}, \tcode{find}, \tcode{lower_bound}, \tcode{upper_bound}, \tcode{equal_range}, \tcode{at} and, except in associative or unordered associative containers, \tcode{operator[]}. @@ -961,14 +961,14 @@ \effects\ Erases the elements in the range \tcode{[q1, q2)}. \\ \rowsep \tcode{a.clear()} & - \tcode{void} & + \keyword{void} & \effects Destroys all elements in \tcode{a}. Invalidates all references, pointers, and iterators referring to the elements of \tcode{a} and may invalidate the past-the-end iterator.\br \ensures \tcode{a.empty()} is \tcode{true}.\br \complexity Linear. \\ \rowsep \tcode{a.assign(i,j)} & - \tcode{void} & + \keyword{void} & \expects \tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i} and assignable from \tcode{*i}. For \tcode{vector}, if the iterator does not meet the forward iterator requirements\iref{forward.iterators}, \tcode{T} @@ -984,11 +984,11 @@ Each iterator in the range \range{i}{j} shall be dereferenced exactly once. \\ \rowsep \tcode{a.assign(il)} & - \tcode{void} & + \keyword{void} & \tcode{a.assign(il.begin(), il.end())}. \\ \rowsep \tcode{a.assign(n,t)} & - \tcode{void} & + \keyword{void} & \expects \tcode{T} is \oldconcept{CopyInsertable} into \tcode{X} and \oldconcept{CopyAssignable}. @@ -1151,7 +1151,7 @@ \\ \rowsep \tcode{a.push_front(t)} & - \tcode{void} & + \keyword{void} & \effects Prepends a copy of \tcode{t}.\br \expects \tcode{T} is \oldconcept{CopyInsertable} into \tcode{X}. @@ -1162,7 +1162,7 @@ \\ \rowsep \tcode{a.push_front(rv)} & - \tcode{void} & + \keyword{void} & \effects Prepends a copy of \tcode{rv}.\br \expects \tcode{T} is \oldconcept{MoveInsertable} into \tcode{X}. @@ -1173,7 +1173,7 @@ \\ \rowsep \tcode{a.push_back(t)} & - \tcode{void} & + \keyword{void} & \effects Appends a copy of \tcode{t}.\br \expects \tcode{T} is \oldconcept{CopyInsertable} into \tcode{X}. @@ -1185,7 +1185,7 @@ \\ \rowsep \tcode{a.push_back(rv)} & - \tcode{void} & + \keyword{void} & \effects Appends a copy of \tcode{rv}.\br \expects \tcode{T} is \oldconcept{MoveInsertable} into \tcode{X}. @@ -1197,7 +1197,7 @@ \\ \rowsep \tcode{a.pop_front()} & - \tcode{void} & + \keyword{void} & \effects Destroys the first element.\br \expects \tcode{a.empty()} is \tcode{false}. & \tcode{deque}, @@ -1206,7 +1206,7 @@ \\ \rowsep \tcode{a.pop_back()} & - \tcode{void} & + \keyword{void} & \effects Destroys the last element.\br \expects \tcode{a.empty()} is \tcode{false}. & \tcode{basic_string}, @@ -1352,7 +1352,7 @@ \effects Constructs a \exposid{node-handle} object initializing \tcode{ptr_} with \tcode{nh.ptr_}. Move constructs \tcode{alloc_} with -\tcode{nh.alloc_}. Assigns \tcode{nullptr} to \tcode{nh.ptr_} and assigns +\tcode{nh.alloc_}. Assigns \keyword{nullptr} to \tcode{nh.ptr_} and assigns \tcode{nullopt} to \tcode{nh.alloc_}. \end{itemdescr} @@ -1383,7 +1383,7 @@ move assigns \tcode{nh.alloc_} to \tcode{alloc_}. \item Assigns -\tcode{nullptr} to \tcode{nh.ptr_} and assigns \tcode{nullopt} to +\keyword{nullptr} to \tcode{nh.ptr_} and assigns \tcode{nullopt} to \tcode{nh.alloc_}. \end{itemize} @@ -1670,7 +1670,7 @@ \tcode{a2} denotes a value of a type with nodes compatible with type \tcode{X} (\tref{container.node.compat}), \item -\tcode{b} denotes a possibly \tcode{const} value of type \tcode{X}, +\tcode{b} denotes a possibly \keyword{const} value of type \tcode{X}, \item \tcode{u} denotes the name of a variable being declared, \item @@ -1680,7 +1680,7 @@ \tcode{a_eq} denotes a value of type \tcode{X} when \tcode{X} supports multiple keys, \item -\tcode{a_tran} denotes a possibly \tcode{const} value of type \tcode{X} +\tcode{a_tran} denotes a possibly \keyword{const} value of type \tcode{X} when the \grammarterm{qualified-id} \tcode{X::key_compare::is_transpa\-rent} is valid and denotes a type\iref{temp.deduct}, @@ -1706,7 +1706,7 @@ \item \tcode{k} denotes a value of type \tcode{X::key_type}, and \item -\tcode{c} denotes a possibly \tcode{const} value of type \tcode{X::key_compare}; +\tcode{c} denotes a possibly \keyword{const} value of type \tcode{X::key_compare}; \item \tcode{kl} is a value such that \tcode{a} is partitioned\iref{alg.sorting} with respect to \tcode{c(r, kl)}, with \tcode{r} the key value of \tcode{e} @@ -1935,7 +1935,7 @@ is inserted right before \tcode{p}. \\ \rowsep \tcode{a.\brk{}insert(\brk{}i, j)} & - \tcode{void} & + \keyword{void} & \expects \tcode{value_type} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}. Neither \tcode{i} nor \tcode{j} are iterators into \tcode{a}.\br \effects Inserts each element from the range \range{i}{j} if and only if there @@ -1944,7 +1944,7 @@ $N \log (\tcode{a.size()} + N)$, where $N$ has the value \tcode{distance(i, j)} \\ \rowsep \tcode{a.\brk{}insert(\brk{}il)} & - \tcode{void} & + \keyword{void} & \effects Equivalent to \tcode{a.insert(il.begin(), il.end())} & \\ \rowsep @@ -2008,7 +2008,7 @@ \indexordmem{merge}% \tcode{a.merge(a2)} & - \tcode{void} & + \keyword{void} & \expects \tcode{a.get_allocator() == a2.get_allocator()}.\br \effects Attempts to extract each element in \tcode{a2} and insert it into \tcode{a} using the comparison object of \tcode{a}. In containers with unique keys, @@ -2056,7 +2056,7 @@ \indexordmem{clear}% \tcode{a.clear()} & - \tcode{void} & + \keyword{void} & \effects Equivalent to \tcode{a.erase(a.begin(), a.end())}.\br \ensures \tcode{a.empty()} is \tcode{true}. & linear in \tcode{a.size()}. \\ \rowsep @@ -2747,7 +2747,7 @@ \\ \rowsep % \tcode{a.insert(i, j)} -& \tcode{void} +& \keyword{void} & \expects \tcode{value_type} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}. Neither \tcode{i} nor \tcode{j} are iterators into \tcode{a}.\br \effects Equivalent to \tcode{a.insert(t)} for each element in \tcode{[i,j)}.% @@ -2756,7 +2756,7 @@ \\ \rowsep % \tcode{a.insert(il)} -& \tcode{void} +& \keyword{void} & Same as \tcode{a.insert(il.begin(), il.end())}. & Same as \tcode{a.insert(} \tcode{il.begin(),} \tcode{il.end())}. \\ \rowsep @@ -2820,7 +2820,7 @@ % \indexunordmem{merge}% \tcode{a.merge(a2)} & - \tcode{void} & + \keyword{void} & \expects \tcode{a.get_allocator() == a2.get_allocator()}.\br Attempts to extract each element in \tcode{a2} and insert it into \tcode{a} using the hash function and key equality predicate of \tcode{a}. @@ -2869,7 +2869,7 @@ % \indexunordmem{clear}% \tcode{a.clear()} -& \tcode{void} +& \keyword{void} & \effects Erases all elements in the container.\br \ensures \tcode{a.empty()} is \tcode{true}% & Linear in \tcode{a.size()}. @@ -3034,7 +3034,7 @@ \\ \rowsep % \tcode{a.max_load_factor(z)} -& \tcode{void} +& \keyword{void} & \expects \tcode{z} is positive. May change the container's maximum load factor, using \tcode{z} as a hint.% & Constant @@ -3042,7 +3042,7 @@ % \indexunordmem{rehash}% \tcode{a.rehash(n)} -& \tcode{void} +& \keyword{void} & \ensures \tcode{a.bucket_count() >= a.size() / a.max_load_factor()} and \tcode{a.bucket_count() >= n}.% & Average case linear in \tcode{a.size()}, worst case quadratic. @@ -3050,7 +3050,7 @@ \indexunordmem{reserve}% \tcode{a.reserve(n)} & - \tcode{void} & + \keyword{void} & Same as \tcode{a.rehash(ceil(n /} \tcode{a.max_load_factor()))}. & Average case linear in \tcode{a.size()}, worst case quadratic. \\ @@ -10978,7 +10978,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} extent != dynamic_extent && OtherExtent == dynamic_extent \end{codeblock} diff --git a/source/declarations.tex b/source/declarations.tex index 88e98b2ec9..31ef69fc3a 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -174,7 +174,7 @@ a \defn{structured binding declaration}\iref{dcl.struct.bind}. If the \grammarterm{decl-specifier-seq} contains any \grammarterm{decl-specifier} other than -\tcode{static}, \tcode{thread_local}, \tcode{auto}\iref{dcl.spec.auto}, or +\keyword{static}, \keyword{thread_local}, \keyword{auto}\iref{dcl.spec.auto}, or \grammarterm{cv-qualifier}{s}, the program is ill-formed. The \grammarterm{initializer} shall be @@ -186,7 +186,7 @@ \grammarterm{assignment-expression} is of array or non-union class type. \pnum -If the \grammarterm{decl-specifier-seq} contains the \tcode{typedef} +If the \grammarterm{decl-specifier-seq} contains the \keyword{typedef} specifier, the declaration is called a \defnx{typedef declaration}{declaration!typedef} and each \grammarterm{declarator-id} is declared to be a \grammarterm{typedef-name}, synonymous with its @@ -196,7 +196,7 @@ (\ref{class.conv.fct}). \end{note} If the -\grammarterm{decl-specifier-seq} contains no \tcode{typedef} specifier, the +\grammarterm{decl-specifier-seq} contains no \keyword{typedef} specifier, the declaration is called a \defnx{function declaration}{declaration!function} if the type associated with a \grammarterm{declarator-id} is a function type\iref{dcl.fct} and an \defnx{object declaration}{declaration!object} otherwise. @@ -206,7 +206,7 @@ Syntactic components beyond those found in the general form of \grammarterm{simple-declaration} are added to a function declaration to make a \grammarterm{function-definition}. An object declaration, however, is also -a definition unless it contains the \tcode{extern} specifier and has no +a definition unless it contains the \keyword{extern} specifier and has no initializer\iref{basic.def}. \indextext{initialization!definition and}% An object definition causes storage of appropriate size and alignment to be reserved and @@ -303,10 +303,10 @@ typedef char* Pc; static Pc; // error: name missing \end{codeblock} -Here, the declaration \tcode{static} \tcode{Pc} is ill-formed because no +Here, the declaration \keyword{static} \tcode{Pc} is ill-formed because no name was specified for the static variable of type \tcode{Pc}. To get a variable called \tcode{Pc}, a \grammarterm{type-specifier} (other than -\tcode{const} or \tcode{volatile}) has to be present to indicate that +\keyword{const} or \tcode{volatile}) has to be present to indicate that the \grammarterm{typedef-name} \tcode{Pc} is the name being (re)declared, rather than being part of the \grammarterm{decl-specifier} sequence. For another example, @@ -352,8 +352,8 @@ \end{bnf} At most one \grammarterm{storage-class-specifier} shall appear in a given -\grammarterm{decl-specifier-seq}, except that \tcode{thread_local} may appear with \tcode{static} or -\tcode{extern}. If \tcode{thread_local} appears in any declaration of +\grammarterm{decl-specifier-seq}, except that \keyword{thread_local} may appear with \keyword{static} or +\keyword{extern}. If \keyword{thread_local} appears in any declaration of a variable it shall be present in all declarations of that entity. If a \grammarterm{storage-class-specifier} appears in a \grammarterm{decl-specifier-seq}, there can be no @@ -377,47 +377,47 @@ \end{note} \pnum -The \tcode{thread_local} specifier +The \keyword{thread_local} specifier indicates that the named entity has thread storage duration\iref{basic.stc.thread}. It shall be applied only to the declaration of a variable of namespace or block scope, to a structured binding declaration\iref{dcl.struct.bind}, or to the declaration of a static data member. -When \tcode{thread_local} is applied to a variable of block scope the -\grammarterm{storage-class-specifier} \tcode{static} is implied if no other +When \keyword{thread_local} is applied to a variable of block scope the +\grammarterm{storage-class-specifier} \keyword{static} is implied if no other \grammarterm{storage-class-specifier} appears in the \grammarterm{decl-specifier-seq}. \pnum \indextext{restriction!\idxcode{static}}% -The \tcode{static} specifier shall be applied only +The \keyword{static} specifier shall be applied only to the declaration of a variable or function, to a structured binding declaration\iref{dcl.struct.bind}, or to the declaration of an anonymous union\iref{class.union.anon}. There can be no -\tcode{static} function declarations within a block, nor any -\tcode{static} function parameters. A \tcode{static} specifier used in +\keyword{static} function declarations within a block, nor any +\keyword{static} function parameters. A \tcode{static} specifier used in the declaration of a variable declares the variable to have static storage duration\iref{basic.stc.static}, unless accompanied by the -\tcode{thread_local} specifier, which declares the variable to have thread -storage duration\iref{basic.stc.thread}. A \tcode{static} specifier can be +\keyword{thread_local} specifier, which declares the variable to have thread +storage duration\iref{basic.stc.thread}. A \keyword{static} specifier can be used in declarations of class members;~\ref{class.static} describes its effect. \indextext{\idxcode{static}!linkage of}% -For the linkage of a name declared with a \tcode{static} specifier, +For the linkage of a name declared with a \keyword{static} specifier, see~\ref{basic.link}. \pnum \indextext{restriction!\idxcode{extern}}% -The \tcode{extern} specifier shall be applied only to the declaration of a variable -or function. The \tcode{extern} specifier shall not be used in the +The \keyword{extern} specifier shall be applied only to the declaration of a variable +or function. The \keyword{extern} specifier shall not be used in the declaration of a class member or function parameter. \indextext{\idxcode{extern}!linkage of}% \indextext{consistency!linkage}% -For the linkage of a name declared with an \tcode{extern} specifier, +For the linkage of a name declared with an \keyword{extern} specifier, see~\ref{basic.link}. \begin{note} -The \tcode{extern} keyword can also be used in +The \keyword{extern} keyword can also be used in \grammarterm{explicit-instantiation}{s} and \grammarterm{linkage-specification}{s}, but it is not a \grammarterm{storage-class-specifier} in such contexts. @@ -468,7 +468,7 @@ \pnum \indextext{declaration!forward}% The name of a declared but undefined class can be used in an -\tcode{extern} declaration. Such a declaration can only be used in ways +\keyword{extern} declaration. Such a declaration can only be used in ways that do not require a complete class type. \begin{example} \begin{codeblock} @@ -485,7 +485,7 @@ \end{example} \pnum -The \tcode{mutable} specifier shall appear only in the declaration of +The \keyword{mutable} specifier shall appear only in the declaration of a non-static data member\iref{class.mem} whose type is neither const-qualified nor a reference type. \begin{example} @@ -499,8 +499,8 @@ \pnum \begin{note} -The \tcode{mutable} specifier on a class data member nullifies a -\tcode{const} specifier applied to the containing class object and +The \keyword{mutable} specifier on a class data member nullifies a +\keyword{const} specifier applied to the containing class object and permits modification of the mutable class member even though the rest of the object is const~(\ref{basic.type.qualifier}, \ref{dcl.type.cv}). \end{note} @@ -544,29 +544,29 @@ In an \grammarterm{explicit-specifier}, the \grammarterm{constant-expression}, if supplied, shall be a contextually converted constant expression of type \tcode{bool}\iref{expr.const}. -The \grammarterm{explicit-specifier} \tcode{explicit} +The \grammarterm{explicit-specifier} \keyword{explicit} without a \grammarterm{constant-expression} is equivalent to the \grammarterm{explicit-specifier} \tcode{explicit(true)}. If the constant expression evaluates to \tcode{true}, the function is explicit. Otherwise, the function is not explicit. -A \tcode{(} token that follows \tcode{explicit} is parsed as +A \tcode{(} token that follows \keyword{explicit} is parsed as part of the \grammarterm{explicit-specifier}. \rSec2[dcl.typedef]{The \tcode{typedef} specifier}% \indextext{specifier!\idxcode{typedef}} \pnum -Declarations containing the \grammarterm{decl-specifier} \tcode{typedef} +Declarations containing the \grammarterm{decl-specifier} \keyword{typedef} declare identifiers that can be used later for naming fundamental\iref{basic.fundamental} or compound\iref{basic.compound} -types. The \tcode{typedef} specifier shall not be +types. The \keyword{typedef} specifier shall not be combined in a \grammarterm{decl-specifier-seq} with any other kind of specifier except a \grammarterm{defining-type-specifier}, and it shall not be used in the \grammarterm{decl-specifier-seq} of a \grammarterm{parameter-declaration}\iref{dcl.fct} nor in the \grammarterm{decl-specifier-seq} of a \grammarterm{function-definition}\iref{dcl.fct.def}. -If a \tcode{typedef} specifier appears in a declaration without a \grammarterm{declarator}, +If a \keyword{typedef} specifier appears in a declaration without a \grammarterm{declarator}, the program is ill-formed. \begin{bnf} @@ -575,7 +575,7 @@ simple-template-id \end{bnf} -A name declared with the \tcode{typedef} specifier becomes a +A name declared with the \keyword{typedef} specifier becomes a \grammarterm{typedef-name}. A \grammarterm{typedef-name} names the type associated with the \grammarterm{identifier}\iref{dcl.decl} @@ -607,7 +607,7 @@ and the optional \grammarterm{attribute-specifier-seq} following the \grammarterm{identifier} appertains to that \grammarterm{typedef-name}. Such a \grammarterm{typedef-name} has the same -semantics as if it were introduced by the \tcode{typedef} specifier. In +semantics as if it were introduced by the \keyword{typedef} specifier. In particular, it does not define a new type. \begin{example} \begin{codeblock} @@ -693,7 +693,7 @@ \indextext{specifier!\idxcode{friend}} \pnum -The \tcode{friend} specifier is used to specify access to class members; +The \keyword{friend} specifier is used to specify access to class members; see~\ref{class.friend}. \rSec2[dcl.constexpr]{The \tcode{constexpr} and \tcode{consteval} specifiers}% @@ -701,23 +701,23 @@ \indextext{specifier!\idxcode{consteval}} \pnum -The \tcode{constexpr} specifier shall be applied only to +The \keyword{constexpr} specifier shall be applied only to the definition of a variable or variable template or the declaration of a function or function template. -The \tcode{consteval} specifier shall be applied only to +The \keyword{consteval} specifier shall be applied only to the declaration of a function or function template. A function or static data member -declared with the \tcode{constexpr} or \tcode{consteval} specifier +declared with the \keyword{constexpr} or \keyword{consteval} specifier is implicitly an inline function or variable\iref{dcl.inline}. If any declaration of a function or function template has -a \tcode{constexpr} or \tcode{consteval} specifier, +a \keyword{constexpr} or \keyword{consteval} specifier, then all its declarations shall contain the same specifier. \begin{note} An explicit specialization can differ from the template declaration -with respect to the \tcode{constexpr} or \tcode{consteval} specifier. +with respect to the \keyword{constexpr} or \keyword{consteval} specifier. \end{note} \begin{note} -Function parameters cannot be declared \tcode{constexpr}. +Function parameters cannot be declared \keyword{constexpr}. \end{note} \begin{example} \begin{codeblock} @@ -732,7 +732,7 @@ : x(a), y(x) // OK: definition { square(x); } constexpr pixel small(2); // error: \tcode{square} not defined, so \tcode{small(2)} - // not constant\iref{expr.const} so \tcode{constexpr} not satisfied + // not constant\iref{expr.const} so \keyword{constexpr} not satisfied constexpr void square(int &x) { // OK: definition x *= x; @@ -746,14 +746,14 @@ \end{example} \pnum -A \tcode{constexpr} or \tcode{consteval} specifier +A \keyword{constexpr} or \keyword{consteval} specifier used in the declaration of a function declares that function to be a \defnx{constexpr function}{specifier!\idxcode{constexpr}!function}. -A function or constructor declared with the \tcode{consteval} specifier +A function or constructor declared with the \keyword{consteval} specifier is called an \defnadj{immediate}{function}. A destructor, an allocation function, or a deallocation function -shall not be declared with the \tcode{consteval} specifier. +shall not be declared with the \keyword{consteval} specifier. \pnum \indextext{specifier!\idxcode{constexpr}!function}% @@ -917,7 +917,7 @@ \end{note} \pnum -The \tcode{constexpr} and \tcode{consteval} specifiers have no +The \keyword{constexpr} and \keyword{consteval} specifiers have no effect on the type of a constexpr function. \begin{example} \begin{codeblock} @@ -930,15 +930,15 @@ \end{example} \pnum -A \tcode{constexpr} specifier used in an object declaration +A \keyword{constexpr} specifier used in an object declaration declares the object as const. Such an object shall have literal type and shall be initialized. -In any \tcode{constexpr} variable declaration, +In any \keyword{constexpr} variable declaration, the full-expression of the initialization shall be a constant expression\iref{expr.const}. -A \tcode{constexpr} variable shall have constant destruction. +A \keyword{constexpr} variable shall have constant destruction. \begin{example} \begin{codeblock} struct pixel { @@ -982,14 +982,14 @@ \indextext{specifier!\idxcode{inline}} \pnum -The \tcode{inline} specifier shall be applied only to the declaration +The \keyword{inline} specifier shall be applied only to the declaration of a variable or function. \pnum \indextext{specifier!\idxcode{inline}}% \indextext{inline function}% A function declaration~(\ref{dcl.fct}, \ref{class.mfct}, -\ref{class.friend}) with an \tcode{inline} specifier declares an +\ref{class.friend}) with an \keyword{inline} specifier declares an \defnadj{inline}{function}. The inline specifier indicates to the implementation that inline substitution of the function body at the point of call is to be preferred to the usual function call mechanism. @@ -998,19 +998,19 @@ the other rules for inline functions specified in this subclause shall still be respected. \begin{note} -The \tcode{inline} keyword has no effect on the linkage of a function. +The \keyword{inline} keyword has no effect on the linkage of a function. In certain cases, an inline function cannot use names with internal linkage; see~\ref{basic.link}. \end{note} \pnum -A variable declaration with an \tcode{inline} specifier declares an +A variable declaration with an \keyword{inline} specifier declares an \defnadj{inline}{variable}. \pnum -The \tcode{inline} specifier shall not appear on a block scope declaration or +The \keyword{inline} specifier shall not appear on a block scope declaration or on the declaration of a function parameter. -If the \tcode{inline} specifier is used in a friend function declaration, that +If the \keyword{inline} specifier is used in a friend function declaration, that declaration shall be a definition or the function shall have previously been declared inline. @@ -1034,7 +1034,7 @@ with external or module linkage can be defined in multiple translation units\iref{basic.def.odr}, but is one entity with one address. -A type or \tcode{static} variable +A type or \keyword{static} variable defined in the body of such a function is therefore a single entity. \end{note} @@ -1106,7 +1106,7 @@ \grammarterm{type-specifier-seq}. The only exceptions to this rule are the following: \begin{itemize} -\item \tcode{const} can be combined with any type specifier except itself. +\item \keyword{const} can be combined with any type specifier except itself. \item \tcode{volatile} can be combined with any type specifier except itself. @@ -1156,7 +1156,7 @@ \indextext{type specifier!\idxcode{volatile}} \pnum -There are two \grammarterm{cv-qualifier}{s}, \tcode{const} and +There are two \grammarterm{cv-qualifier}{s}, \keyword{const} and \tcode{volatile}. Each \grammarterm{cv-qualifier} shall appear at most once in a \grammarterm{cv-qualifier-seq}. If a \grammarterm{cv-qualifier} appears in a \grammarterm{decl-specifier-seq}, the \grammarterm{init-declarator-list} @@ -1174,7 +1174,7 @@ \pnum \begin{note} -Declaring a variable \tcode{const} can affect its linkage\iref{dcl.stc} +Declaring a variable \keyword{const} can affect its linkage\iref{dcl.stc} and its usability in constant expressions\iref{expr.const}. As described in~\ref{dcl.init}, the definition of an object or subobject of const-qualified type must specify an initializer or be subject to @@ -1201,12 +1201,12 @@ \begin{example} \begin{codeblock} const int ci = 3; // cv-qualified (initialized as required) -ci = 4; // error: attempt to modify \tcode{const} +ci = 4; // error: attempt to modify \keyword{const} int i = 2; // not cv-qualified const int* cip; // pointer to \tcode{const int} cip = &i; // OK: cv-qualified access path to unqualified -*cip = 4; // error: attempt to modify through ptr to \tcode{const} +*cip = 4; // error: attempt to modify through ptr to \keyword{const} int* ip; ip = const_cast(cip); // cast needed to convert \tcode{const int*} to \tcode{int*} @@ -1228,10 +1228,10 @@ }; const Y y; -y.x.i++; // well-formed: \tcode{mutable} member can be modified +y.x.i++; // well-formed: \keyword{mutable} member can be modified y.x.j++; // error: const-qualified member modified Y* p = const_cast(&y); // cast away const-ness of \tcode{y} -p->x.i = 99; // well-formed: \tcode{mutable} member can be modified +p->x.i = 99; // well-formed: \keyword{mutable} member can be modified p->x.j = 99; // undefined behavior: modifies a const subobject \end{codeblock} \end{example} @@ -1325,7 +1325,7 @@ a type to be deduced\iref{dcl.spec.auto}. \indextext{deduction!class template arguments}% A \grammarterm{type-specifier} of the form -\opt{\tcode{typename}} \opt{\grammarterm{nested-name-specifier}} \grammarterm{template-name} +\opt{\keyword{typename}} \opt{\grammarterm{nested-name-specifier}} \grammarterm{template-name} is a placeholder for a deduced class type\iref{dcl.type.class.deduct}. The \grammarterm{nested-name-specifier}, if any, shall be non-dependent and @@ -1369,9 +1369,9 @@ \tcode{char} & ``\tcode{char}'' \\ \tcode{unsigned char} & ``\tcode{unsigned char}'' \\ \tcode{signed char} & ``\tcode{signed char}'' \\ -\tcode{char8_t} & ``\tcode{char8_t}'' \\ -\tcode{char16_t} & ``\tcode{char16_t}'' \\ -\tcode{char32_t} & ``\tcode{char32_t}'' \\ +\keyword{char8_t} & ``\tcode{char8_t}'' \\ +\keyword{char16_t} & ``\tcode{char16_t}'' \\ +\keyword{char32_t} & ``\tcode{char32_t}'' \\ \tcode{bool} & ``\tcode{bool}'' \\ \tcode{unsigned} & ``\tcode{unsigned int}'' \\ \tcode{unsigned int} & ``\tcode{unsigned int}'' \\ @@ -1396,11 +1396,11 @@ \tcode{signed short} & ``\tcode{short int}'' \\ \tcode{short int} & ``\tcode{short int}'' \\ \tcode{short} & ``\tcode{short int}'' \\ -\tcode{wchar_t} & ``\tcode{wchar_t}'' \\ +\keyword{wchar_t} & ``\tcode{wchar_t}'' \\ \tcode{float} & ``\tcode{float}'' \\ \tcode{double} & ``\tcode{double}'' \\ \tcode{long double} & ``\tcode{long double}'' \\ -\tcode{void} & ``\tcode{void}'' \\ +\keyword{void} & ``\tcode{void}'' \\ \end{simpletypetable} \pnum @@ -1514,7 +1514,7 @@ \end{note} \pnum -The \grammarterm{class-key} or \tcode{enum} keyword +The \grammarterm{class-key} or \keyword{enum} keyword present in the \grammarterm{elaborated-type-specifier} shall agree in kind with the declaration to which the name in the @@ -1522,11 +1522,11 @@ the form of \grammarterm{elaborated-type-specifier} that declares a \grammarterm{class-name} or friend class since it can be construed as referring to the definition of the class. Thus, in any -\grammarterm{elaborated-type-specifier}, the \tcode{enum} keyword +\grammarterm{elaborated-type-specifier}, the \keyword{enum} keyword shall be -used to refer to an enumeration\iref{dcl.enum}, the \tcode{union} +used to refer to an enumeration\iref{dcl.enum}, the \keyword{union} \grammarterm{class-key} shall be used to refer to a union\iref{class.union}, -and either the \tcode{class} or \tcode{struct} +and either the \keyword{class} or \keyword{struct} \grammarterm{class-key} shall be used to refer to a non-union class\iref{class.pre}. \begin{example} \begin{codeblock} @@ -1577,7 +1577,7 @@ \item otherwise, \tcode{decltype($E$)} is the type of $E$. \end{itemize} -The operand of the \tcode{decltype} specifier is an unevaluated +The operand of the \keyword{decltype} specifier is an unevaluated operand\iref{expr.prop}. \begin{example} @@ -1666,12 +1666,12 @@ \pnum A \grammarterm{placeholder-type-specifier} of the form -\opt{\grammarterm{type-constraint}} \tcode{auto} +\opt{\grammarterm{type-constraint}} \keyword{auto} can be used as a \grammarterm{decl-specifier} of the \grammarterm{decl-specifier-seq} of a \grammarterm{parameter-declaration} of a function declaration or \grammarterm{lambda-expression} and, -if it is not the \tcode{auto} \grammarterm{type-specifier} +if it is not the \keyword{auto} \grammarterm{type-specifier} introducing a \grammarterm{trailing-return-type} (see below), is a \defn{generic parameter type placeholder} of the function declaration or \grammarterm{lambda-expression}. @@ -1716,13 +1716,13 @@ auto x = 5; // OK: \tcode{x} has type \tcode{int} const auto *v = &x, u = 6; // OK: \tcode{v} has type \tcode{const int*}, \tcode{u} has type \tcode{const int} static auto y = 0.0; // OK: \tcode{y} has type \tcode{double} -auto int r; // error: \tcode{auto} is not a \grammarterm{storage-class-specifier} +auto int r; // error: \keyword{auto} is not a \grammarterm{storage-class-specifier} auto f() -> int; // OK: \tcode{f} returns \tcode{int} auto g() { return 0.0; } // OK: \tcode{g} returns \tcode{double} auto h(); // OK: \tcode{h}'s return type will be deduced when it is defined \end{codeblock} \end{example} -The \tcode{auto} \grammarterm{type-specifier} +The \keyword{auto} \grammarterm{type-specifier} can also be used to introduce a structured binding declaration\iref{dcl.struct.bind}. @@ -1750,8 +1750,8 @@ \begin{example} \begin{codeblock} -auto x = 5, *y = &x; // OK: \tcode{auto} is \tcode{int} -auto a = 5, b = { 1, 2 }; // error: different types for \tcode{auto} +auto x = 5, *y = &x; // OK: \keyword{auto} is \tcode{int} +auto a = 5, b = { 1, 2 }; // error: different types for \keyword{auto} \end{codeblock} \end{example} @@ -1768,7 +1768,7 @@ body. \begin{example} \begin{codeblock} -auto f() { } // OK, return type is \tcode{void} +auto f() { } // OK, return type is \keyword{void} auto* g() { } // error: cannot deduce \tcode{auto*} from \tcode{void()} \end{codeblock} \end{example} @@ -1836,8 +1836,8 @@ auto f(); auto f() { return 42; } // return type is \tcode{int} auto f(); // OK -int f(); // error: \tcode{auto} and \tcode{int} don't match -decltype(auto) f(); // error: \tcode{auto} and \tcode{decltype(auto)} don't match +int f(); // error: \keyword{auto} and \tcode{int} don't match +decltype(auto) f(); // error: \keyword{auto} and \tcode{decltype(auto)} don't match template auto g(T t) { return t; } // \#1 template auto g(int); // OK, return type is \tcode{int} @@ -1865,7 +1865,7 @@ \pnum A function declared with a return type that uses a placeholder type shall not -be \tcode{virtual}\iref{class.virtual}. +be \keyword{virtual}\iref{class.virtual}. \pnum A function declared with a return type that uses a placeholder type shall not @@ -1925,10 +1925,10 @@ \end{itemize} In the case of a \tcode{return} statement with no operand -or with an operand of type \tcode{void}, +or with an operand of type \keyword{void}, \tcode{T} shall be either \opt{\grammarterm{type-constraint}} \tcode{decltype(auto)} or -\cv{}~\opt{\grammarterm{type-constraint}} \tcode{auto}. +\cv{}~\opt{\grammarterm{type-constraint}} \keyword{auto}. \pnum If the deduction is for a \tcode{return} statement @@ -1937,13 +1937,13 @@ \pnum If the \grammarterm{placeholder-type-specifier} is of the form -\opt{\grammarterm{type-constraint}} \tcode{auto}, +\opt{\grammarterm{type-constraint}} \keyword{auto}, the deduced type $\mathtt{T}'$ replacing \tcode{T} is determined using the rules for template argument deduction. Obtain \tcode{P} from \tcode{T} by replacing the occurrences of -\opt{\grammarterm{type-constraint}} \tcode{auto} either with +\opt{\grammarterm{type-constraint}} \keyword{auto} either with a new invented type template parameter \tcode{U} or, if the initialization is copy-list-initialization, with \tcode{std::initializer_list}. Deduce a value for \tcode{U} using the rules @@ -1982,7 +1982,7 @@ placeholder alone. The type deduced for \tcode{T} is determined as described in~\ref{dcl.type.decltype}, as though $E$ had -been the operand of the \tcode{decltype}. +been the operand of the \keyword{decltype}. \begin{example} \begin{codeblock} int i; @@ -2149,7 +2149,7 @@ S S; S T; // error \end{codeblock} -Another exception is when \tcode{T} is \tcode{auto}\iref{dcl.spec.auto}, +Another exception is when \tcode{T} is \keyword{auto}\iref{dcl.spec.auto}, for example: \begin{codeblock} auto i = 1, j = 2.0; // error: deduced types for \tcode{i} and \tcode{j} do not match @@ -2263,7 +2263,7 @@ and as an argument of \tcode{sizeof}, \tcode{alignof}, -\tcode{new}, +\keyword{new}, or \tcode{typeid}, the name of a type shall be specified. @@ -2608,14 +2608,14 @@ \pnum A -\tcode{static}, -\tcode{thread_local}, -\tcode{extern}, -\tcode{mutable}, -\tcode{friend}, -\tcode{inline}, -\tcode{virtual}, -\tcode{constexpr}, +\keyword{static}, +\keyword{thread_local}, +\keyword{extern}, +\keyword{mutable}, +\keyword{friend}, +\keyword{inline}, +\keyword{virtual}, +\keyword{constexpr}, or \tcode{typedef} specifier @@ -2784,7 +2784,7 @@ \end{codeblock} Each is unacceptable because it would either change the value of an object declared -\tcode{const} +\keyword{const} or allow it to be changed through a cv-unqualified pointer later, for example: \begin{codeblock} *ppc = &ci; // OK, but would make \tcode{p} point to \tcode{ci} because of previous error @@ -2837,7 +2837,7 @@ \begin{example} \begin{codeblock} typedef int& A; -const A aref = 3; // error: lvalue reference to non-\tcode{const} initialized with rvalue +const A aref = 3; // error: lvalue reference to non-\keyword{const} initialized with rvalue \end{codeblock} The type of @@ -2850,7 +2850,7 @@ \end{note} \indextext{\idxcode{void\&}}% A declarator that specifies the type -``reference to \cv{}~\tcode{void}'' +``reference to \cv{}~\keyword{void}'' is ill-formed. @@ -2941,7 +2941,7 @@ The declaration of a reference shall contain an \grammarterm{initializer}\iref{dcl.init.ref} except when the declaration contains an explicit -\tcode{extern} +\keyword{extern} specifier\iref{dcl.stc}, is a class member\iref{class.mem} declaration within a class definition, or is the declaration of a parameter or a return type\iref{dcl.fct}; see~\ref{basic.def}. @@ -3091,7 +3091,7 @@ of a class\iref{class.static}, a member with reference type, or -``\cv{}~\tcode{void}''. +``\cv{}~\keyword{void}''. \pnum \begin{note} @@ -3147,10 +3147,10 @@ a reference type, a function type, an array of unknown bound, or -\cv{}~\tcode{void}. +\cv{}~\keyword{void}. \begin{note} An array can be constructed -from one of the fundamental types (except \tcode{void}), +from one of the fundamental types (except \keyword{void}), from a pointer, from a pointer to member, from a class, @@ -3332,7 +3332,7 @@ \tcode{D} is ``\placeholder{derived-declarator-type-list} -\opt{\tcode{noexcept}} +\opt{\keyword{noexcept}} function of parameter-type-list \opt{\grammarterm{cv-qualifier-seq}} \opt{\grammarterm{ref-qualifier}} returning \tcode{T}'', where @@ -3341,7 +3341,7 @@ the parameter-type-list is derived from the \grammarterm{parameter-declaration-clause} as described below and \item -the optional \tcode{noexcept} is present if and only if +the optional \keyword{noexcept} is present if and only if the exception specification\iref{except.spec} is non-throwing. \end{itemize} The optional \grammarterm{attribute-specifier-seq} @@ -3365,14 +3365,14 @@ \tcode{D1} is ``\placeholder{derived-declarator-type-list} \tcode{T}'', -\tcode{T} shall be the single \grammarterm{type-specifier} \tcode{auto}. +\tcode{T} shall be the single \grammarterm{type-specifier} \keyword{auto}. The type of the \grammarterm{declarator-id} in \tcode{D} is ``\placeholder{derived-declarator-type-list} -\opt{\tcode{noexcept}} +\opt{\keyword{noexcept}} function of parameter-type-list \opt{\grammarterm{cv-qualifier-seq}} \opt{\grammarterm{ref-qualifier}} returning \tcode{U}'', where @@ -3383,7 +3383,7 @@ \item \tcode{U} is the type specified by the \grammarterm{trailing-return-type}, and \item -the optional \tcode{noexcept} is present if and only if +the optional \keyword{noexcept} is present if and only if the exception specification is non-throwing. \end{itemize} The optional \grammarterm{attribute-specifier-seq} @@ -3437,10 +3437,10 @@ \grammarterm{parameter-declaration-clause} is empty, the function takes no arguments. A parameter list consisting of a single unnamed parameter of -non-dependent type \tcode{void} is equivalent to an empty parameter +non-dependent type \keyword{void} is equivalent to an empty parameter list. \indextext{parameter!\idxcode{void}}% -Except for this special case, a parameter shall not have type \cv{}~\tcode{void}. +Except for this special case, a parameter shall not have type \cv{}~\keyword{void}. A parameter with volatile-qualified type is deprecated; see~\ref{depr.volatile.type}. If the @@ -3473,7 +3473,7 @@ However, the first argument must be of a type that can be converted to a -\tcode{const} +\keyword{const} \tcode{char*}. \end{example} \begin{note} @@ -3605,7 +3605,7 @@ \pnum \indextext{function return type|see{return type}}% \indextext{return type}% -The return type shall be a non-array object type, a reference type, or \cv{}~\tcode{void}. +The return type shall be a non-array object type, a reference type, or \cv{}~\keyword{void}. \pnum A volatile-qualified return type is deprecated; @@ -3727,11 +3727,11 @@ one invented type \grammarterm{template-parameter} for each generic parameter type placeholder of the function declaration, in order of appearance. -For a \grammarterm{placeholder-type-specifier} of the form \tcode{auto}, +For a \grammarterm{placeholder-type-specifier} of the form \keyword{auto}, the invented parameter is an unconstrained \grammarterm{type-parameter}. For a \grammarterm{placeholder-type-specifier} of the form -\grammarterm{type-constraint} \tcode{auto}, +\grammarterm{type-constraint} \keyword{auto}, the invented parameter is a \grammarterm{type-parameter} with that \grammarterm{type-constraint}. The invented type \grammarterm{template-parameter} is @@ -3829,7 +3829,7 @@ of a \grammarterm{parameter-declaration-clause} without a preceding comma. In this case, the ellipsis is parsed as part of the \grammarterm{abstract-declarator} if the type of the parameter either names -a template parameter pack that has not been expanded or contains \tcode{auto}; +a template parameter pack that has not been expanded or contains \keyword{auto}; otherwise, it is parsed as part of the \grammarterm{parameter-declaration-clause}. \begin{footnote} @@ -4042,7 +4042,7 @@ \pnum \begin{note} The keyword -\tcode{this} +\keyword{this} cannot appear in a default argument of a member function; see~\ref{expr.prim.this}. \begin{example} @@ -4223,7 +4223,7 @@ \end{note} \pnum -Except for objects declared with the \tcode{constexpr} specifier, for which see~\ref{dcl.constexpr}, +Except for objects declared with the \keyword{constexpr} specifier, for which see~\ref{dcl.constexpr}, an \grammarterm{initializer} in the definition of a variable can consist of arbitrary expressions involving literals and previously declared variables and functions, @@ -4438,7 +4438,7 @@ \item for an \grammarterm{initializer} that is a parenthesized \grammarterm{expression-list} or a \grammarterm{braced-init-list}, \item for a \grammarterm{new-initializer}\iref{expr.new}, -\item in a \tcode{static_cast} expression\iref{expr.static.cast}, +\item in a \keyword{static_cast} expression\iref{expr.static.cast}, \item in a functional notation type conversion\iref{expr.type.conv}, and \item in the \grammarterm{braced-init-list} form of a \grammarterm{condition} \end{itemize} @@ -4464,11 +4464,11 @@ If the destination type is a reference type, see~\ref{dcl.init.ref}. \item If the destination type is an array of characters, -an array of \tcode{char8_t}, -an array of \tcode{char16_t}, -an array of \tcode{char32_t}, +an array of \keyword{char8_t}, +an array of \keyword{char16_t}, +an array of \keyword{char32_t}, or an array of -\tcode{wchar_t}, +\keyword{wchar_t}, and the initializer is a \grammarterm{string-literal}, see~\ref{dcl.init.string}. \item If the initializer is \tcode{()}, the object is value-initialized. \indextext{ambiguity!function declaration}% @@ -5251,10 +5251,10 @@ \pnum An array of ordinary character type\iref{basic.fundamental}, -\tcode{char8_t} array, -\tcode{char16_t} array, -\tcode{char32_t} array, -or \tcode{wchar_t} array +\keyword{char8_t} array, +\keyword{char16_t} array, +\keyword{char32_t} array, +or \keyword{wchar_t} array can be initialized by an ordinary string literal, UTF-8 string literal, @@ -5340,7 +5340,7 @@ The initializer can be omitted for a reference only in a parameter declaration\iref{dcl.fct}, in the declaration of a function return type, in the declaration of a class member within its class definition\iref{class.mem}, and where the -\tcode{extern} +\keyword{extern} specifier is explicitly used. \indextext{declaration!extern@\tcode{extern} reference}% \begin{example} @@ -5426,9 +5426,9 @@ the program is ill-formed. \begin{example} \begin{codeblock} -double& rd2 = 2.0; // error: not an lvalue and reference not \tcode{const} +double& rd2 = 2.0; // error: not an lvalue and reference not \keyword{const} int i = 2; -double& rd3 = i; // error: type mismatch and reference not \tcode{const} +double& rd3 = i; // error: type mismatch and reference not \keyword{const} \end{codeblock} \end{example} @@ -5994,7 +5994,7 @@ \pnum In a \grammarterm{function-definition}, -either \tcode{void} \grammarterm{declarator} \tcode{;} +either \keyword{void} \grammarterm{declarator} \tcode{;} or \grammarterm{declarator} \tcode{;} shall be a well-formed function declaration as described in~\ref{dcl.fct}. @@ -6042,7 +6042,7 @@ \pnum \begin{note} -A \grammarterm{cv-qualifier-seq} affects the type of \tcode{this} +A \grammarterm{cv-qualifier-seq} affects the type of \keyword{this} in the body of a member function; see~\ref{expr.prim.this}. \end{note} @@ -6134,7 +6134,7 @@ \pnum An explicitly-defaulted function that is not defined as deleted may be declared -\tcode{constexpr} or \tcode{consteval} only +\keyword{constexpr} or \keyword{consteval} only if it is constexpr-compatible (\ref{special}, \ref{class.compare.default}). A function explicitly defaulted on its first declaration is implicitly inline\iref{dcl.inline}, @@ -6144,7 +6144,7 @@ \begin{example} \begin{codeblock} struct S { - constexpr S() = default; // error: implicit \tcode{S()} is not \tcode{constexpr} + constexpr S() = default; // error: implicit \tcode{S()} is not \keyword{constexpr} S(int a = 0) = default; // error: default argument void operator=(const S&) = default; // error: non-matching return type ~S() noexcept(false) = default; // OK, despite mismatched exception specification @@ -6471,12 +6471,12 @@ in the scope of the promise type\iref{class.member.lookup} finds any declarations, then the result of a call to an allocation function used to obtain storage for the coroutine -state is assumed to return \tcode{nullptr} if it fails to obtain storage, +state is assumed to return \keyword{nullptr} if it fails to obtain storage, and if a global allocation function is selected, the \tcode{::operator new(size_t, nothrow_t)} form is used. The allocation function used in this case shall have a non-throwing \grammarterm{noexcept-specifier}. -If the allocation function returns \tcode{nullptr}, the coroutine returns +If the allocation function returns \keyword{nullptr}, the coroutine returns control to the caller of the coroutine and the return value is obtained by a call to \tcode{T::get_return_object_on_allocation_failure()}, where \tcode{T} is the promise type. @@ -6791,7 +6791,7 @@ in that \grammarterm{attribute-specifier-seq} are thereafter considered attributes of the enumeration whenever it is named. A \tcode{:} following -``\tcode{enum} \opt{\grammarterm{nested-name-specifier}} \grammarterm{identifier}'' +``\keyword{enum} \opt{\grammarterm{nested-name-specifier}} \grammarterm{identifier}'' within the \grammarterm{decl-specifier-seq} of a \grammarterm{member-declaration} is parsed as part of an \grammarterm{enum-base}. \begin{note} @@ -6818,7 +6818,7 @@ \pnum \indextext{constant!enumeration}% The enumeration type declared with an \grammarterm{enum-key} -of only \tcode{enum} is an \defnadj{unscoped}{enumeration}, +of only \keyword{enum} is an \defnadj{unscoped}{enumeration}, and its \grammarterm{enumerator}{s} are \defnx{unscoped enumerators}{enumerator!unscoped}. The \grammarterm{enum-key}{s} \tcode{enum class} and \tcode{enum struct} are semantically equivalent; an enumeration @@ -6988,7 +6988,7 @@ color c = 1; // error: type mismatch, no conversion from \tcode{int} to \tcode{color} int i = yellow; // OK: \tcode{yellow} converted to integral value \tcode{1}, integral promotion \end{codeblock} -Note that this implicit \tcode{enum} to \tcode{int} +Note that this implicit \keyword{enum} to \tcode{int} conversion is not provided for a scoped enumeration: \begin{codeblock} enum class Col { red, yellow, green }; @@ -7206,9 +7206,9 @@ \end{example} \pnum -If the optional initial \tcode{inline} keyword appears in a +If the optional initial \keyword{inline} keyword appears in a \grammarterm{namespace-definition} for a particular namespace, that namespace is -declared to be an \defnadj{inline}{namespace}. The \tcode{inline} keyword may be +declared to be an \defnadj{inline}{namespace}. The \keyword{inline} keyword may be used on a \grammarterm{namespace-definition} that extends a namespace only if it was previously used on the \grammarterm{namespace-definition} that initially declared the \grammarterm{namespace-name} for that namespace. @@ -7250,8 +7250,8 @@ \begin{codeblock} namespace E { @\opt{inline}@ namespace I { B } } \end{codeblock} -where the optional \tcode{inline} is present if and only if -the \grammarterm{identifier} \tcode{I} is preceded by \tcode{inline}. +where the optional \keyword{inline} is present if and only if +the \grammarterm{identifier} \tcode{I} is preceded by \keyword{inline}. \begin{example} \begin{codeblock} namespace A::inline B::C { @@ -7282,7 +7282,7 @@ \keyword{namespace} \exposid{unique} \terminal{\{} namespace-body \terminal{\}} \end{ncsimplebnf} where -\tcode{inline} appears if and only if it appears in the +\keyword{inline} appears if and only if it appears in the \grammarterm{unnamed-namespace-definition} and all occurrences of \exposid{unique} in a translation unit are replaced by the same identifier, and this identifier differs from all other @@ -8161,7 +8161,7 @@ A declaration directly contained in a \grammarterm{linkage-specification} is treated as if it contains the -\tcode{extern} +\keyword{extern} specifier\iref{dcl.stc} for the purpose of determining the linkage of the declared name and whether it is a definition. Such a declaration shall not specify a storage class. @@ -8623,10 +8623,10 @@ shall appear at most once in each \grammarterm{attribute-list} and no \grammarterm{attribute-argument-clause} shall be present. A fallthrough statement may only appear within -an enclosing \tcode{switch} statement\iref{stmt.switch}. +an enclosing \keyword{switch} statement\iref{stmt.switch}. The next statement that would be executed after a fallthrough statement shall be a labeled statement whose label is a case label or -default label for the same \tcode{switch} statement and, +default label for the same \keyword{switch} statement and, if the fallthrough statement is contained in an iteration statement, the next statement shall be part of the same execution of the substatement of the innermost enclosing iteration statement. @@ -8833,7 +8833,7 @@ \recommended Appearance of a nodiscard call as a potentially-evaluated discarded-value expression\iref{expr.prop} -is discouraged unless explicitly cast to \tcode{void}. +is discouraged unless explicitly cast to \keyword{void}. Implementations should issue a warning in such cases. \begin{note} This is typically because discarding the return value @@ -8859,7 +8859,7 @@ void launch_missiles(); void test_missiles() { my_scopeguard(); // warning encouraged - (void)my_scopeguard(), // warning not encouraged, cast to \tcode{void} + (void)my_scopeguard(), // warning not encouraged, cast to \keyword{void} launch_missiles(); // comma operator, statement continues my_unique(42); // warning encouraged my_unique(); // warning not encouraged diff --git a/source/diagnostics.tex b/source/diagnostics.tex index e996a218f1..33c0976ff2 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -462,7 +462,7 @@ \indextext{static_assert@\tcode{static_assert}!not macro}% The contents are the same as the C standard library header \libheader{assert.h}, -except that a macro named \tcode{static_assert} +except that a macro named \keyword{static_assert} is not defined. \xrefc{7.2} diff --git a/source/exceptions.tex b/source/exceptions.tex index 8e55bc1189..dbcbf83f92 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -21,14 +21,14 @@ % \begin{bnf} \nontermdef{try-block}\br - \terminal{try} compound-statement handler-seq + \keyword{try} compound-statement handler-seq \end{bnf} \indextext{\idxcode{try}}% % \begin{bnf} \nontermdef{function-try-block}\br - \terminal{try} \opt{ctor-initializer} compound-statement handler-seq + \keyword{try} \opt{ctor-initializer} compound-statement handler-seq \end{bnf} \begin{bnf} @@ -40,7 +40,7 @@ % \begin{bnf} \nontermdef{handler}\br - \terminal{catch} \terminal{(} exception-declaration \terminal{)} compound-statement + \keyword{catch} \terminal{(} exception-declaration \terminal{)} compound-statement \end{bnf} \begin{bnf} @@ -72,7 +72,7 @@ \indextext{\idxcode{switch}!and try block}% \indextext{\idxcode{goto}!and handler}% \indextext{\idxcode{switch}!and handler}% -A \tcode{goto} or \tcode{switch} statement shall not be used to transfer control +A \tcode{goto} or \keyword{switch} statement shall not be used to transfer control into a try block or into a handler. \begin{example} \begin{codeblock} @@ -101,11 +101,11 @@ \indextext{\idxcode{return}!and handler}% \indextext{\idxcode{continue}!and handler}% A -\tcode{goto}, -\tcode{break}, -\tcode{return}, +\keyword{goto}, +\keyword{break}, +\keyword{return}, or -\tcode{continue} +\keyword{continue} statement can be used to transfer control out of a try block or handler. When this happens, each variable declared in the try block @@ -196,8 +196,8 @@ An exception can be thrown from one of the following contexts: \grammarterm{throw-expression}{s}\iref{expr.throw}, allocation functions\iref{basic.stc.dynamic.allocation}, -\tcode{dynamic_cast}\iref{expr.dynamic.cast}, -\tcode{typeid}\iref{expr.typeid}, +\keyword{dynamic_cast}\iref{expr.dynamic.cast}, +\keyword{typeid}\iref{expr.typeid}, \grammarterm{new-expression}{s}\iref{expr.new}, and standard library functions\iref{structure.specifications}. \end{note} @@ -210,8 +210,8 @@ can be caught by a \grammarterm{handler} of -\tcode{const} -\tcode{char*} +\keyword{const} +\tcode{\keyword{char}*} type: \begin{codeblock} try { @@ -252,7 +252,7 @@ \grammarterm{compound-statement} or \grammarterm{ctor-initializer} following the -\tcode{try} +\keyword{try} keyword was most recently entered by the thread of control and not yet exited. \pnum @@ -266,7 +266,7 @@ If the type of the exception object would be an incomplete type, an abstract class type\iref{class.abstract}, -or a pointer to an incomplete type other than \cv{}~\tcode{void} +or a pointer to an incomplete type other than \cv{}~\keyword{void} the program is ill-formed. \pnum @@ -377,7 +377,7 @@ constructed, but not yet destroyed, since the try block was entered. If an exception is thrown during the destruction of temporaries or -local variables for a \tcode{return} statement\iref{stmt.return}, +local variables for a \keyword{return} statement\iref{stmt.return}, the destructor for the returned object (if any) is also invoked. The objects are destroyed in the reverse order of the completion of their construction. @@ -468,7 +468,7 @@ The \grammarterm{exception-declaration} shall not denote a pointer or reference to an -incomplete type, other than ``pointer to \cv{}~\tcode{void}''. +incomplete type, other than ``pointer to \cv{}~\keyword{void}''. \pnum A handler of type @@ -631,7 +631,7 @@ on the initial function of the thread. \pnum -If a \tcode{return} statement\iref{stmt.return} appears in a handler of the +If a \keyword{return} statement\iref{stmt.return} appears in a handler of the \grammarterm{function-try-block} of a constructor, the program is ill-formed. @@ -697,25 +697,25 @@ \begin{bnf} \nontermdef{noexcept-specifier}\br - \terminal{noexcept} \terminal{(} constant-expression \terminal{)}\br - \terminal{noexcept}\br + \keyword{noexcept} \terminal{(} constant-expression \terminal{)}\br + \keyword{noexcept}\br \end{bnf} \pnum \indextext{exception specification!noexcept!constant expression and}% In a \grammarterm{noexcept-specifier}, the \grammarterm{constant-expression}, if supplied, shall be a contextually converted constant expression -of type \tcode{bool}\iref{expr.const}; +of type \keyword{bool}\iref{expr.const}; that constant expression is the exception specification of the function type in which the \grammarterm{noexcept-specifier} appears. -A \tcode{(} token that follows \tcode{noexcept} is part of the +A \tcode{(} token that follows \keyword{noexcept} is part of the \grammarterm{noexcept-specifier} and does not commence an initializer\iref{dcl.init}. -The \grammarterm{noexcept-specifier} \tcode{noexcept} +The \grammarterm{noexcept-specifier} \keyword{noexcept} without a \grammarterm{constant-expression} is equivalent to the \grammarterm{noexcept-specifier} -\tcode{noexcept(true)}. +\tcode{\keyword{noexcept}(\keyword{true})}. \pnum If a declaration of a function @@ -823,11 +823,11 @@ $E$ is a \grammarterm{throw-expression}\iref{expr.throw}, or \item -$E$ is a \tcode{dynamic_cast} expression that casts to a reference type and +$E$ is a \keyword{dynamic_cast} expression that casts to a reference type and requires a runtime check\iref{expr.dynamic.cast}, or \item -$E$ is a \tcode{typeid} expression applied to a +$E$ is a \keyword{typeid} expression applied to a (possibly parenthesized) built-in unary \tcode{*} operator applied to a pointer to a polymorphic class type\iref{expr.typeid}, @@ -909,14 +909,14 @@ }; struct B { B() noexcept; - B(const B&) = default; // implicit exception specification is \tcode{noexcept(true)} + B(const B&) = default; // implicit exception specification is \tcode{\keyword{noexcept}(\keyword{true})} B(B&&, int = (throw 42, 0)) noexcept; ~B() noexcept(false); }; int n = 7; struct D : public A, public B { int * p = new int[n]; - // \tcode{D::D()} potentially-throwing, as the \tcode{new} operator may throw \tcode{bad_alloc} or \tcode{bad_array_new_length} + // \tcode{D::D()} potentially-throwing, as the \keyword{new} operator may throw \tcode{bad_alloc} or \tcode{bad_array_new_length} // \tcode{D::D(const D\&)} non-throwing // \tcode{D::D(D\&\&)} potentially-throwing, as the default argument for \tcode{B}'s constructor may throw // \tcode{D::\~D()} potentially-throwing diff --git a/source/expressions.tex b/source/expressions.tex index 9694514b61..7a2d4428aa 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -151,7 +151,7 @@ \item A \defn{prvalue} is an expression whose evaluation initializes an object or computes the value of an operand of an operator, as specified by the context in which it appears, -or an expression that has type \cv{}~\tcode{void}. +or an expression that has type \cv{}~\keyword{void}. \item An \defn{xvalue} is a glvalue that denotes an object whose resources can be reused (usually because it is near the end of its lifetime). \item An \defn{lvalue} is a glvalue that is not an xvalue. \item An \defn{rvalue} is a prvalue or an xvalue. @@ -219,7 +219,7 @@ A&& ar = static_cast(a); \end{codeblock} -The expressions \tcode{f()}, \tcode{f().m}, \tcode{static_cast(a)}, and \tcode{a + a} +The expressions \tcode{f()}, \tcode{f().m}, \tcode{\keyword{static_cast}(a)}, and \tcode{a + a} are xvalues. The expression \tcode{ar} is an lvalue. \end{example} @@ -227,18 +227,18 @@ The \defnx{result}{result!glvalue} of a glvalue is the entity denoted by the expression. The \defnx{result}{result!prvalue} of a prvalue is the value that the expression stores into its context; -a prvalue that has type \cv{}~\tcode{void} has no result. +a prvalue that has type \cv{}~\keyword{void} has no result. A prvalue whose result is the value \placeholder{V} is sometimes said to have or name the value \placeholder{V}. The \defn{result object} of a prvalue is the object initialized by the prvalue; a non-discarded prvalue that is used to compute the value of an operand of a built-in operator -or a prvalue that has type \cv{}~\tcode{void} +or a prvalue that has type \cv{}~\keyword{void} has no result object. \begin{note} Except when the prvalue is the operand of a \grammarterm{decltype-specifier}, a prvalue of class or array type always has a result object. -For a discarded prvalue that has type other than \cv{}~\tcode{void}, +For a discarded prvalue that has type other than \cv{}~\keyword{void}, a temporary object is materialized; see \ref{expr.context}. \end{note} @@ -254,8 +254,8 @@ \begin{note} Because cv-qualifiers are removed from the type of an expression of non-class type when the expression is converted to a prvalue, an lvalue -of type \tcode{const int} can, for example, be used where -a prvalue of type \tcode{int} is required. +of type \tcode{\keyword{const} \keyword{int}} can, for example, be used where +a prvalue of type \keyword{int} is required. \end{note} \begin{note} There are no prvalue bit-fields; if a bit-field is converted to a @@ -276,12 +276,12 @@ \pnum Unless otherwise indicated\iref{dcl.type.decltype}, -a prvalue shall always have complete type or the \tcode{void} type; +a prvalue shall always have complete type or the \keyword{void} type; if it has a class type or (possibly multi-dimensional) array of class type, that class shall not be an abstract class\iref{class.abstract}. -A glvalue shall not have type \cv{}~\tcode{void}. +A glvalue shall not have type \cv{}~\keyword{void}. \begin{note} -A glvalue can have complete or incomplete non-\tcode{void} type. +A glvalue can have complete or incomplete non-\keyword{void} type. Class and array prvalues can have cv-qualified types; other prvalues always have cv-unqualified types. See \ref{expr.type}. \end{note} @@ -311,12 +311,12 @@ \item a type that is the signed or unsigned type corresponding to the dynamic type of the object, or -\item a \tcode{char}, \tcode{unsigned char}, or \tcode{std::byte} type. +\item a \keyword{char}, \tcode{\keyword{unsigned} \keyword{char}}, or \tcode{std::byte} type. \end{itemize} If a program invokes a defaulted copy/move constructor or copy/move assignment operator for a union of type \tcode{U} with a glvalue argument -that does not denote an object of type \cv{}~\tcode{U} within its lifetime, +that does not denote an object of type \cv{}~\keyword{U} within its lifetime, the behavior is undefined. \begin{note} Unlike in C, \Cpp{} has no accesses of class type. @@ -358,14 +358,14 @@ respectively; \item -if \tcode{T1} or \tcode{T2} is ``pointer to \cvqual{cv1} \tcode{void}'' and the +if \tcode{T1} or \tcode{T2} is ``pointer to \cvqual{cv1} \keyword{void}'' and the other type is ``pointer to \cvqual{cv2} \tcode{T}'', -where \tcode{T} is an object type or \tcode{void}, -``pointer to \cvqual{cv12} \tcode{void}'', +where \tcode{T} is an object type or \keyword{void}, +``pointer to \cvqual{cv12} \keyword{void}'', where \cvqual{cv12} is the union of \cvqual{cv1} and \cvqual{cv2}; \item -if \tcode{T1} or \tcode{T2} is ``pointer to \tcode{noexcept} function'' and the +if \tcode{T1} or \tcode{T2} is ``pointer to \keyword{noexcept} function'' and the other type is ``pointer to function'', where the function types are otherwise the same, ``pointer to function''; @@ -381,7 +381,7 @@ if \tcode{T1} or \tcode{T2} is ``pointer to member of \tcode{C1} of type function'', the other type is -``pointer to member of \tcode{C2} of type \tcode{noexcept} function'', and +``pointer to member of \tcode{C2} of type \keyword{noexcept} function'', and \tcode{C1} is reference-related to \tcode{C2} or \tcode{C2} is reference-related to \tcode{C1}\iref{dcl.init.ref}, where the function types are otherwise the same, @@ -416,9 +416,9 @@ typedef const int **pci; \end{codeblock} -The composite pointer type of \tcode{p} and \tcode{q} is ``pointer to \tcode{const void}''; the -composite pointer type of \tcode{pi} and \tcode{pci} is ``pointer to \tcode{const} pointer to -\tcode{const int}''. +The composite pointer type of \tcode{p} and \tcode{q} is ``pointer to \tcode{\keyword{const} \keyword{void}}''; the +composite pointer type of \tcode{pi} and \tcode{pci} is ``pointer to \tcode{\keyword{const}} pointer to +\tcode{\keyword{const} \keyword{int}}''. \end{example} \rSec2[expr.context]{Context dependence} @@ -525,16 +525,16 @@ \item When used as operands of operators. The operator's requirements for its operands dictate the destination type\iref{expr.compound}. -\item When used in the condition of an \tcode{if} statement\iref{stmt.if} or +\item When used in the condition of an \keyword{if} statement\iref{stmt.if} or iteration statement\iref{stmt.iter}. The destination type is -\tcode{bool}. +\keyword{bool}. -\item When used in the expression of a \tcode{switch} statement\iref{stmt.switch}. +\item When used in the expression of a \keyword{switch} statement\iref{stmt.switch}. The destination type is integral. \item When used as the source expression for an initialization (which includes use as an argument in a function call and use as the expression -in a \tcode{return} statement). The type of the entity being initialized +in a \keyword{return} statement). The type of the entity being initialized is (generally) the destination type. See~\ref{dcl.init}, \ref{dcl.init.ref}. \end{itemize} @@ -550,7 +550,7 @@ Certain language constructs require that an expression be converted to a Boolean value. An expression $E$ appearing in such a context is said to be \defnx{contextually converted to \tcode{bool}}{conversion!contextual to \tcode{bool}} and is well-formed if and only if -the declaration \tcode{bool t($E$);} is well-formed, for some invented temporary +the declaration \tcode{\keyword{bool} t($E$);} is well-formed, for some invented temporary variable \tcode{t}\iref{dcl.init}. \pnum @@ -745,9 +745,9 @@ The type denoted by the \grammarterm{type-id} \tcode{const int **} has three qualification-decompositions, taking \tcode{U} -as ``\tcode{int}'', -as ``pointer to \tcode{const int}'', and -as ``pointer to pointer to \tcode{const int}''. +as ``\keyword{int}'', +as ``pointer to \tcode{\keyword{const} \keyword{int}}'', and +as ``pointer to pointer to \tcode{\keyword{const} \keyword{int}}''. \end{example} The $n$-tuple of cv-qualifiers after the first one in the longest qualification-decomposition of \tcode{T}, that is, @@ -776,7 +776,7 @@ \item if the resulting $\cv{}^3_i$ is different from $\cv{}^1_i$ or $\cv{}^2_i$, or the resulting $P^3_i$ is different from $P^1_i$ or $P^2_i$, -then \tcode{const} is added to every $\cv{}^3_k$ for $0 < k < i$, +then \keyword{const} is added to every $\cv{}^3_k$ for $0 < k < i$, \end{itemize} where $\cv{}^j_i$ and $P^j_i$ are the components of the qualification-decomposition of $\tcode{T}j$. @@ -785,7 +785,7 @@ if the qualification-combined type of \tcode{T1} and \tcode{T2} is \tcode{T2}. \begin{note} If a program could assign a pointer of type \tcode{T**} to a pointer of -type \tcode{const} \tcode{T**} (that is, if line \#1 below were +type \keyword{const} \tcode{T**} (that is, if line \#1 below were allowed), a program could inadvertently modify a const object (as it is done on line \#2). For example, \begin{codeblock} @@ -827,34 +827,34 @@ \pnum \indextext{promotion!integral}% -A prvalue of an integer type other than \tcode{bool}, \tcode{char16_t}, -\tcode{char32_t}, or \tcode{wchar_t} whose integer conversion -rank\iref{conv.rank} is less than the rank of \tcode{int} can be -converted to a prvalue of type \tcode{int} if \tcode{int} can represent +A prvalue of an integer type other than \keyword{bool}, \keyword{char16_t}, +\keyword{char32_t}, or \keyword{wchar_t} whose integer conversion +rank\iref{conv.rank} is less than the rank of \keyword{int} can be +converted to a prvalue of type \keyword{int} if \keyword{int} can represent all the values of the source type; otherwise, the source prvalue can be -converted to a prvalue of type \tcode{unsigned int}. +converted to a prvalue of type \tcode{\keyword{unsigned} \keyword{int}}. \pnum \indextext{type!underlying!\idxcode{wchar_t}}% \indextext{type!underlying!\idxcode{char16_t}}% \indextext{type!underlying!\idxcode{char32_t}}% -A prvalue of type \tcode{char16_t}, \tcode{char32_t}, or -\tcode{wchar_t}\iref{basic.fundamental} can be converted to a prvalue +A prvalue of type \keyword{char16_t}, \keyword{char32_t}, or +\keyword{wchar_t}\iref{basic.fundamental} can be converted to a prvalue of the first of the following types that can represent all the values of -its underlying type: \tcode{int}, \tcode{unsigned int}, \tcode{long int}, -\tcode{unsigned long int}, \tcode{long long int}, -or \tcode{unsigned long long int}. If none of the types in that list can +its underlying type: \keyword{int}, \tcode{\keyword{unsigned} \keyword{int}}, \tcode{\keyword{long} \keyword{int}}, +\tcode{\keyword{unsigned} \keyword{long} \keyword{int}}, \tcode{\keyword{long} \keyword{long} \keyword{int}}, +or \tcode{\keyword{unsigned} \keyword{long} \keyword{long} \keyword{int}}. If none of the types in that list can represent all the values of its underlying type, a prvalue of type -\tcode{char16_t}, \tcode{char32_t}, or \tcode{wchar_t} can be converted +\keyword{char16_t}, \keyword{char32_t}, or \keyword{wchar_t} can be converted to a prvalue of its underlying type. \pnum \indextext{type!underlying!enumeration}% A prvalue of an unscoped enumeration type whose underlying type is not fixed can be converted to a prvalue of the first of the following -types that can represent all the values of the enumeration\iref{dcl.enum}: \tcode{int}, -\tcode{unsigned int}, \tcode{long int}, \tcode{unsigned long int}, -\tcode{long long int}, or \tcode{unsigned long long int}. If none of the types in that +types that can represent all the values of the enumeration\iref{dcl.enum}: \keyword{int}, +\tcode{\keyword{unsigned} \keyword{int}}, \tcode{\keyword{long} \keyword{int}}, \tcode{\keyword{unsigned} \keyword{long} \keyword{int}}, +\tcode{\keyword{long} \keyword{long} \keyword{int}}, or \tcode{\keyword{unsigned} \keyword{long} \keyword{long} \keyword{int}}. If none of the types in that list can represent all the values of the enumeration, a prvalue of an unscoped enumeration type can be converted to a prvalue of the extended integer type with lowest integer conversion rank\iref{conv.rank} greater than the rank of \tcode{long long} @@ -870,17 +870,17 @@ \pnum A prvalue for an integral bit-field\iref{class.bit} can be converted -to a prvalue of type \tcode{int} if \tcode{int} can represent all the +to a prvalue of type \keyword{int} if \keyword{int} can represent all the values of the bit-field; otherwise, it can be converted to -\tcode{unsigned int} if \tcode{unsigned int} can represent all the +\tcode{\keyword{unsigned} \keyword{int}} if \tcode{\keyword{unsigned} \keyword{int}} can represent all the values of the bit-field. If the bit-field is larger yet, no integral promotion applies to it. If the bit-field has an enumerated type, it is treated as any other value of that type for promotion purposes. \pnum \indextext{promotion!bool to int}% -A prvalue of type \tcode{bool} can be converted to a prvalue of type -\tcode{int}, with \tcode{false} becoming zero and \tcode{true} becoming +A prvalue of type \keyword{bool} can be converted to a prvalue of type +\keyword{int}, with \keyword{false} becoming zero and \keyword{true} becoming one. \pnum @@ -890,8 +890,8 @@ \pnum \indextext{promotion!floating-point}% -A prvalue of type \tcode{float} can be converted to a prvalue of type -\tcode{double}. The value is unchanged. +A prvalue of type \keyword{float} can be converted to a prvalue of type +\keyword{double}. The value is unchanged. \pnum This conversion is called \defn{floating-point promotion}. @@ -906,9 +906,9 @@ \pnum \indextext{conversion!bool@\tcode{bool}}% -If the destination type is \tcode{bool}, see~\ref{conv.bool}. If the -source type is \tcode{bool}, the value \tcode{false} is converted to -zero and the value \tcode{true} is converted to one. +If the destination type is \keyword{bool}, see~\ref{conv.bool}. If the +source type is \keyword{bool}, the value \keyword{false} is converted to +zero and the value \keyword{true} is converted to one. \pnum \indextext{conversion!to unsigned}% @@ -948,7 +948,7 @@ The behavior is undefined if the truncated value cannot be represented in the destination type. \begin{note} -If the destination type is \tcode{bool}, see~\ref{conv.bool}. +If the destination type is \keyword{bool}, see~\ref{conv.bool}. \end{note} \pnum @@ -967,8 +967,8 @@ \end{note} If the value being converted is outside the range of values that can be represented, the behavior is undefined. If the -source type is \tcode{bool}, the value \tcode{false} is converted to zero and the value -\tcode{true} is converted to one. +source type is \keyword{bool}, the value \keyword{false} is converted to zero and the value +\keyword{true} is converted to one. \rSec2[conv.ptr]{Pointer conversions} @@ -999,7 +999,7 @@ \pnum A prvalue of type ``pointer to \cv{} \tcode{T}'', where \tcode{T} is an object type, can be converted to a prvalue of type ``pointer to -\cv{} \tcode{void}''. +\cv{} \keyword{void}''. The pointer value\iref{basic.compound} is unchanged by this conversion. \pnum @@ -1063,27 +1063,27 @@ of such pointers do not apply to pointers to members. \indextext{conversion!pointer-to-member!\idxcode{void*}}% In particular, a pointer to member cannot be converted to a -\tcode{void*}. +\tcode{\keyword{void}*}. \end{footnote} \rSec2[conv.fctptr]{Function pointer conversions} \pnum \indextext{conversion!function pointer}% -A prvalue of type ``pointer to \tcode{noexcept} function'' +A prvalue of type ``pointer to \keyword{noexcept} function'' can be converted to a prvalue of type ``pointer to function''. The result is a pointer to the function. -A prvalue of type ``pointer to member of type \tcode{noexcept} function'' +A prvalue of type ``pointer to member of type \keyword{noexcept} function'' can be converted to a prvalue of type ``pointer to member of type function''. The result designates the member function. \begin{example} \begin{codeblock} void (*p)(); -void (**pp)() noexcept = &p; // error: cannot convert to pointer to \tcode{noexcept} function +void (**pp)() noexcept = &p; // error: cannot convert to pointer to \keyword{noexcept} function struct S { typedef void (*p)(); operator p(); }; -void (*q)() noexcept = S(); // error: cannot convert to pointer to \tcode{noexcept} function +void (*q)() noexcept = S(); // error: cannot convert to pointer to \keyword{noexcept} function \end{codeblock} \end{example} @@ -1092,9 +1092,9 @@ \pnum \indextext{conversion!boolean}% A prvalue of arithmetic, unscoped enumeration, pointer, or pointer-to-member -type can be converted to a prvalue of type \tcode{bool}. A zero value, null -pointer value, or null member pointer value is converted to \tcode{false}; any -other value is converted to \tcode{true}. +type can be converted to a prvalue of type \keyword{bool}. A zero value, null +pointer value, or null member pointer value is converted to \keyword{false}; any +other value is converted to \keyword{true}. \indextext{conversion!standard|)} @@ -1112,20 +1112,20 @@ are performed; if the other operand does not have the same type, the expression is ill-formed. -\item If either operand is of type \tcode{long double}, the -other shall be converted to \tcode{long double}. +\item If either operand is of type \tcode{\keyword{long} \keyword{double}}, the +other shall be converted to \tcode{\keyword{long} \keyword{double}}. -\item Otherwise, if either operand is \tcode{double}, the other shall be -converted to \tcode{double}. +\item Otherwise, if either operand is \keyword{double}, the other shall be +converted to \keyword{double}. -\item Otherwise, if either operand is \tcode{float}, the other shall be -converted to \tcode{float}. +\item Otherwise, if either operand is \keyword{float}, the other shall be +converted to \keyword{float}. \item Otherwise, the integral promotions\iref{conv.prom} shall be performed on both operands. \begin{footnote} -As a consequence, operands of type \tcode{bool}, \tcode{char8_t}, \tcode{char16_t}, -\tcode{char32_t}, \tcode{wchar_t}, or an enumerated type are converted +As a consequence, operands of type \keyword{bool}, \keyword{char8_t}, \keyword{char16_t}, +\keyword{char32_t}, \keyword{wchar_t}, or an enumerated type are converted to some integral type. \end{footnote} Then the following rules shall be applied to the promoted operands: @@ -1195,7 +1195,7 @@ \pnum \indextext{\idxcode{this}}% -The keyword \tcode{this} names a pointer to the object for which a non-static member +The keyword \keyword{this} names a pointer to the object for which a non-static member function\iref{class.mfct.non-static} is invoked or a non-static data member's initializer\iref{class.mem} is evaluated. @@ -1208,7 +1208,7 @@ \pnum If a declaration declares a member function or member function template of a -class \tcode{X}, the expression \tcode{this} is a prvalue of type ``pointer to +class \tcode{X}, the expression \keyword{this} is a prvalue of type ``pointer to \grammarterm{cv-qualifier-seq} \tcode{X}'' wherever \tcode{X} is the current class between the optional @@ -1240,14 +1240,14 @@ \pnum Otherwise, if a \grammarterm{member-declarator} declares a non-static data -member\iref{class.mem} of a class \tcode{X}, the expression \tcode{this} is +member\iref{class.mem} of a class \tcode{X}, the expression \keyword{this} is a prvalue of type ``pointer to \tcode{X}'' wherever \tcode{X} is the current class within the optional default member initializer\iref{class.mem}. \pnum -The expression \tcode{this} shall not appear in any other context. +The expression \keyword{this} shall not appear in any other context. \begin{example} \begin{codeblock} class Outer { @@ -1329,7 +1329,7 @@ refers to the member's class \begin{footnote} This also applies when the object expression -is an implicit \tcode{(*this)}~(\ref{class.mfct.non-static}). +is an implicit \tcode{(*\keyword{this})}~(\ref{class.mfct.non-static}). \end{footnote} or a class derived from that class, or @@ -1454,8 +1454,8 @@ in the closure object of the innermost such intervening \grammarterm{lambda-expression}. \begin{note} -If that \grammarterm{lambda-expression} is not declared \tcode{mutable}, -the type of such an identifier will typically be \tcode{const} qualified. +If that \grammarterm{lambda-expression} is not declared \keyword{mutable}, +the type of such an identifier will typically be \keyword{const} qualified. \end{note} Otherwise, the type of the expression is the type of the result. \begin{note} @@ -1479,7 +1479,7 @@ [=] { decltype(x) y1; // \tcode{y1} has type \tcode{float} decltype((x)) y2 = y1; // \tcode{y2} has type \tcode{float const\&} because this lambda - // is not \tcode{mutable} and \tcode{x} is an lvalue + // is not \keyword{mutable} and \tcode{x} is an lvalue decltype(r) r1 = y1; // \tcode{r1} has type \tcode{float\&} decltype((r)) r2 = y2; // \tcode{r2} has type \tcode{float const\&} }; @@ -1680,7 +1680,7 @@ \pnum In the \grammarterm{decl-specifier-seq} of the \grammarterm{lambda-declarator}, each \grammarterm{decl-specifier} -shall be one of \tcode{mutable}, \tcode{constexpr}, or \tcode{consteval}. +shall be one of \keyword{mutable}, \keyword{constexpr}, or \keyword{consteval}. \begin{note} The trailing \grammarterm{requires-clause} is described in \ref{dcl.decl}. \end{note} @@ -1689,7 +1689,7 @@ If a \grammarterm{lambda-expression} includes an empty \grammarterm{lambda-declarator}, it is as if the \grammarterm{lambda-declarator} were \tcode{()}. -The lambda return type is \tcode{auto}, which is replaced by the +The lambda return type is \keyword{auto}, which is replaced by the type specified by the \grammarterm{trailing-return-type} if provided and/or deduced from \tcode{return} statements as described in~\ref{dcl.spec.auto}. @@ -1790,9 +1790,9 @@ \pnum The function call operator or operator template is declared -\tcode{const}~(\ref{class.mfct.non-static}) if and only if the +\keyword{const}~(\ref{class.mfct.non-static}) if and only if the \grammarterm{lambda-expression}'s \grammarterm{parameter-declaration-clause} is not -followed by \tcode{mutable}. It is neither virtual nor declared \tcode{volatile}. Any +followed by \keyword{mutable}. It is neither virtual nor declared \tcode{volatile}. Any \grammarterm{noexcept-specifier} specified on a \grammarterm{lambda-expression} applies to the corresponding function call operator or operator template. An \grammarterm{attribute-specifier-seq} in a \grammarterm{lambda-declarator} appertains @@ -1801,11 +1801,11 @@ is a constexpr function if either the corresponding \grammarterm{lambda-expression}{'s} \grammarterm{parameter-declaration-clause} -is followed by \tcode{constexpr} or \tcode{consteval}, or +is followed by \keyword{constexpr} or \keyword{consteval}, or it satisfies the requirements for a constexpr function\iref{dcl.constexpr}. It is an immediate function\iref{dcl.constexpr} if the corresponding \grammarterm{lambda-expression}{'s} -\grammarterm{parameter-declaration-clause} is followed by \tcode{consteval}. +\grammarterm{parameter-declaration-clause} is followed by \keyword{consteval}. \begin{example} \begin{codeblock} auto ID = [](auto a) { return a; }; @@ -1837,7 +1837,7 @@ constexpr auto one = monoid(1); static_assert(add(one)(zero)() == one()); // OK -// Since \tcode{two} below is not declared \tcode{constexpr}, an evaluation of its \tcode{constexpr} member function call operator +// Since \tcode{two} below is not declared \keyword{constexpr}, an evaluation of its \tcode{constexpr} member function call operator // cannot perform an lvalue-to-rvalue conversion on one of its subobjects (that represents its capture) // in a constant expression. auto two = monoid(2); @@ -1876,7 +1876,7 @@ has a conversion function to pointer to function with \Cpp{} language linkage\iref{dcl.link} having the same parameter and return types as the closure type's function call operator. -The conversion is to ``pointer to \tcode{noexcept} function'' +The conversion is to ``pointer to \keyword{noexcept} function'' if the function call operator has a non-throwing exception specification. The value returned by this conversion function @@ -2000,7 +2000,7 @@ void f() { [=]()->int { return operator()(this->x + y); // equivalent to \tcode{S1::operator()(this->x + (*this).y)} - // \tcode{this} has type \tcode{S1*} + // \keyword{this} has type \tcode{S1*} }; } }; @@ -2089,15 +2089,15 @@ \grammarterm{simple-capture} of that \grammarterm{lambda-capture} shall be of the form ``\tcode{\&} \grammarterm{identifier} \opt{\tcode{...}}'', -``\tcode{this}'', -or ``\tcode{* this}''. +``\keyword{this}'', +or ``\tcode{* \keyword{this}}''. \begin{note} -The form \tcode{[\&,this]} is redundant but accepted +The form \tcode{[\&,\keyword{this}]} is redundant but accepted for compatibility with ISO \CppXIV{}. \end{note} Ignoring appearances in \grammarterm{initializer}{s} of \grammarterm{init-capture}{s}, an identifier or -\tcode{this} shall not appear more than once in a +\keyword{this} shall not appear more than once in a \grammarterm{lambda-capture}. \begin{example} \begin{codeblock} @@ -2109,7 +2109,7 @@ [=, *this]{ }; // OK [=, this]{ }; // OK, equivalent to \tcode{[=]} [i, i]{ }; // error: \tcode{i} repeated - [this, *this]{ }; // error: \tcode{this} appears twice + [this, *this]{ }; // error: \keyword{this} appears twice } \end{codeblock} \end{example} @@ -2126,8 +2126,8 @@ \pnum The \grammarterm{identifier} in a \grammarterm{simple-capture} shall denote a local entity\iref{basic.lookup.unqual}. -The \grammarterm{simple-capture}{s} \tcode{this} and \tcode{* this} -denote the local entity \tcode{*this}. +The \grammarterm{simple-capture}{s} \keyword{this} and \tcode{* \keyword{this}} +denote the local entity \tcode{*\keyword{this}}. An entity that is designated by a \grammarterm{simple-capture} is said to be \defn{explicitly captured}. @@ -2151,7 +2151,7 @@ the \grammarterm{lambda-expression}'s \grammarterm{compound-statement}. An \grammarterm{init-capture} without ellipsis behaves as if it declares and explicitly captures a variable of -the form ``\tcode{auto} \grammarterm{init-capture} \tcode{;}'', except that: +the form ``\keyword{auto} \grammarterm{init-capture} \tcode{;}'', except that: \begin{itemize} \item if the capture is by copy (see below), the non-static data member declared for the capture and the variable are treated as two different ways @@ -2188,14 +2188,14 @@ an \grammarterm{id-expression} that names one or more non-static class members and does not form a pointer to member\iref{expr.unary.op} -potentially references \tcode{*this}. +potentially references \tcode{*\keyword{this}}. \begin{note} This occurs even if overload resolution selects a static member function for the \grammarterm{id-expression}. \end{note} \item -A \tcode{this} expression potentially references \tcode{*this}. +A \keyword{this} expression potentially references \tcode{*\keyword{this}}. \item A \grammarterm{lambda-expression} potentially references @@ -2205,11 +2205,11 @@ If an expression potentially references a local entity within a scope in which it is odr-usable, and the expression would be potentially evaluated -if the effect of any enclosing \tcode{typeid} expressions\iref{expr.typeid} were ignored, +if the effect of any enclosing \keyword{typeid} expressions\iref{expr.typeid} were ignored, the entity is said to be \defnx{implicitly captured}{capture!implicit} by each intervening \grammarterm{lambda-expression} with an associated \grammarterm{capture-default} that does not explicitly capture it. -The implicit capture of \tcode{*this} is deprecated when the +The implicit capture of \tcode{*\keyword{this}} is deprecated when the \grammarterm{capture-default} is \tcode{=}; see \ref{depr.capture.this}. \begin{example} \begin{codeblock} @@ -2289,7 +2289,7 @@ x += m; // OK: \tcode{m} implicitly captured by \tcode{m4} and explicitly captured by \tcode{m3} x += i; // error: \tcode{i} is odr-used but not odr-usable // due to intervening function and class scopes - x += f; // OK: \tcode{this} captured implicitly by \tcode{m4} and explicitly by \tcode{m3} + x += f; // OK: \keyword{this} captured implicitly by \tcode{m4} and explicitly by \tcode{m3} }; }; } @@ -2347,10 +2347,10 @@ \item it is implicitly captured, the \grammarterm{capture-default} is \tcode{=}, and -the captured entity is not \tcode{*this}, or +the captured entity is not \tcode{*\keyword{this}}, or \item it is explicitly captured with a capture that is not of the form -\tcode{this}, +\keyword{this}, \tcode{\&} \grammarterm{identifier}, or \tcode{\&} \grammarterm{identifier} \grammarterm{initializer}. \end{itemize} @@ -2374,7 +2374,7 @@ an \grammarterm{id-expression} can still cause the implicit capture of the entity. \end{note} -If \tcode{*this} is captured by copy, each expression that odr-uses \tcode{*this} is +If \tcode{*\keyword{this}} is captured by copy, each expression that odr-uses \tcode{*\keyword{this}} is transformed to instead refer to the corresponding unnamed data member of the closure type. \begin{example} \begin{codeblock} @@ -2636,7 +2636,7 @@ requires requires (T x) { x + x; } T add(T a, T b) { return a + b; } \end{codeblock} -The first \tcode{requires} introduces the +The first \keyword{requires} introduces the \grammarterm{requires-clause}, and the second introduces the \grammarterm{requires-expression}. \end{example} @@ -2664,13 +2664,13 @@ The substitution of template arguments into a \grammarterm{requires-expression} may result in the formation of invalid types or expressions in its \grammarterm{requirement}s or the violation of the semantic constraints of those \grammarterm{requirement}s. -In such cases, the \grammarterm{requires-expression} evaluates to \tcode{false}; +In such cases, the \grammarterm{requires-expression} evaluates to \keyword{false}; it does not cause the program to be ill-formed. The substitution and semantic constraint checking proceeds in lexical order and stops when a condition that determines the result of the \grammarterm{requires-expression} is encountered. If substitution (if any) and semantic constraint checking succeed, -the \grammarterm{requires-expression} evaluates to \tcode{true}. +the \grammarterm{requires-expression} evaluates to \keyword{true}. \begin{note} If a \grammarterm{requires-expression} contains invalid types or expressions in its \grammarterm{requirement}s, and it does not appear within the declaration of a templated @@ -2700,7 +2700,7 @@ A \grammarterm{simple-requirement} asserts the validity of an \grammarterm{expression}. \begin{note} -The enclosing \grammarterm{requires-expression} will evaluate to \tcode{false} +The enclosing \grammarterm{requires-expression} will evaluate to \keyword{false} if substitution of template arguments into the \grammarterm{expression} fails. The \grammarterm{expression} is an unevaluated operand\iref{expr.prop}. \end{note} @@ -2732,7 +2732,7 @@ \pnum A \grammarterm{type-requirement} asserts the validity of a type. \begin{note} -The enclosing \grammarterm{requires-expression} will evaluate to \tcode{false} +The enclosing \grammarterm{requires-expression} will evaluate to \keyword{false} if substitution of template arguments fails. \end{note} \begin{example} @@ -2778,7 +2778,7 @@ into the \grammarterm{expression} is performed. \item -If the \tcode{noexcept} specifier is present, +If the \keyword{noexcept} specifier is present, $E$ shall not be a potentially-throwing expression\iref{except.spec}. \item @@ -2791,7 +2791,7 @@ \item The immediately-declared constraint\iref{temp.param} -of the \grammarterm{type-constraint} for \tcode{decltype((E))} +of the \grammarterm{type-constraint} for \tcode{\keyword{decltype}((E))} shall be satisfied. \begin{example} Given concepts \tcode{C} and \tcode{D}, @@ -2929,9 +2929,9 @@ \pnum \begin{note} The \tcode{>} token following the -\grammarterm{type-id} in a \tcode{dynamic_cast}, -\tcode{static_cast}, \tcode{reinterpret_cast}, or -\tcode{const_cast} can be the product of replacing a +\grammarterm{type-id} in a \keyword{dynamic_cast}, +\keyword{static_cast}, \keyword{reinterpret_cast}, or +\keyword{const_cast} can be the product of replacing a \tcode{>>} token by two consecutive \tcode{>} tokens\iref{temp.names}. \end{note} @@ -3008,10 +3008,10 @@ expression\iref{expr.mptr.oper} selecting a function member; the call is as a member of the class object referred to by the object expression. In the case of an implicit class -member access, the implied object is the one pointed to by \tcode{this}. +member access, the implied object is the one pointed to by \keyword{this}. \begin{note} A member function call of the form \tcode{f()} is interpreted as -\tcode{(*this).f()} (see~\ref{class.mfct.non-static}). +\tcode{(*\keyword{this}).f()} (see~\ref{class.mfct.non-static}). \end{note} \pnum @@ -3040,9 +3040,9 @@ \pnum If the \grammarterm{postfix-expression} names a destructor or pseudo-destructor\iref{expr.prim.id.dtor}, -the type of the function call expression is \tcode{void}; otherwise, the +the type of the function call expression is \keyword{void}; otherwise, the type of the function call expression is the return type of the -statically chosen function (i.e., ignoring the \tcode{virtual} keyword), +statically chosen function (i.e., ignoring the \keyword{virtual} keyword), even if the type of the function actually called is different. \indextext{type!incomplete}% If the \grammarterm{postfix-expression} names a pseudo-destructor @@ -3075,7 +3075,7 @@ \end{codeblock} \end{example} If the function is a non-static member -function, the \tcode{this} parameter of the function\iref{expr.prim.this} +function, the \keyword{this} parameter of the function\iref{expr.prim.this} is initialized with a pointer to the object of the call, converted as if by an explicit type conversion\iref{expr.cast}. \begin{note} @@ -3156,7 +3156,7 @@ \pnum The result of a function call is the result of the possibly-converted operand -of the \tcode{return} statement\iref{stmt.return} +of the \keyword{return} statement\iref{stmt.return} that transferred control out of the called function (if any), except in a virtual function call if the return type of the final overrider is different from the return type of the statically @@ -3174,9 +3174,9 @@ A function can change the values of its non-const parameters, but these changes cannot affect the values of the arguments except where a parameter is of a reference type\iref{dcl.ref}; if the reference is to -a const-qualified type, \tcode{const_cast} is required to be used to +a const-qualified type, \keyword{const_cast} is required to be used to cast away the constness in order to modify the argument's value. Where a -parameter is of \tcode{const} reference type a temporary object is +parameter is of \keyword{const} reference type a temporary object is introduced if needed~(\ref{dcl.type}, \ref{lex.literal}, \ref{lex.string}, \ref{dcl.array}, \ref{class.temporary}). In addition, it is possible to modify the values of non-constant objects through @@ -3211,7 +3211,7 @@ and function-to-pointer\iref{conv.func} standard conversions are performed on the argument expression. An argument that has type \cv{}~\tcode{std::nullptr_t} is converted -to type \tcode{void*}\iref{conv.ptr}. +to type \tcode{\keyword{void}*}\iref{conv.ptr}. After these conversions, if the argument does not have arithmetic, enumeration, pointer, pointer-to-member, or class type, the program is ill-formed. Passing a potentially-evaluated @@ -3269,10 +3269,10 @@ to the corresponding cast expression\iref{expr.cast}. \indextext{type!incomplete}% -Otherwise, if the type is \cv{}~\tcode{void} +Otherwise, if the type is \cv{}~\keyword{void} and the initializer is \tcode{()} or \tcode{\{\}} (after pack expansion, if any), -the expression is a prvalue of type \tcode{void} +the expression is a prvalue of type \keyword{void} that performs no initialization. Otherwise, the expression is a prvalue of the specified type @@ -3337,7 +3337,7 @@ If the object expression is of scalar type, \tcode{E2} shall name the pseudo-destructor of that same type (ignoring cv-qualifications) and -\tcode{E1.E2} is an lvalue of type ``function of () returning \tcode{void}''. +\tcode{E1.E2} is an lvalue of type ``function of () returning \keyword{void}''. \begin{note} This value can only be used for a notional function call\iref{expr.prim.id.dtor}. @@ -3360,8 +3360,8 @@ If \tcode{E2} is a bit-field, \tcode{E1.E2} is a bit-field. The type and value category of \tcode{E1.E2} are determined as follows. In the remainder of~\ref{expr.ref}, \cvqual{cq} represents either -\tcode{const} or the absence of \tcode{const} and \cvqual{vq} represents -either \tcode{volatile} or the absence of \tcode{volatile}. \cvqual{cv} +\keyword{const} or the absence of \keyword{const} and \cvqual{vq} represents +either \keyword{volatile} or the absence of \keyword{volatile}. \cvqual{cv} represents an arbitrary set of cv-qualifiers, as defined in~\ref{basic.type.qualifier}. @@ -3383,13 +3383,13 @@ otherwise \tcode{E1.E2} is an xvalue. Let the notation \cvqual{vq12} stand for the ``union'' of \cvqual{vq1} and \cvqual{vq2}; that is, if \cvqual{vq1} or \cvqual{vq2} -is \tcode{volatile}, then \cvqual{vq12} is \tcode{volatile}. Similarly, +is \tcode{volatile}, then \cvqual{vq12} is \keyword{volatile}. Similarly, let the notation \cvqual{cq12} stand for the ``union'' of \cvqual{cq1} and \cvqual{cq2}; that is, if \cvqual{cq1} or \cvqual{cq2} is -\tcode{const}, then \cvqual{cq12} is \tcode{const}. If \tcode{E2} is -declared to be a \tcode{mutable} member, then the type of \tcode{E1.E2} +\keyword{const}, then \cvqual{cq12} is \keyword{const}. If \tcode{E2} is +declared to be a \keyword{mutable} member, then the type of \tcode{E1.E2} is ``\cvqual{vq12} \tcode{T}''. If \tcode{E2} is not declared to be a -\tcode{mutable} member, then the type of \tcode{E1.E2} is +\keyword{mutable} member, then the type of \tcode{E1.E2} is ``\cvqual{cq12} \cvqual{vq12} \tcode{T}''. \item If \tcode{E2} is an overload set, @@ -3442,7 +3442,7 @@ The value obtained is a copy of the original value. \end{note} The operand shall be a modifiable lvalue. The type of the operand shall -be an arithmetic type other than \cv{}~\tcode{bool}, +be an arithmetic type other than \cv{}~\keyword{bool}, or a pointer to a complete object type. An operand with volatile-qualified type is deprecated; see~\ref{depr.volatile.type}. @@ -3484,11 +3484,11 @@ \pnum \indextext{expression!dynamic cast}% \indextext{cast!dynamic}% -The result of the expression \tcode{dynamic_cast(v)} is the result of +The result of the expression \tcode{\keyword{dynamic_cast}(v)} is the result of converting the expression \tcode{v} to type \tcode{T}. \indextext{type!incomplete}% \tcode{T} shall be a pointer or reference to a complete class type, or -``pointer to \cv{} \tcode{void}''. The \tcode{dynamic_cast} operator shall not cast +``pointer to \cv{} \keyword{void}''. The \keyword{dynamic_cast} operator shall not cast away constness\iref{expr.const.cast}. \pnum @@ -3543,7 +3543,7 @@ If \tcode{v} is a null pointer value, the result is a null pointer value. \pnum -If \tcode{T} is ``pointer to \cv{} \tcode{void}'', then the result +If \tcode{T} is ``pointer to \cv{} \keyword{void}'', then the result is a pointer to the most derived object pointed to by \tcode{v}. Otherwise, a runtime check is applied to see if the object pointed or referred to by \tcode{v} can be converted to the type pointed or @@ -3605,7 +3605,7 @@ \end{codeblock} \end{example} \begin{note} -Subclause \ref{class.cdtor} describes the behavior of a \tcode{dynamic_cast} +Subclause \ref{class.cdtor} describes the behavior of a \keyword{dynamic_cast} applied to an object under construction or destruction. \end{note} @@ -3614,11 +3614,11 @@ \pnum \indextext{expression!type identification}% \indextext{\idxcode{typeid}}% -The result of a \tcode{typeid} expression is an lvalue of static type +The result of a \keyword{typeid} expression is an lvalue of static type \indextext{\idxcode{type_info}}% \indexlibraryglobal{type_info}% -\tcode{const} \tcode{std::type_info}\iref{type.info} and dynamic type \tcode{const} -\tcode{std::type_info} or \tcode{const} \term{name} where \term{name} is an +\keyword{const} \tcode{std::type_info}\iref{type.info} and dynamic type \keyword{const} +\tcode{std::type_info} or \keyword{const} \term{name} where \term{name} is an \impldef{derived type for \tcode{typeid}} class publicly derived from \tcode{std::type_info} which preserves the behavior described in~\ref{type.info}. @@ -3631,7 +3631,7 @@ \tcode{std::type_info} object at the end of the program is unspecified. \pnum -When \tcode{typeid} is applied to a glvalue whose type is a +When \keyword{typeid} is applied to a glvalue whose type is a polymorphic class type\iref{class.virtual}, the result refers to a \tcode{std::type_info} object representing the type of the most derived object\iref{intro.object} (that is, the dynamic type) to which the @@ -3644,7 +3644,7 @@ all meet this requirement. \end{footnote} and the pointer is a null pointer value\iref{basic.compound}, the -\tcode{typeid} expression throws an exception\iref{except.throw} of +\keyword{typeid} expression throws an exception\iref{except.throw} of a type that would match a handler of type \indextext{\idxcode{bad_typeid}}% \indexlibraryglobal{bad_typeid}% @@ -3652,7 +3652,7 @@ exception\iref{bad.typeid}. \pnum -When \tcode{typeid} is applied to an expression other than a glvalue of +When \keyword{typeid} is applied to an expression other than a glvalue of a polymorphic class type, the result refers to a \tcode{std::type_info} object representing the static type of the expression. Lvalue-to-rvalue\iref{conv.lval}, array-to-pointer\iref{conv.array}, @@ -3664,11 +3664,11 @@ The expression is an unevaluated operand\iref{expr.prop}. \pnum -When \tcode{typeid} is applied to a \grammarterm{type-id}, the result +When \keyword{typeid} is applied to a \grammarterm{type-id}, the result refers to a \tcode{std::type_info} object representing the type of the \grammarterm{type-id}. If the type of the \grammarterm{type-id} is a reference to a possibly cv-qualified type, the result of the -\tcode{typeid} expression refers to a \tcode{std::type_info} object +\keyword{typeid} expression refers to a \tcode{std::type_info} object representing the cv-unqualified referenced type. If the type of the \grammarterm{type-id} is a class type or a reference to a class type, the class shall be completely-defined. @@ -3679,7 +3679,7 @@ \pnum If the type of the expression or \grammarterm{type-id} is a -cv-qualified type, the result of the \tcode{typeid} expression refers +cv-qualified type, the result of the \keyword{typeid} expression refers to a \tcode{std::type_info} object representing the cv-unqualified type. \begin{example} @@ -3698,11 +3698,11 @@ \pnum If the header \libheaderrefx{typeinfo}{type.info} is not imported or included prior -to a use of \tcode{typeid}, the program is ill-formed. +to a use of \keyword{typeid}, the program is ill-formed. \pnum \begin{note} -Subclause \ref{class.cdtor} describes the behavior of \tcode{typeid} +Subclause \ref{class.cdtor} describes the behavior of \keyword{typeid} applied to an object under construction or destruction. \end{note} @@ -3711,14 +3711,14 @@ \pnum \indextext{expression!static cast}% \indextext{cast!static}% -The result of the expression \tcode{static_cast(v)} is the result of +The result of the expression \tcode{\keyword{static_cast}(v)} is the result of converting the expression \tcode{v} to type \tcode{T}. \indextext{cast!static!lvalue}% \indextext{cast!lvalue}% If \tcode{T} is an lvalue reference type or an rvalue reference to function type, the result is an lvalue; if \tcode{T} is an rvalue reference to object type, the result is an xvalue; -otherwise, the result is a prvalue. The \tcode{static_cast} operator shall not cast +otherwise, the result is a prvalue. The \keyword{static_cast} operator shall not cast away constness\iref{expr.const.cast}. \pnum @@ -3759,7 +3759,7 @@ the result refers to the object or the specified base class subobject thereof; otherwise, the lvalue-to-rvalue conversion\iref{conv.lval} is applied to the bit-field and the resulting prvalue is used as the -\grammarterm{expression} of the \tcode{static_cast} for the remainder of this subclause. +\grammarterm{expression} of the \keyword{static_cast} for the remainder of this subclause. If \tcode{T2} is an inaccessible\iref{class.access} or ambiguous\iref{class.member.lookup} base class of \tcode{T1}, a program that necessitates such a cast is ill-formed. @@ -3793,12 +3793,12 @@ \end{note} \pnum -Otherwise, the \tcode{static_cast} shall perform one of the conversions +Otherwise, the \keyword{static_cast} shall perform one of the conversions listed below. No other conversion shall be performed explicitly using a -\tcode{static_cast}. +\keyword{static_cast}. \pnum -Any expression can be explicitly converted to type \cv{}~\tcode{void}, +Any expression can be explicitly converted to type \cv{}~\keyword{void}, in which case it becomes a discarded-value expression\iref{expr.prop}. \begin{note} @@ -3818,8 +3818,8 @@ null pointer\iref{conv.ptr}, null member pointer\iref{conv.mem}, boolean\iref{conv.bool}, or function pointer\iref{conv.fctptr} -conversion, can be performed explicitly using \tcode{static_cast}. A -program is ill-formed if it uses \tcode{static_cast} to perform the +conversion, can be performed explicitly using \keyword{static_cast}. A +program is ill-formed if it uses \keyword{static_cast} to perform the inverse of an ill-formed standard conversion sequence. \begin{example} \begin{codeblock} @@ -3836,7 +3836,7 @@ The lvalue-to-rvalue\iref{conv.lval}, array-to-pointer\iref{conv.array}, and function-to-pointer\iref{conv.func} conversions are applied to the -operand. Such a \tcode{static_cast} is subject to the restriction that +operand. Such a \keyword{static_cast} is subject to the restriction that the explicit conversion does not cast away constness\iref{expr.const.cast}, and the following additional rules for specific cases: @@ -3921,7 +3921,7 @@ \end{note} \pnum -A prvalue of type ``pointer to \cvqual{cv1} \tcode{void}'' can be +A prvalue of type ``pointer to \cvqual{cv1} \keyword{void}'' can be converted to a prvalue of type ``pointer to \cvqual{cv2} \tcode{T}'', where \tcode{T} is an object type and \cvqual{cv2} is the same cv-qualification as, or greater cv-qualification than, \cvqual{cv1}. @@ -3947,7 +3947,7 @@ \pnum \indextext{expression!reinterpret cast}% \indextext{cast!reinterpret}% -The result of the expression \tcode{reinterpret_cast(v)} is the +The result of the expression \tcode{\keyword{reinterpret_cast}(v)} is the result of converting the expression \tcode{v} to type \tcode{T}. \indextext{cast!reinterpret!lvalue}% \indextext{cast!lvalue}% @@ -3957,18 +3957,18 @@ lvalue-to-rvalue\iref{conv.lval}, array-to-pointer\iref{conv.array}, and function-to-pointer\iref{conv.func} standard conversions are performed on the expression \tcode{v}. Conversions that can be performed explicitly -using \tcode{reinterpret_cast} are listed below. No other conversion can -be performed explicitly using \tcode{reinterpret_cast}. +using \keyword{reinterpret_cast} are listed below. No other conversion can +be performed explicitly using \keyword{reinterpret_cast}. \pnum -The \tcode{reinterpret_cast} operator shall not cast away constness\iref{expr.const.cast}. +The \keyword{reinterpret_cast} operator shall not cast away constness\iref{expr.const.cast}. An expression of integral, enumeration, pointer, or pointer-to-member type can be explicitly converted to its own type; such a cast yields the value of its operand. \pnum \begin{note} -The mapping performed by \tcode{reinterpret_cast} might, or might not, produce a +The mapping performed by \keyword{reinterpret_cast} might, or might not, produce a representation different from the original value. \end{note} @@ -3985,9 +3985,9 @@ \end{note} A value of type \tcode{std::nullptr_t} can be converted to an integral type; the conversion has the same meaning and validity as a conversion of -\tcode{(void*)0} to the integral type. +\tcode{(\keyword{void}*)0} to the integral type. \begin{note} -A \tcode{reinterpret_cast} +A \keyword{reinterpret_cast} cannot be used to convert a value of any type to the type \tcode{std::nullptr_t}. \end{note} @@ -4035,10 +4035,10 @@ The types can have different \cv-qualifiers, subject to the overall -restriction that a \tcode{reinterpret_cast} cannot cast away constness. +restriction that a \keyword{reinterpret_cast} cannot cast away constness. \end{footnote} When a prvalue \tcode{v} of object pointer type is converted to -the object pointer type ``pointer to \cv{}~\tcode{T}'', the result is \tcode{static_cast<\cv{} T*>(static_cast<\cv{}~void*>(v))}. +the object pointer type ``pointer to \cv{}~\tcode{T}'', the result is \tcode{\keyword{static_cast}<\cv{} T*>(\keyword{static_cast}<\cv{}~\keyword{void}*>(v))}. \begin{note} Converting a pointer of type ``pointer to \tcode{T1}'' that points to an object of type \tcode{T1} @@ -4078,7 +4078,7 @@ \begin{footnote} \tcode{T1} and \tcode{T2} can have different \cv-qualifiers, subject to -the overall restriction that a \tcode{reinterpret_cast} cannot cast away +the overall restriction that a \keyword{reinterpret_cast} cannot cast away constness. \end{footnote} The null member pointer value\iref{conv.mem} is converted to the @@ -4106,7 +4106,7 @@ can be cast to the type ``reference to \tcode{T2}'' if an expression of type ``pointer to \tcode{T1}'' can be explicitly converted to the type ``pointer to \tcode{T2}'' -using a \tcode{reinterpret_cast}. +using a \keyword{reinterpret_cast}. The result is that of \tcode{*reinterpret_cast(p)} where \tcode{p} is a pointer to \placeholder{x} of type ``pointer to \tcode{T1}''. @@ -4123,7 +4123,7 @@ \pnum \indextext{expression!const cast}% \indextext{cast!const}% -The result of the expression \tcode{const_cast(v)} is of type +The result of the expression \tcode{\keyword{const_cast}(v)} is of type \tcode{T}. If \tcode{T} is an lvalue reference to object type, the result is an lvalue; if \tcode{T} is an rvalue reference to object type, the result is an xvalue; @@ -4131,22 +4131,22 @@ lvalue-to-rvalue\iref{conv.lval}, array-to-pointer\iref{conv.array}, and function-to-pointer\iref{conv.func} standard conversions are performed on the expression \tcode{v}. Conversions that can be performed explicitly using -\tcode{const_cast} are listed below. No other conversion shall be -performed explicitly using \tcode{const_cast}. +\keyword{const_cast} are listed below. No other conversion shall be +performed explicitly using \keyword{const_cast}. \pnum \begin{note} Subject to the restrictions in this subclause, an expression can be cast -to its own type using a \tcode{const_cast} operator. +to its own type using a \keyword{const_cast} operator. \end{note} \pnum For two similar types \tcode{T1} and \tcode{T2}\iref{conv.qual}, a prvalue of type \tcode{T1} may be explicitly -converted to the type \tcode{T2} using a \tcode{const_cast} +converted to the type \tcode{T2} using a \keyword{const_cast} if, considering the qualification-decompositions of both types, each $P^1_i$ is the same as $P^2_i$ for all $i$. -The result of a \tcode{const_cast} refers to the original entity. +The result of a \keyword{const_cast} refers to the original entity. \begin{example} \begin{codeblock} typedef int *A[3]; // array of 3 pointer to \tcode{int} @@ -4162,20 +4162,20 @@ \pnum For two object types \tcode{T1} and \tcode{T2}, if a pointer to \tcode{T1} can be explicitly converted to the type ``pointer to \tcode{T2}'' using a -\tcode{const_cast}, then the following conversions can also be made: +\keyword{const_cast}, then the following conversions can also be made: \begin{itemize} \item an lvalue of type \tcode{T1} can be explicitly converted to an lvalue -of type \tcode{T2} using the cast \tcode{const_cast}; +of type \tcode{T2} using the cast \tcode{\keyword{const_cast}}; \item a glvalue of type \tcode{T1} can be explicitly converted to an xvalue -of type \tcode{T2} using the cast \tcode{const_cast}; and +of type \tcode{T2} using the cast \tcode{\keyword{const_cast}}; and \item if \tcode{T1} is a class type, a prvalue of type \tcode{T1} can be explicitly converted to an xvalue of type \tcode{T2} using the cast -\tcode{const_cast}. +\tcode{\keyword{const_cast}}. \end{itemize} -The result of a reference \tcode{const_cast} refers +The result of a reference \keyword{const_cast} refers to the original object if the operand is a glvalue and to the result of applying the temporary materialization conversion\iref{conv.rval} otherwise. @@ -4189,9 +4189,9 @@ \begin{note} Depending on the type of the object, a write operation through the pointer, lvalue or pointer to data member resulting from a -\tcode{const_cast} that casts away a const-qualifier +\keyword{const_cast} that casts away a const-qualifier \begin{footnote} -\tcode{const_cast} +\keyword{const_cast} is not limited to conversions that cast away a const-qualifier. \end{footnote} @@ -4225,7 +4225,7 @@ \pnum \begin{note} Some conversions which involve only changes in cv-qualification cannot -be done using \tcode{const_cast}. For instance, conversions between +be done using \keyword{const_cast}. For instance, conversions between pointers to functions are not covered because such conversions lead to values whose use causes undefined behavior. For the same reasons, conversions between pointers to member functions, and in particular, the @@ -4302,7 +4302,7 @@ \begin{note} \indextext{type!incomplete}% Indirection through a pointer to an incomplete type (other than -\cv{} \tcode{void}) is valid. The lvalue thus obtained can be +\cv{} \keyword{void}) is valid. The lvalue thus obtained can be used in limited ways (to initialize a reference, for example); this lvalue must not be converted to a prvalue, see~\ref{conv.lval}. \end{note} @@ -4342,8 +4342,8 @@ \end{codeblock} \end{example} \begin{note} -A pointer to member formed from a \tcode{mutable} non-static data -member\iref{dcl.stc} does not reflect the \tcode{mutable} specifier +A pointer to member formed from a \keyword{mutable} non-static data +member\iref{dcl.stc} does not reflect the \keyword{mutable} specifier associated with the non-static data member. \end{note} @@ -4365,7 +4365,7 @@ \pnum If \tcode{\&} is applied to an lvalue of incomplete class type and the -complete type declares \tcode{operator\&()}, it is unspecified whether +complete type declares \tcode{\keyword{operator}\&()}, it is unspecified whether the operator has the built-in meaning or the operator function is called. The operand of \tcode{\&} shall not be a bit-field. @@ -4400,10 +4400,10 @@ \pnum \indextext{operator!logical negation}% The operand of the logical negation operator \tcode{!} is contextually -converted to \tcode{bool}\iref{conv}; -its value is \tcode{true} -if the converted operand is \tcode{false} and \tcode{false} otherwise. -The type of the result is \tcode{bool}. +converted to \keyword{bool}\iref{conv}; +its value is \keyword{true} +if the converted operand is \keyword{false} and \keyword{false} otherwise. +The type of the result is \keyword{bool}. \pnum \indextext{signed integer representation!ones' complement}% @@ -4513,7 +4513,7 @@ \item \placeholder{o} is determined by enumerating the applicable -\tcode{operator co_await} functions for an argument +\tcode{\keyword{operator} \keyword{co_await}} functions for an argument \placeholder{a}\iref{over.match.oper}, and choosing the best one through overload resolution\iref{over.match}. If overload resolution is ambiguous, the program is ill-formed. @@ -4545,7 +4545,7 @@ \item \placeholder{await-suspend} is the expression \placeholder{e}\tcode{.await_suspend(}\placeholder{h}\tcode{)}, -which shall be a prvalue of type \tcode{void}, \tcode{bool}, or +which shall be a prvalue of type \keyword{void}, \keyword{bool}, or \tcode{std::coroutine_handle} for some type \tcode{Z}. \item @@ -4563,7 +4563,7 @@ the \placeholder{await-ready} expression, then: \begin{itemize} \item -If the result of \placeholder{await-ready} is \tcode{false}, +If the result of \placeholder{await-ready} is \keyword{false}, the coroutine is considered suspended. Then: \begin{itemize} @@ -4581,9 +4581,9 @@ \item Otherwise, if the type of \placeholder{await-suspend} -is \tcode{bool}, +is \keyword{bool}, \placeholder{await-suspend} is evaluated, -and the coroutine is resumed if the result is \tcode{false}. +and the coroutine is resumed if the result is \keyword{false}. \item Otherwise, \placeholder{await-suspend} is evaluated. @@ -4596,7 +4596,7 @@ without exiting any scopes\iref{stmt.jump}. \item -If the result of \placeholder{await-ready} is \tcode{true}, +If the result of \placeholder{await-ready} is \keyword{true}, or when the coroutine is resumed other than by rethrowing an exception from \placeholder{await-suspend}, the \placeholder{await-resume} expression is evaluated, and @@ -4649,29 +4649,29 @@ \indextext{expression!\idxcode{sizeof}}% \indextext{operator!\idxcode{sizeof}}% \indextext{byte}% -The \tcode{sizeof} operator yields the number of bytes +The \keyword{sizeof} operator yields the number of bytes occupied by a non-potentially-overlapping object of the type of its operand. The operand is either an expression, which is an unevaluated operand\iref{expr.prop}, or a parenthesized \grammarterm{type-id}. \indextext{type!incomplete}% -The \tcode{sizeof} operator shall not be applied to an expression that +The \keyword{sizeof} operator shall not be applied to an expression that has function or incomplete type, to the parenthesized name of such types, or to a glvalue that designates a bit-field. -The result of \tcode{sizeof} +The result of \keyword{sizeof} applied to any of the narrow character types is \tcode{1}. The result of -\tcode{sizeof} applied to any other fundamental +\keyword{sizeof} applied to any other fundamental type\iref{basic.fundamental} is \impldef{\tcode{sizeof} applied to fundamental types other than \tcode{char}, \tcode{signed char}, and \tcode{unsigned char}}. \begin{note} -In particular, the values of \tcode{sizeof(bool)}, \tcode{sizeof(char16_t)}, -\tcode{sizeof(char32_t)}, and \tcode{sizeof(wchar_t)} are +In particular, the values of \tcode{\keyword{sizeof}(\keyword{bool})}, \tcode{\keyword{sizeof}(\keyword{char16_t})}, +\tcode{\keyword{sizeof}(\keyword{char32_t})}, and \tcode{\keyword{sizeof}(\keyword{wchar_t})} are implementation-defined. \begin{footnote} -\tcode{sizeof(bool)} is not required to be \tcode{1}. +\tcode{\keyword{sizeof}(\keyword{bool})} is not required to be \tcode{1}. \end{footnote} \end{note} \begin{note} @@ -4687,13 +4687,13 @@ When applied to a class, the result is the number of bytes in an object of that class including any padding required for placing objects of that type in an array. -The result of applying \tcode{sizeof} to a +The result of applying \keyword{sizeof} to a potentially-overlapping subobject is the size of the type, not the size of the subobject. \begin{footnote} The actual size of a potentially-overlapping subobject can be less than the result of -applying \tcode{sizeof} to the subobject, due to virtual base classes +applying \keyword{sizeof} to the subobject, due to virtual base classes and less strict padding requirements on potentially-overlapping subobjects. \end{footnote} \indextext{array!\idxcode{sizeof}}% @@ -4705,16 +4705,16 @@ The lvalue-to-rvalue\iref{conv.lval}, array-to-pointer\iref{conv.array}, and function-to-pointer\iref{conv.func} standard conversions are not -applied to the operand of \tcode{sizeof}. +applied to the operand of \keyword{sizeof}. If the operand is a prvalue, the temporary materialization conversion\iref{conv.rval} is applied. \pnum -The identifier in a \tcode{sizeof...} expression shall name a -pack. The \tcode{sizeof...} operator yields the number of elements +The identifier in a \tcode{\keyword{sizeof}...} expression shall name a +pack. The \tcode{\keyword{sizeof}...} operator yields the number of elements in the pack\iref{temp.variadic}. -A \tcode{sizeof...} expression is a pack expansion\iref{temp.variadic}. +A \tcode{\keyword{sizeof}...} expression is a pack expansion\iref{temp.variadic}. \begin{example} \begin{codeblock} template @@ -4727,10 +4727,10 @@ \pnum \indextext{\idxcode{size_t}}% \indexlibraryglobal{size_t}% -The result of \tcode{sizeof} and \tcode{sizeof...} is a prvalue of type +The result of \keyword{sizeof} and \tcode{\keyword{sizeof}...} is a prvalue of type \tcode{std::size_t}. \begin{note} -A \tcode{sizeof} expression +A \keyword{sizeof} expression is an integral constant expression\iref{expr.const}. The type \tcode{std::size_t} is defined in the standard header \libheader{cstddef}~(\ref{cstddef.syn}, \ref{support.types.layout}). @@ -4741,7 +4741,7 @@ \pnum \indextext{\idxcode{alignof}}% \indextext{expression!\idxcode{alignof}}% -An \tcode{alignof} expression yields the alignment requirement +An \keyword{alignof} expression yields the alignment requirement of its operand type. The operand shall be a \grammarterm{type-id} representing a complete object type, or an array thereof, or a reference to one of those types. @@ -4749,15 +4749,15 @@ \pnum The result is a prvalue of type \tcode{std::size_t}. \begin{note} -An \tcode{alignof} expression +An \keyword{alignof} expression is an integral constant expression\iref{expr.const}. The type \tcode{std::size_t} is defined in the standard header \libheader{cstddef}~(\ref{cstddef.syn}, \ref{support.types.layout}). \end{note} \pnum -When \tcode{alignof} is applied to a reference type, the result -is the alignment of the referenced type. When \tcode{alignof} +When \keyword{alignof} is applied to a reference type, the result +is the alignment of the referenced type. When \keyword{alignof} is applied to an array type, the result is the alignment of the element type. @@ -4766,7 +4766,7 @@ \pnum \indextext{\idxcode{noexcept}}% \indextext{expression!\idxcode{noexcept}}% -The \tcode{noexcept} operator determines whether the evaluation of its operand, +The \keyword{noexcept} operator determines whether the evaluation of its operand, which is an unevaluated operand\iref{expr.prop}, can throw an exception\iref{except.throw}. @@ -4776,14 +4776,14 @@ \end{bnf} \pnum -The result of the \tcode{noexcept} operator is a prvalue of type \tcode{bool}. +The result of the \keyword{noexcept} operator is a prvalue of type \keyword{bool}. \begin{note} A \grammarterm{noexcept-expression} is an integral constant expression\iref{expr.const}. \end{note} \pnum -The result of the \tcode{noexcept} operator is \tcode{true} +The result of the \keyword{noexcept} operator is \keyword{true} unless the \grammarterm{expression} is potentially-throwing\iref{except.spec}. \indextext{expression!unary|)} @@ -4906,7 +4906,7 @@ (new int) (*[10])(); // error \end{codeblock} -Instead, the explicitly parenthesized version of the \tcode{new} +Instead, the explicitly parenthesized version of the \keyword{new} operator can be used to create objects of compound types\iref{basic.compound}: @@ -4938,8 +4938,8 @@ \grammarterm{new-expression} yields a pointer to the initial element (if any) of the array. \begin{note} -Both \tcode{new int} and \tcode{new int[10]} have type \tcode{int*} and -the type of \tcode{new int[i][10]} is \tcode{int (*)[10]} +Both \tcode{\keyword{new} \keyword{int}} and \tcode{\keyword{new} \keyword{int}[10]} have type \tcode{\keyword{int}*} and +the type of \tcode{\keyword{new} \keyword{int}[i][10]} is \tcode{\keyword{int} (*)[10]} \end{note} The \grammarterm{attribute-specifier-seq} in a \grammarterm{noptr-new-declarator} appertains to the associated array type. @@ -5030,14 +5030,14 @@ is a non-array type, the allocation function's name is \indextext{\idxcode{operator new}}% \indextext{\idxcode{operator delete}}% -\tcode{operator new} and the deallocation function's name is -\tcode{operator delete}. If the allocated type is an array type, the +\tcode{\keyword{operator} \keyword{new}} and the deallocation function's name is +\tcode{\keyword{operator} \keyword{delete}}. If the allocated type is an array type, the allocation function's name is \indextext{\idxcode{operator new}}% \indextext{\idxcode{operator delete}}% -\tcode{operator new[]} +\tcode{\keyword{operator} \keyword{new}[]} and the deallocation function's name is -\tcode{operator delete[]}. +\tcode{\keyword{operator} \keyword{delete}[]}. \begin{note} An implementation is required to provide default definitions for the global allocation @@ -5137,7 +5137,7 @@ object being created only if the object is an array and the allocation function is not a non-allocating form\iref{new.delete.placement}. For arrays of -\tcode{char}, \tcode{unsigned char}, and \tcode{std::byte}, +\keyword{char}, \tcode{\keyword{unsigned} \keyword{char}}, and \tcode{std::byte}, the difference between the result of the \grammarterm{new-expression} and the address returned by the allocation function shall be an integral multiple of the @@ -5227,7 +5227,7 @@ a placement allocation function, except when referencing the library function \tcode{operator new[](std::size_t, void*)}. The amount of overhead may vary from one -invocation of \tcode{new} to another. +invocation of \keyword{new} to another. \end{example} \pnum @@ -5364,7 +5364,7 @@ \pnum If a \grammarterm{new-expression} calls a deallocation function, it passes the value returned from the allocation function call as the first -argument of type \tcode{void*}. If a placement deallocation function is +argument of type \tcode{\keyword{void}*}. If a placement deallocation function is called, it is passed the same additional arguments as were passed to the placement allocation function, that is, the same arguments as those specified with the \grammarterm{new-placement} syntax. @@ -5392,12 +5392,12 @@ The first alternative is a \defnx{single-object delete expression}{delete!single-object}, and the second is an \defnx{array delete expression}{delete!array}. -Whenever the \tcode{delete} keyword is immediately followed by empty square +Whenever the \keyword{delete} keyword is immediately followed by empty square brackets, it shall be interpreted as the second alternative. \begin{footnote} A \grammarterm{lambda-expression} with a \grammarterm{lambda-introducer} -that consists of empty square brackets can follow the \tcode{delete} keyword +that consists of empty square brackets can follow the \keyword{delete} keyword if the \grammarterm{lambda-expression} is enclosed in parentheses. \end{footnote} The operand shall be of pointer to object type or of class type. If of @@ -5407,10 +5407,10 @@ \begin{footnote} This implies that an object cannot be deleted using a pointer of type -\tcode{void*} because \tcode{void} is not an object type. +\tcode{\keyword{void}*} because \keyword{void} is not an object type. \end{footnote} The \grammarterm{delete-expression}'s result has type -\tcode{void}. +\keyword{void}. \pnum \indextext{\idxcode{delete}!single-object}% @@ -5419,13 +5419,13 @@ converted operand is used in place of the original operand for the remainder of this subclause. In a single-object delete expression, the value of the operand of -\tcode{delete} may be a null pointer value, a pointer to a non-array object +\keyword{delete} may be a null pointer value, a pointer to a non-array object created by a previous \grammarterm{new-expression}, or a pointer to a subobject\iref{intro.object} representing a base class of such an object\iref{class.derived}. If not, the behavior is undefined. \indextext{array!\idxcode{delete}}% -In an array delete expression, the value of the operand of \tcode{delete} +In an array delete expression, the value of the operand of \keyword{delete} may be a null pointer value or a pointer value that resulted from a previous array \grammarterm{new-expression}. \begin{footnote} @@ -5437,11 +5437,11 @@ If not, the behavior is undefined. \begin{note} This means that the syntax of the \grammarterm{delete-expression} must -match the type of the object allocated by \tcode{new}, not the syntax of the +match the type of the object allocated by \keyword{new}, not the syntax of the \grammarterm{new-expression}. \end{note} \begin{note} -A pointer to a \tcode{const} type can be the operand of a +A pointer to a \keyword{const} type can be the operand of a \grammarterm{delete-expression}; it is not necessary to cast away the constness\iref{expr.const.cast} of the pointer expression before it is used as the operand of the \grammarterm{delete-expression}. @@ -5518,8 +5518,8 @@ \pnum If a deallocation function is called, -it is \tcode{operator delete} for a single-object delete expression or -\tcode{operator delete[]} for an array delete expression. +it is \tcode{\keyword{operator} \keyword{delete}} for a single-object delete expression or +\tcode{\keyword{operator} \keyword{delete}[]} for an array delete expression. \begin{note} \indextext{\idxcode{operator delete}}% An implementation provides default definitions of the global @@ -5530,7 +5530,7 @@ \end{note} \pnum -If the keyword \tcode{delete} in a \grammarterm{delete-expression} +If the keyword \keyword{delete} in a \grammarterm{delete-expression} is not preceded by the unary \tcode{::} operator and the type of the operand is a pointer to a (possibly cv-qualified) class type \tcode{T}: \begin{itemize} @@ -5659,8 +5659,8 @@ \pnum An explicit type conversion can be expressed using functional notation\iref{expr.type.conv}, a type conversion operator -(\tcode{dynamic_cast}, \tcode{static_cast}, \tcode{reinterpret_cast}, -\tcode{const_cast}), or the \term{cast} notation. +(\keyword{dynamic_cast}, \keyword{static_cast}, \keyword{reinterpret_cast}, +\keyword{const_cast}), or the \term{cast} notation. \begin{bnf} \nontermdef{cast-expression}\br @@ -5678,15 +5678,15 @@ \indextext{cast!const}% \indextext{cast!static}% \indextext{cast!reinterpret}% -\item a \tcode{const_cast}\iref{expr.const.cast}, -\item a \tcode{static_cast}\iref{expr.static.cast}, -\item a \tcode{static_cast} followed by a \tcode{const_cast}, -\item a \tcode{reinterpret_cast}\iref{expr.reinterpret.cast}, or -\item a \tcode{reinterpret_cast} followed by a \tcode{const_cast}, +\item a \keyword{const_cast}\iref{expr.const.cast}, +\item a \keyword{static_cast}\iref{expr.static.cast}, +\item a \keyword{static_cast} followed by a \keyword{const_cast}, +\item a \keyword{reinterpret_cast}\iref{expr.reinterpret.cast}, or +\item a \keyword{reinterpret_cast} followed by a \keyword{const_cast}, \end{itemize} can be performed using the cast notation of explicit type conversion. The same semantic restrictions and behaviors apply, with the exception -that in performing a \tcode{static_cast} in the following situations the +that in performing a \keyword{static_cast} in the following situations the conversion is valid even if the base class is inaccessible: \begin{itemize} \item a pointer to an object of derived class type or an lvalue or @@ -5708,7 +5708,7 @@ above, the interpretation that appears first in the list is used, even if a cast resulting from that interpretation is ill-formed. If a conversion can be interpreted in more than one way as a -\tcode{static_cast} followed by a \tcode{const_cast}, the conversion is +\keyword{static_cast} followed by a \keyword{const_cast}, the conversion is ill-formed. \begin{example} \begin{codeblock} @@ -5717,7 +5717,7 @@ struct I2 : A { }; struct D : I1, I2 { }; A* foo( D* p ) { - return (A*)( p ); // ill-formed \tcode{static_cast} interpretation + return (A*)( p ); // ill-formed \keyword{static_cast} interpretation } \end{codeblock} \end{example} @@ -5728,8 +5728,8 @@ ``pointer to incomplete class type''. The destination type of a cast using the cast notation can be ``pointer to incomplete class type''. If both the operand and destination types are class types and one or both -are incomplete, it is unspecified whether the \tcode{static_cast} or the -\tcode{reinterpret_cast} interpretation is used, even if there is an +are incomplete, it is unspecified whether the \keyword{static_cast} or the +\keyword{reinterpret_cast} interpretation is used, even if there is an inheritance relationship between the two classes. \begin{note} For example, if the classes were defined later in the translation unit, @@ -5792,7 +5792,7 @@ \tcode{E1.E2} given in~\ref{expr.ref}. \begin{note} It is not possible to use a pointer to member that refers to a -\tcode{mutable} member to modify a const class object. For +\keyword{mutable} member to modify a const class object. For example, \begin{codeblock} struct S { @@ -5802,7 +5802,7 @@ void f() { const S cs; -int S::* pm = &S::i; // \tcode{pm} refers to \tcode{mutable} member \tcode{S::i} +int S::* pm = &S::i; // \tcode{pm} refers to \keyword{mutable} member \tcode{S::i} cs.*pm = 88; // error: \tcode{cs} is a const object } \end{codeblock} @@ -5823,7 +5823,7 @@ In a \tcode{.*} expression whose object expression is an rvalue, the program is ill-formed if the second operand is a pointer to member function whose \grammarterm{ref-qualifier} is \tcode{\&}, -unless its \grammarterm{cv-qualifier-seq} is \tcode{const}. +unless its \grammarterm{cv-qualifier-seq} is \keyword{const}. In a \tcode{.*} expression whose object expression is an lvalue, the program is ill-formed if the second operand is @@ -6068,7 +6068,7 @@ \tcode{q}. \pnum -If one of the operands is of type \tcode{bool} +If one of the operands is of type \keyword{bool} and the other is not, the program is ill-formed. \pnum @@ -6162,7 +6162,7 @@ if the header \libheaderref{compare} is not imported or included prior to a use of such a class type -- even an implicit use in which the type is not named -(e.g., via the \tcode{auto} specifier\iref{dcl.spec.auto} +(e.g., via the \keyword{auto} specifier\iref{dcl.spec.auto} in a defaulted three-way comparison\iref{class.spaceship} or use of the built-in operator) -- the program is ill-formed. @@ -6208,8 +6208,8 @@ The operators \tcode{<} (less than), \tcode{>} (greater than), \tcode{<=} (less than or equal to), and \tcode{>=} (greater than or equal to) all -yield \tcode{false} or \tcode{true}. The type of the result is -\tcode{bool}. +yield \keyword{false} or \keyword{true}. The type of the result is +\keyword{bool}. \pnum The usual arithmetic conversions\iref{expr.arith.conv} are performed on operands of arithmetic @@ -6250,17 +6250,17 @@ \pnum If two operands \tcode{p} and \tcode{q} compare equal\iref{expr.eq}, -\tcode{p<=q} and \tcode{p>=q} both yield \tcode{true} and \tcode{pq} both yield \tcode{false}. Otherwise, if a pointer \tcode{p} +\tcode{p<=q} and \tcode{p>=q} both yield \keyword{true} and \tcode{pq} both yield \keyword{false}. Otherwise, if a pointer \tcode{p} compares greater than a pointer \tcode{q}, \tcode{p>=q}, \tcode{p>q}, -\tcode{q<=p}, and \tcode{q=p}, and \tcode{q>p} all yield \tcode{false}. +\tcode{q<=p}, and \tcode{q=p}, and \tcode{q>p} all yield \keyword{false}. Otherwise, the result of each of the operators is unspecified. \pnum If both operands (after conversions) are of arithmetic or enumeration type, each -of the operators shall yield \tcode{true} if the specified relationship is true -and \tcode{false} if it is false. +of the operators shall yield \keyword{true} if the specified relationship is true +and \keyword{false} if it is false. \rSec2[expr.eq]{Equality operators}% \indextext{expression!equality operators}% @@ -6289,8 +6289,8 @@ \pnum The converted operands shall have arithmetic, enumeration, pointer, or pointer-to-member type, or type \tcode{std::nullptr_t}. The operators -\tcode{==} and \tcode{!=} both yield \tcode{true} or \tcode{false}, i.e., a -result of type \tcode{bool}. In each case below, the operands shall have the +\tcode{==} and \tcode{!=} both yield \keyword{true} or \keyword{false}, i.e., a +result of type \keyword{bool}. In each case below, the operands shall have the same type after the specified conversions have been applied. \pnum @@ -6395,16 +6395,16 @@ \tcode{std::nullptr_t} and the other a null pointer constant compare equal. \pnum -If two operands compare equal, the result is \tcode{true} for -the \tcode{==} operator and \tcode{false} for the \tcode{!=} operator. If two operands -compare unequal, the result is \tcode{false} for the \tcode{==} operator and -\tcode{true} for the \tcode{!=} operator. Otherwise, the result of each of the +If two operands compare equal, the result is \keyword{true} for +the \tcode{==} operator and \keyword{false} for the \tcode{!=} operator. If two operands +compare unequal, the result is \keyword{false} for the \tcode{==} operator and +\keyword{true} for the \tcode{!=} operator. Otherwise, the result of each of the operators is unspecified. \pnum If both operands are of arithmetic or enumeration type, the usual arithmetic conversions\iref{expr.arith.conv} are performed on both operands; each of the operators shall yield -\tcode{true} if the specified relationship is true and \tcode{false} if it is +\keyword{true} if the specified relationship is true and \keyword{false} if it is false. \rSec2[expr.bit.and]{Bitwise AND operator}% @@ -6497,12 +6497,12 @@ \pnum The \tcode{\&\&} operator groups left-to-right. The operands are both -contextually converted to \tcode{bool}\iref{conv}. +contextually converted to \keyword{bool}\iref{conv}. The -result is \tcode{true} if both operands are \tcode{true} and -\tcode{false} otherwise. Unlike \tcode{\&}, \tcode{\&\&} guarantees +result is \keyword{true} if both operands are \keyword{true} and +\keyword{false} otherwise. Unlike \tcode{\&}, \tcode{\&\&} guarantees left-to-right evaluation: the second operand is not evaluated if the -first operand is \tcode{false}. +first operand is \keyword{false}. \pnum The result is a \tcode{bool}. @@ -6524,15 +6524,15 @@ \pnum The \tcode{||} operator groups left-to-right. The operands are both -contextually converted to \tcode{bool}\iref{conv}. +contextually converted to \keyword{bool}\iref{conv}. The result is -\tcode{true} if either of its operands is \tcode{true}, and -\tcode{false} otherwise. Unlike \tcode{|}, \tcode{||} guarantees +\keyword{true} if either of its operands is \keyword{true}, and +\keyword{false} otherwise. Unlike \tcode{|}, \tcode{||} guarantees left-to-right evaluation; moreover, the second operand is not evaluated -if the first operand evaluates to \tcode{true}. +if the first operand evaluates to \keyword{true}. \pnum -The result is a \tcode{bool}. +The result is a \keyword{bool}. \indextext{operator!side effects and logical OR}% If the second expression is evaluated, the first expression is sequenced before @@ -6551,9 +6551,9 @@ \pnum Conditional expressions group right-to-left. The first expression is -contextually converted to \tcode{bool}\iref{conv}. +contextually converted to \keyword{bool}\iref{conv}. It is -evaluated and if it is \tcode{true}, the result of the conditional +evaluated and if it is \keyword{true}, the result of the conditional expression is the value of the second expression, otherwise that of the third expression. Only one of the second and third expressions is evaluated. @@ -6561,7 +6561,7 @@ the second or third expression\iref{intro.execution}. \pnum -If either the second or the third operand has type \tcode{void}, +If either the second or the third operand has type \keyword{void}, one of the following shall hold: \begin{itemize} \item @@ -6572,8 +6572,8 @@ The \grammarterm{conditional-expression} is a bit-field if that operand is a bit-field. -\item Both the second and the third operands have type \tcode{void}; the -result is of type \tcode{void} and is a prvalue. +\item Both the second and the third operands have type \keyword{void}; the +result is of type \keyword{void} and is a prvalue. \begin{note} This includes the case where both operands are \grammarterm{throw-expression}{s}. @@ -6722,7 +6722,7 @@ \placeholder{p} be an lvalue naming the promise object of the enclosing coroutine\iref{dcl.fct.def.coroutine}, then the \grammarterm{yield-expression} is equivalent to the expression -\tcode{co_await }\placeholder{p}\tcode{.yield_value(}\placeholder{e}\tcode{)}. +\tcode{\keyword{co_await} \placeholder{p}.yield_value(\placeholder{e})}. \begin{example} \begin{codeblock} @@ -6770,7 +6770,7 @@ \end{bnf} \pnum -A \grammarterm{throw-expression} is of type \tcode{void}. +A \grammarterm{throw-expression} is of type \keyword{void}. \pnum Evaluating a \grammarterm{throw-expression} with an operand throws an @@ -7022,7 +7022,7 @@ Such a class can have a non-trivial destructor. Within this evaluation, \tcode{std::is_constant_evaluated()}\iref{meta.const.eval} - returns \tcode{true}. + returns \keyword{true}. \end{note} \end{itemize} @@ -7057,7 +7057,7 @@ machine\iref{intro.execution}, would evaluate one of the following: \begin{itemize} \item -\tcode{this}\iref{expr.prim.this}, except in a constexpr +\keyword{this}\iref{expr.prim.this}, except in a constexpr function\iref{dcl.constexpr} that is being evaluated as part of $E$; @@ -7140,7 +7140,7 @@ \item in a \grammarterm{lambda-expression}, -a reference to \tcode{this} or to a variable with +a reference to \keyword{this} or to a variable with automatic storage duration defined outside that \grammarterm{lambda-expression}, where the reference would be an odr-use~(\ref{basic.def.odr}, \ref{expr.prim.lambda}); @@ -7158,7 +7158,7 @@ \begin{note} If the odr-use occurs in an invocation of a function call operator of a closure type, -it no longer refers to \tcode{this} or to an enclosing automatic variable +it no longer refers to \keyword{this} or to an enclosing automatic variable due to the transformation\iref{expr.prim.lambda.capture} of the \grammarterm{id-expression} into an access of the corresponding data member. @@ -7176,10 +7176,10 @@ \end{note} \item -a conversion from type \cv{}~\tcode{void*} to a pointer-to-object type; +a conversion from type \cv{}~\tcode{\keyword{void}*} to a pointer-to-object type; \item -a \tcode{reinterpret_cast}\iref{expr.reinterpret.cast}; +a \keyword{reinterpret_cast}\iref{expr.reinterpret.cast}; \item a modification of an object~(\ref{expr.ass}, \ref{expr.post.incr}, @@ -7260,7 +7260,7 @@ } constexpr int f2(int k) { int x = k; // OK: not required to be a constant expression - // because \tcode{x} is not \tcode{constexpr} + // because \tcode{x} is not \keyword{constexpr} return x; } @@ -7347,7 +7347,7 @@ integral constant expression is required, then that expression is contextually implicitly converted\iref{conv} to an integral or unscoped enumeration type -and the selected conversion function shall be \tcode{constexpr}. +and the selected conversion function shall be \keyword{constexpr}. \begin{example} \begin{codeblock} struct A { @@ -7383,7 +7383,7 @@ \end{itemize} and where the reference binding (if any) binds directly. \begin{note} -Such expressions can be used in \tcode{new} +Such expressions can be used in \keyword{new} expressions\iref{expr.new}, as case expressions\iref{stmt.switch}, as enumerator initializers if the underlying type is fixed\iref{dcl.enum}, as array bounds\iref{dcl.array}, and @@ -7393,7 +7393,7 @@ \indextext{contextually converted constant expression of type \tcode{bool}|see{conversion, contextual}}% \indextext{conversion!contextual to constant expression of type \tcode{bool}}% A \term{contextually converted constant expression of type \tcode{bool}} is -an expression, contextually converted to \tcode{bool}\iref{conv}, +an expression, contextually converted to \keyword{bool}\iref{conv}, where the converted expression is a constant expression and the conversion sequence contains only the conversions above. diff --git a/source/future.tex b/source/future.tex index e1afbe7c0d..4a49f9986b 100644 --- a/source/future.tex +++ b/source/future.tex @@ -160,7 +160,7 @@ \rSec1[depr.static.constexpr]{Redeclaration of \tcode{static constexpr} data members} \pnum -For compatibility with prior revisions of \Cpp{}, a \tcode{constexpr} +For compatibility with prior revisions of \Cpp{}, a \keyword{constexpr} static data member may be redundantly redeclared outside the class with no initializer. This usage is deprecated. \begin{example} @@ -583,7 +583,7 @@ \tcode{strstreambuf} object; \item \tcode{constant}, set when the array object has -\tcode{const} elements, so the output sequence cannot be written; +\keyword{const} elements, so the output sequence cannot be written; \item \tcode{dynamic}, set when the array object is allocated (or reallocated) @@ -1586,7 +1586,7 @@ \begin{itemdescr} \pnum \requires -\tcode{remove_all_extents_t} shall be a complete type or \cv{} \tcode{void}. +\tcode{remove_all_extents_t} shall be a complete type or \cv{} \keyword{void}. \pnum \tcode{is_pod} is a \oldconcept{UnaryTypeTrait}\iref{meta.rqmts} @@ -2145,7 +2145,7 @@ \begin{itemize} \item \tcode{Elem} is the wide-character type, such as - \tcode{wchar_t}, \tcode{char16_t}, or \tcode{char32_t}. + \keyword{wchar_t}, \keyword{char16_t}, or \keyword{char32_t}. \item \tcode{Maxcode} is the largest wide-character code that the facet will read or write without reporting a conversion error. @@ -2678,7 +2678,7 @@ \pnum \requires The \tcode{source} and \range{first}{last} sequences are UTF-8 encoded. The value type of \tcode{Source} - and \tcode{InputIterator} is \tcode{char} or \tcode{char8_t}. + and \tcode{InputIterator} is \tcode{char} or \keyword{char8_t}. \tcode{Source} meets the requirements specified in \ref{fs.path.req}. \pnum @@ -2688,9 +2688,9 @@ narrow encoding\iref{fs.path.type.cvt} is UTF-8, return \tcode{path(source)} or \tcode{path(first, last)}; otherwise, -\item if \tcode{value_type} is \tcode{wchar_t} and the +\item if \tcode{value_type} is \keyword{wchar_t} and the native wide encoding is UTF-16, or - if \tcode{value_type} is \tcode{char16_t} or \tcode{char32_t}, + if \tcode{value_type} is \keyword{char16_t} or \keyword{char32_t}, convert \tcode{source} or \range{first}{last} to a temporary, \tcode{tmp}, of type \tcode{string_type} and return \tcode{path(tmp)}; diff --git a/source/intro.tex b/source/intro.tex index 7537516e1d..9ab77c231e 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -197,11 +197,11 @@ \begin{defnote} The term does not mean only \tcode{char}, -\tcode{char8_t}, -\tcode{char16_t}, -\tcode{char32_t}, +\keyword{char8_t}, +\keyword{char16_t}, +\keyword{char32_t}, and -\tcode{wchar_t} +\keyword{wchar_t} objects\iref{basic.fundamental}, but any value that can be represented by a type that provides the definitions specified in @@ -437,7 +437,7 @@ \begin{defnote} Observer functions are specified as -\tcode{const} +\keyword{const} member functions. \end{defnote} diff --git a/source/iostreams.tex b/source/iostreams.tex index 663d8ad07c..66231fdbb5 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -95,7 +95,7 @@ \pnum In the classes of \ref{input.output}, a template parameter with name -\tcode{charT} represents a member of the set of types containing \tcode{char}, \tcode{wchar_t}, +\tcode{charT} represents a member of the set of types containing \tcode{char}, \keyword{wchar_t}, and any other \impldef{set of character types that iostreams templates can be instantiated for} character types that meet the requirements for a character on which any of the iostream components can be instantiated. @@ -363,7 +363,7 @@ specialized for \tcode{char} or -\tcode{wchar_t} +\keyword{wchar_t} types. \pnum @@ -379,7 +379,7 @@ are used for positioning streams specialized on \tcode{char} and -\tcode{wchar_t} +\keyword{wchar_t} respectively. \end{example} @@ -1488,7 +1488,7 @@ \pnum \effects If \tcode{parray} is a null pointer, allocates an array of -pointers to \tcode{void} of unspecified size and stores a pointer to +pointers to \keyword{void} of unspecified size and stores a pointer to its first element in \tcode{parray}. The function then extends the array @@ -2146,10 +2146,10 @@ \ensures \tcode{*this} has the state that \tcode{rhs} had before the function call, except that -\tcode{rdbuf()} returns \tcode{nullptr}. \tcode{rhs} is in a valid but +\tcode{rdbuf()} returns \keyword{nullptr}. \tcode{rhs} is in a valid but unspecified state, except that \tcode{rhs.rdbuf()} returns the same value as it returned before the function call, and -\tcode{rhs.tie()} returns \tcode{nullptr}. +\tcode{rhs.tie()} returns \keyword{nullptr}. \end{itemdescr} \indexlibrarymember{swap}{basic_ios}% @@ -3584,7 +3584,7 @@ \default Does nothing. Returns -\tcode{this}. +\keyword{this}. \end{itemdescr} \indexlibrarymember{seekoff}{basic_streambuf}% @@ -4038,7 +4038,7 @@ then either \tcode{pbase()} is set to -\tcode{nullptr}, +\keyword{nullptr}, or \tcode{pbase()} and @@ -8315,7 +8315,7 @@ \pnum \returns -\tcode{this}. +\keyword{this}. \end{itemdescr} \rSec2[istringstream]{Class template \tcode{basic_istringstream}} @@ -9354,7 +9354,7 @@ In subclause~\ref{file.streams}, member functions taking arguments of \tcode{const filesystem::path::value_type*} are only be provided on systems where \tcode{filesystem::path::value_type}\iref{fs.class.path} is not \tcode{char}. \begin{note} -These functions enable class \tcode{path} support for systems with a wide native path character type, such as \tcode{wchar_t}. +These functions enable class \tcode{path} support for systems with a wide native path character type, such as \keyword{wchar_t}. \end{note} \rSec2[filebuf]{Class template \tcode{basic_filebuf}} @@ -9676,7 +9676,7 @@ \pnum \returns -\tcode{this} +\keyword{this} if successful, a null pointer otherwise. \end{itemdescr} @@ -9737,7 +9737,7 @@ \pnum \returns -\tcode{this} +\keyword{this} on success, a null pointer otherwise. \end{itemdescr} @@ -11515,8 +11515,8 @@ \rSec3[fs.req.general]{General} \pnum -Throughout subclause~\ref{filesystems}, \tcode{char}, \tcode{wchar_t}, \tcode{char8_t}, -\tcode{char16_t}, and \tcode{char32_t} are collectively called +Throughout subclause~\ref{filesystems}, \tcode{char}, \keyword{wchar_t}, \keyword{char8_t}, +\keyword{char16_t}, and \keyword{char32_t} are collectively called \defnx{encoded character types}{encoded character type}. \pnum @@ -12028,7 +12028,7 @@ \indexlibrarymember{value_type}{path}% \pnum -\tcode{value_type} is a \tcode{typedef} for the +\tcode{value_type} is a \keyword{typedef} for the operating system dependent encoded character type used to represent pathnames. \indexlibrarymember{preferred_separator}{path}% @@ -12042,7 +12042,7 @@ \tcode{value_type} is \tcode{char} and \tcode{preferred_separator} is the slash character (\tcode{'/'}). For Windows-based operating systems, -\tcode{value_type} is \tcode{wchar_t} and +\tcode{value_type} is \keyword{wchar_t} and \tcode{preferred_separator} is the backslash character (\tcode{L'\textbackslash\textbackslash'}). \end{example} @@ -12298,18 +12298,18 @@ strings to identify paths. Changing this behavior would be surprising and error prone. \end{note} -\item \tcode{wchar_t}: The encoding is the native wide encoding. +\item \keyword{wchar_t}: The encoding is the native wide encoding. The method of conversion is unspecified. \begin{note} -For Windows-based operating systems \tcode{path::value_type} is \tcode{wchar_t} -so no conversion from \tcode{wchar_t} value type arguments or to \tcode{wchar_t} +For Windows-based operating systems \tcode{path::value_type} is \keyword{wchar_t} +so no conversion from \keyword{wchar_t} value type arguments or to \tcode{wchar_t} value type return values is performed. \end{note} -\item \tcode{char8_t}: The encoding is UTF-8. The method of conversion +\item \keyword{char8_t}: The encoding is UTF-8. The method of conversion is unspecified. -\item \tcode{char16_t}: The encoding is UTF-16. The method of conversion +\item \keyword{char16_t}: The encoding is UTF-16. The method of conversion is unspecified. -\item \tcode{char32_t}: The encoding is UTF-32. The method of conversion +\item \keyword{char32_t}: The encoding is UTF-32. The method of conversion is unspecified. \end{itemize} @@ -12357,7 +12357,7 @@ \tcode{basic_string} or \tcode{basic_string_view}, or \item the \grammarterm{qualified-id} \tcode{iterator_traits>::value_type} is valid and -denotes a possibly \tcode{const} encoded character type\iref{temp.deduct}. +denotes a possibly \keyword{const} encoded character type\iref{temp.deduct}. \end{itemize} \pnum @@ -12456,7 +12456,7 @@ follows: \begin{itemize} \item -If \tcode{value_type} is \tcode{wchar_t}, converts to the native +If \tcode{value_type} is \keyword{wchar_t}, converts to the native wide encoding\iref{fs.path.type.cvt} using the \tcode{codecvt<\brk{}wchar_t, char, mbstate_t>} facet of \tcode{loc}. \item diff --git a/source/iterators.tex b/source/iterators.tex index 6c2553109d..ebf0004018 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -803,7 +803,7 @@ \pnum \begin{note} Some legacy output iterators define a nested type named \tcode{value_type} -that is an alias for \tcode{void}. +that is an alias for \keyword{void}. These types are not \libconcept{indirectly_readable} and have no associated value types. \end{note} @@ -846,7 +846,7 @@ respectively. The type \tcode{iterator_traits::pointer} -shall be \tcode{void} +shall be \keyword{void} for an iterator of class type \tcode{I} that does not support \tcode{operator->}. Additionally, in the case of an output iterator, the types @@ -855,7 +855,7 @@ iterator_traits::difference_type iterator_traits::reference \end{codeblock} -may be defined as \tcode{void}. +may be defined as \keyword{void}. \pnum The definitions in this subclause make use of the following @@ -936,7 +936,7 @@ \end{codeblock} If the \grammarterm{qualified-id} \tcode{I::pointer} is valid and denotes a type, then \tcode{iterator_traits::pointer} names that type; -otherwise, it names \tcode{void}. +otherwise, it names \keyword{void}. \item Otherwise, if \tcode{I} satisfies the exposition-only concept @@ -956,7 +956,7 @@ \tcode{pointer} names that type. Otherwise, if \tcode{decltype(\brk{}declval().operator->())} is well-formed, then \tcode{pointer} names that type. Otherwise, \tcode{pointer} -names \tcode{void}. +names \keyword{void}. \item If the \grammarterm{qualified-id} \tcode{I::reference} is valid and denotes a type, \tcode{reference} names that type. Otherwise, \tcode{reference} @@ -998,7 +998,7 @@ \end{codeblock} If the \grammarterm{qualified-id} \tcode{incrementable_traits::difference_type} is valid and denotes a type, -then \tcode{difference_type} names that type; otherwise, it names \tcode{void}. +then \tcode{difference_type} names that type; otherwise, it names \keyword{void}. \item Otherwise, \tcode{iterator_traits} @@ -1291,9 +1291,9 @@ \pnum \begin{note} -\libconcept{indirectly_writable} has the awkward \tcode{const_cast} expressions to reject +\libconcept{indirectly_writable} has the awkward \keyword{const_cast} expressions to reject iterators with prvalue non-proxy reference types that permit rvalue -assignment but do not also permit \tcode{const} rvalue assignment. +assignment but do not also permit \keyword{const} rvalue assignment. Consequently, an iterator type \tcode{I} that returns \tcode{std::string} by value does not model \tcode{\libconcept{indirectly_writable}}. \end{note} @@ -1915,7 +1915,7 @@ \oldconcept{Destructible} requirements\iref{utility.arg.requirements} and lvalues of type \tcode{X} are swappable\iref{swappable.requirements}, and -\item \tcode{iterator_traits::difference_type} is a signed integer type or \tcode{void}, and +\item \tcode{iterator_traits::difference_type} is a signed integer type or \keyword{void}, and \item the expressions in \tref{iterator} are valid and have the indicated semantics. @@ -4638,7 +4638,7 @@ \effects Value-initializes \tcode{last}. If \tcode{is_trivially_default_constructible_v} is \tcode{true}, -then this constructor is a \tcode{constexpr} constructor. +then this constructor is a \keyword{constexpr} constructor. \end{itemdescr} \indexlibraryctor{move_sentinel}% @@ -4814,7 +4814,7 @@ If the expression \tcode{a.operator->()} is well-formed, where \tcode{a} is an lvalue of type \tcode{const common_iterator}, then \tcode{pointer} denotes the type of that expression. -Otherwise, \tcode{pointer} denotes \tcode{void}. +Otherwise, \tcode{pointer} denotes \keyword{void}. \end{itemize} \rSec3[common.iter.const]{Constructors and conversions} @@ -5846,7 +5846,7 @@ \remarks If the initializer \tcode{T()} in the declaration \tcode{auto x = T();} is a constant initializer\iref{expr.const}, -then these constructors are \tcode{constexpr} constructors. +then these constructors are \keyword{constexpr} constructors. \end{itemdescr} @@ -6053,7 +6053,7 @@ \pnum \effects Initializes \tcode{out_stream} with \tcode{addressof(s)} and -\tcode{delim} with \tcode{nullptr}. +\tcode{delim} with \keyword{nullptr}. \end{itemdescr} @@ -6140,7 +6140,7 @@ both construct an end-of-stream iterator object suitable for use as an end-of-range. All specializations of \tcode{istreambuf_iterator} shall have a trivial copy -constructor, a \tcode{constexpr} default constructor, and a trivial destructor. +constructor, a \keyword{constexpr} default constructor, and a trivial destructor. \pnum The result of @@ -6240,7 +6240,7 @@ \begin{itemdescr} \pnum \effects -Initializes \tcode{sbuf_} with \tcode{nullptr}. +Initializes \tcode{sbuf_} with \keyword{nullptr}. \end{itemdescr} diff --git a/source/lex.tex b/source/lex.tex index d145ba5304..b0ef313853 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -404,9 +404,9 @@ \pnum The \grammarterm{import-keyword} is produced -by processing an \tcode{import} directive\iref{cpp.import}, +by processing an \keyword{import} directive\iref{cpp.import}, the \grammarterm{module-keyword} is produced -by preprocessing a \tcode{module} directive\iref{cpp.module}, and +by preprocessing a \keyword{module} directive\iref{cpp.module}, and the \grammarterm{export-keyword} is produced by preprocessing either of the previous two directives. \begin{note} @@ -464,22 +464,22 @@ \begin{tokentable}{Alternative tokens}{lex.digraph}{Alternative}{Primary} \tcode{<\%} & \tcode{\{} & -\tcode{and} & \tcode{\&\&} & -\tcode{and_eq} & \tcode{\&=} \\ \rowsep +\keyword{and} & \tcode{\&\&} & +\keyword{and_eq} & \tcode{\&=} \\ \rowsep \tcode{\%>} & \tcode{\}} & -\tcode{bitor} & \tcode{|} & -\tcode{or_eq} & \tcode{|=} \\ \rowsep +\keyword{bitor} & \tcode{|} & +\keyword{or_eq} & \tcode{|=} \\ \rowsep \tcode{<:} & \tcode{[} & -\tcode{or} & \tcode{||} & -\tcode{xor_eq} & \tcode{\caret=} \\ \rowsep +\keyword{or} & \tcode{||} & +\keyword{xor_eq} & \tcode{\caret=} \\ \rowsep \tcode{:>} & \tcode{]} & -\tcode{xor} & \tcode{\caret} & -\tcode{not} & \tcode{!} \\ \rowsep +\keyword{xor} & \tcode{\caret} & +\keyword{not} & \tcode{!} \\ \rowsep \tcode{\%:} & \tcode{\#} & -\tcode{compl} & \tcode{\~} & -\tcode{not_eq} & \tcode{!=} \\ \rowsep +\keyword{compl} & \tcode{\~} & +\keyword{not_eq} & \tcode{!=} \\ \rowsep \tcode{\%:\%:} & \tcode{\#\#} & -\tcode{bitand} & \tcode{\&} & +\keyword{bitand} & \tcode{\&} & & \\ \end{tokentable}% \indextext{token!alternative|)} @@ -941,8 +941,8 @@ \terminal{= += -= *= /= \%= \caret{}= \&= |=}\br \terminal{== != < > <= >= <=> \&\& ||}\br \terminal{<< >> <<= >>= ++ -- ,}\br - \terminal{and or xor not bitand bitor compl}\br - \terminal{and_eq or_eq xor_eq not_eq} + \terminal{\keyword{and} \keyword{or} \keyword{xor} \keyword{not} \keyword{bitand} \keyword{bitor} \keyword{compl}}\br + \terminal{\keyword{and_eq} \keyword{or_eq} \keyword{xor_eq} \keyword{not_eq}} \end{bnf} Each \grammarterm{operator-or-punctuator} is converted to a single token @@ -1938,7 +1938,7 @@ \end{bnf} \pnum -The pointer literal is the keyword \tcode{nullptr}. It is a prvalue of type +The pointer literal is the keyword \keyword{nullptr}. It is a prvalue of type \tcode{std::nullptr_t}. \begin{note} \tcode{std::nullptr_t} is a distinct type that is neither a pointer type nor a pointer-to-member type; diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 30a27149be..6ef48e7241 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -69,10 +69,10 @@ \pnum The strings library\iref{strings} provides support for manipulating text represented as sequences of type \tcode{char}, -sequences of type \tcode{char8_t}, -sequences of type \tcode{char16_t}, -sequences of type \tcode{char32_t}, -sequences of type \tcode{wchar_t}, +sequences of type \keyword{char8_t}, +sequences of type \keyword{char16_t}, +sequences of type \keyword{char32_t}, +sequences of type \keyword{wchar_t}, and sequences of any other character-like type. \pnum @@ -383,7 +383,7 @@ specified for the function invocations contained in the code sequence. The value returned from \tcode{F} is specified by \tcode{F}'s \Fundescx{Returns} element, or if \tcode{F} has no \Fundescx{Returns} element, -a non-\tcode{void} return from \tcode{F} is specified by the +a non-\keyword{void} return from \tcode{F} is specified by the \tcode{return} statements\iref{stmt.return} in the code sequence. If \tcode{F}'s semantics contains a \Fundescx{Throws}, \Fundescx{Postconditions}, or \Fundescx{Complexity} element, @@ -685,7 +685,7 @@ \tcode{unsigned char}, or \tcode{signed char}\iref{basic.fundamental}, optionally qualified by any combination of -\tcode{const} +\keyword{const} or \tcode{volatile}. The initial elements of the @@ -1405,11 +1405,11 @@ supplied by a \Cpp{} program instantiating a template; \tcode{a}, \tcode{b}, and -\tcode{c} are values of type (possibly \tcode{const}) \tcode{T}; +\tcode{c} are values of type (possibly \keyword{const}) \tcode{T}; \tcode{s} and \tcode{t} are modifiable lvalues of type \tcode{T}; \tcode{u} denotes an identifier; \tcode{rv} is an rvalue of type \tcode{T}; -and \tcode{v} is an lvalue of type (possibly \tcode{const}) \tcode{T} or an rvalue of +and \tcode{v} is an lvalue of type (possibly \keyword{const}) \tcode{T} or an rvalue of type \tcode{const T}. \pnum @@ -1658,9 +1658,9 @@ \pnum In \tref{cpp17.nullablepointer}, \tcode{u} denotes an identifier, \tcode{t} -denotes a non-\tcode{const} lvalue of type \tcode{P}, \tcode{a} and \tcode{b} -denote values of type (possibly \tcode{const}) \tcode{P}, and \tcode{np} denotes -a value of type (possibly \tcode{const}) \tcode{std::nullptr_t}. +denotes a non-\keyword{const} lvalue of type \tcode{P}, \tcode{a} and \tcode{b} +denote values of type (possibly \keyword{const}) \tcode{P}, and \tcode{np} denotes +a value of type (possibly \keyword{const}) \tcode{std::nullptr_t}. \begin{oldconcepttable}{NullablePointer}{}{cpp17.nullablepointer} {lll} @@ -1713,9 +1713,9 @@ \pnum Given \tcode{Key} is an argument type for function objects of type \tcode{H}, in -\tref{cpp17.hash} \tcode{h} is a value of type (possibly \tcode{const}) \tcode{H}, +\tref{cpp17.hash} \tcode{h} is a value of type (possibly \keyword{const}) \tcode{H}, \tcode{u} is an lvalue of type \tcode{Key}, and \tcode{k} is a value of a type convertible to -(possibly \tcode{const}) \tcode{Key}. +(possibly \keyword{const}) \tcode{Key}. \begin{oldconcepttable}{Hash}{}{cpp17.hash} {llp{.55\hsize}} @@ -1781,7 +1781,7 @@ conversion from a value \tcode{q} or a value \tcode{w} \\ \rowsep \tcode{y} & a value of type \tcode{XX::const_void_pointer} obtained by conversion from a result value of \tcode{YY::allocate}, or else a value of -type (possibly \tcode{const}) \tcode{std::nullptr_t} \\ \rowsep +type (possibly \keyword{const}) \tcode{std::nullptr_t} \\ \rowsep \tcode{n} & a value of type \tcode{XX::size_type} \\ \rowsep \tcode{Args} & a template parameter pack \\ \rowsep \tcode{args} & a function parameter pack with the pattern \tcode{Args\&\&} \\ @@ -2006,7 +2006,7 @@ \tcode{X::is_always_equal} & Identical to or derived from \tcode{true_type} or \tcode{false_type} & \tcode{true_type} only if the expression \tcode{a1 == a2} is guaranteed - to be \tcode{true} for any two (possibly \tcode{const}) values + to be \tcode{true} for any two (possibly \keyword{const}) values \tcode{a1}, \tcode{a2} of type \tcode{X}. & \tcode{is_empty::\brk{}type} \\ @@ -2070,7 +2070,7 @@ or \tcode{X::const_pointer}. Then, \tcode{x1} and \tcode{x2} are \defn{equivalently-valued} pointer values, if and only if both \tcode{x1} and \tcode{x2} can be explicitly converted to the two corresponding objects \tcode{px1} and \tcode{px2} -of type \tcode{X::const_pointer}, using a sequence of \tcode{static_cast}s +of type \tcode{X::const_pointer}, using a sequence of \keyword{static_cast}s using only these four types, and the expression \tcode{px1 == px2} evaluates to \tcode{true}. @@ -2610,7 +2610,7 @@ Such replacement occurs prior to program startup~(\ref{basic.def.odr}, \ref{basic.start}). \indextext{startup!program}% The program's declarations shall not be specified as -\tcode{inline}. +\keyword{inline}. No diagnostic is required. \rSec3[handler.functions]{Handler functions} @@ -2931,8 +2931,8 @@ \pnum This document explicitly requires that certain standard library functions are -\tcode{constexpr}\iref{dcl.constexpr}. An implementation shall not declare -any standard library function signature as \tcode{constexpr} except for those where +\keyword{constexpr}\iref{dcl.constexpr}. An implementation shall not declare +any standard library function signature as \keyword{constexpr} except for those where it is explicitly required. Within any header that provides any non-defining declarations of constexpr functions or constructors an implementation shall provide corresponding definitions. @@ -2977,13 +2977,13 @@ A \Cpp{} standard library function shall not directly or indirectly access objects\iref{intro.multithread} accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function's arguments, -including \tcode{this}. +including \keyword{this}. \pnum A \Cpp{} standard library function shall not directly or indirectly modify objects\iref{intro.multithread} accessible by threads other than the current thread unless the objects are accessed directly or indirectly via the function's non-const -arguments, including \tcode{this}. +arguments, including \keyword{this}. \pnum \begin{note} @@ -3051,12 +3051,12 @@ \begin{itemize} \item Every base class described as -\tcode{virtual} +\keyword{virtual} shall be virtual; \indextext{class!base}% \item Every base class not specified as -\tcode{virtual} shall not be virtual; +\keyword{virtual} shall not be virtual; \item Unless explicitly stated otherwise, types with distinct names shall be distinct types. @@ -3090,7 +3090,7 @@ \begin{footnote} That is, the C library functions can all be treated as if they -are marked \tcode{noexcept}. +are marked \keyword{noexcept}. This allows implementations to make performance optimizations based on the absence of exceptions at runtime. \end{footnote} diff --git a/source/limits.tex b/source/limits.tex index c5f90e665c..4a9d97c2e5 100644 --- a/source/limits.tex +++ b/source/limits.tex @@ -69,9 +69,9 @@ files\iref{cpp.include} [256]. \item% Case labels for a -\tcode{switch} +\keyword{switch} statement\iref{stmt.switch} (excluding those for any nested -\tcode{switch} +\keyword{switch} statements) [16\,384]. \item% diff --git a/source/locales.tex b/source/locales.tex index ff5cf869fb..b5c83941bd 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -388,7 +388,7 @@ \oldconcept{OutputIterator} requirements, respectively\iref{iterator.requirements}. A template parameter with name \tcode{C} represents -the set of types containing \tcode{char}, \tcode{wchar_t}, and any other +the set of types containing \keyword{char}, \keyword{wchar_t}, and any other \impldef{set of character types that iostreams templates can be instantiated for} character types @@ -2937,7 +2937,7 @@ namespace std { template class numpunct_byname : public numpunct { - // this class is specialized for \tcode{char} and \tcode{wchar_t}. + // this class is specialized for \tcode{char} and \keyword{wchar_t}. public: using char_type = charT; using string_type = basic_string; diff --git a/source/modules.tex b/source/modules.tex index 9a3deb9b39..4a5ee81404 100644 --- a/source/modules.tex +++ b/source/modules.tex @@ -303,7 +303,7 @@ \end{example} \begin{note} These constraints do not apply to -type names introduced by \tcode{typedef} declarations +type names introduced by \keyword{typedef} declarations and \grammarterm{alias-declaration}{s}. \begin{example} \begin{codeblock} diff --git a/source/numerics.tex b/source/numerics.tex index 24a519e568..0edef29b4b 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -1198,7 +1198,7 @@ conj proj imag real \end{codeblock} -where \tcode{norm}, \tcode{conj}, \tcode{imag}, and \tcode{real} are \tcode{constexpr} overloads. +where \tcode{norm}, \tcode{conj}, \tcode{imag}, and \tcode{real} are \keyword{constexpr} overloads. \pnum \indextext{overloads!floating-point}% @@ -1232,7 +1232,7 @@ \indextext{literal!complex}% \pnum This subclause describes literal suffixes for constructing complex number literals. -The suffixes \tcode{i}, \tcode{il}, and \tcode{if} create complex numbers of +The suffixes \tcode{i}, \tcode{il}, and \keyword{if} create complex numbers of the types \tcode{complex}, \tcode{complex}, and \tcode{complex} respectively, with their imaginary part denoted by the given literal number and the real part being zero. @@ -1358,7 +1358,7 @@ \pnum \remarks -This function is \tcode{constexpr} if and only if +This function is \keyword{constexpr} if and only if \tcode{To}, \tcode{From}, and the types of all subobjects of \tcode{To} and \tcode{From} are types \tcode{T} such that: \begin{itemize} @@ -1990,7 +1990,7 @@ Throughout this subclause \ref{rand}, any constructor that can be called with a single argument and that meets a requirement specified in this subclause -shall be declared \tcode{explicit}. +shall be declared \keyword{explicit}. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Seed Sequence requirements: @@ -2091,7 +2091,7 @@ & same as \tcode{S(il.begin(), il.end())} \\ \rowsep \tcode{q.generate(rb,re)}% - & \tcode{void} + & \keyword{void} & Does nothing if \tcode{rb == re}. Otherwise, fills the supplied sequence $[\tcode{rb},\tcode{re})$ @@ -2109,7 +2109,7 @@ & constant \\ \rowsep \tcode{\tcode{r.param(ob)}}% - & \tcode{void} + & \keyword{void} & Copies to the given destination a sequence of 32-bit units that can be provided @@ -2247,7 +2247,7 @@ \item \tcode{e} is a value of \tcode{E}, \tcode{v} is an lvalue of \tcode{E}, - \tcode{x} and \tcode{y} are (possibly \tcode{const}) values of \tcode{E}; + \tcode{x} and \tcode{y} are (possibly \keyword{const}) values of \tcode{E}; \item \tcode{s} is a value of \tcode{T}; \item @@ -2323,19 +2323,19 @@ whose length is size of state \\ \rowsep \tcode{e.seed()}% - & \tcode{void} + & \keyword{void} & \ensures \tcode{e == E()}. & same as \tcode{E()} \\ \rowsep \tcode{e.seed(s)}% - & \tcode{void} + & \keyword{void} & \ensures \tcode{e == E(s)}. & same as \tcode{E(s)} \\ \rowsep \tcode{e.seed(q)}% - & \tcode{void} + & \keyword{void} & \ensures \tcode{e == E(q)}. & same as \tcode{E(q)} @@ -2358,7 +2358,7 @@ over an equivalent naive loop that makes \tcode{z} consecutive calls \tcode{e()}. \end{footnote} - & \tcode{void} + & \keyword{void} & Advances \tcode{e}'s state \state{e}{i} to $\tcode{e}_{i+\tcode{z}}$ by any means equivalent to \tcode{z} consecutive calls \tcode{e()}. @@ -2630,7 +2630,7 @@ \tcode{d} is a value of \tcode{D}, and - \tcode{x} and \tcode{y} are (possibly \tcode{const}) values of \tcode{D}; + \tcode{x} and \tcode{y} are (possibly \keyword{const}) values of \tcode{D}; \item \tcode{glb} and \tcode{lub} are values of \tcode{T} @@ -2639,7 +2639,7 @@ on the values potentially returned by \tcode{d}'s \tcode{operator()}, as determined by the current values of \tcode{d}'s parameters; \item - \tcode{p} is a (possibly \tcode{const}) value of \tcode{P}; + \tcode{p} is a (possibly \keyword{const}) value of \tcode{P}; \item \tcode{g}, \tcode{g1}, and \tcode{g2} are lvalues of a type meeting the requirements @@ -2697,7 +2697,7 @@ & same as \tcode{p}'s construction \\ \rowsep \tcode{d.reset()} - & \tcode{void} + & \keyword{void} & Subsequent uses of \tcode{d} do not depend on values produced by any engine prior to invoking \tcode{reset}. @@ -2710,7 +2710,7 @@ & no worse than the complexity of \tcode{D(p)} \\ \rowsep \tcode{d.param(p)} - & \tcode{void} + & \keyword{void} & \ensures \tcode{d.param() == p}. & no worse than the complexity of \tcode{D(p)} \\ \rowsep @@ -2812,7 +2812,7 @@ shall be independent of any invocation of \tcode{os << d} or of -any \tcode{const} member function of \tcode{D} +any \keyword{const} member function of \tcode{D} between any of the invocations \tcode{d(g)}. \pnum @@ -2826,11 +2826,11 @@ \pnum It is unspecified whether \tcode{D::param_type} -is declared as a (nested) \tcode{class} -or via a \tcode{typedef}. +is declared as a (nested) \keyword{class} +or via a \keyword{typedef}. In this subclause \ref{rand}, declarations of \tcode{D::param_type} -are in the form of \tcode{typedef}s +are in the form of \keyword{typedef}s for convenience of exposition only. \pnum @@ -3928,7 +3928,7 @@ \pnum \remarks The choice of engine type -named by this \tcode{typedef} +named by this \keyword{typedef} is \impldef{type of \tcode{default_random_engine}}. \begin{note} The implementation @@ -3941,7 +3941,7 @@ for relatively casual, inexpert, and/or lightweight use. Because different implementations can select different underlying engine types, - code that uses this \tcode{typedef} + code that uses this \keyword{typedef} need not generate identical sequences across implementations. \end{note} \end{itemdescr}% @@ -8332,7 +8332,7 @@ \pnum If a degenerate slice is used as the argument to the -non-\tcode{const} +non-\keyword{const} version of \tcode{operator[](const gslice\&)}, the behavior is undefined. diff --git a/source/overloading.tex b/source/overloading.tex index 7cf50773fd..8c78287245 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -189,7 +189,7 @@ member function declaration. \begin{example} For a -\tcode{const} +\keyword{const} member function of class \tcode{X}, @@ -457,7 +457,7 @@ in the call augmented by the addition of an implied object argument as in a qualified function call. If the current class is, or is derived from, \tcode{T}, and the keyword -\tcode{this}\iref{expr.prim.this} refers to it, +\keyword{this}\iref{expr.prim.this} refers to it, then the implied object argument is \tcode{(*this)}. Otherwise, a contrived object of type @@ -1510,7 +1510,7 @@ \tcode{F}. If the parameter has reference type, the implicit conversion sequence includes the operation of binding the reference, and the fact that -an lvalue reference to non-\tcode{const} cannot be bound to an rvalue +an lvalue reference to non-\keyword{const} cannot be bound to an rvalue and that an rvalue reference cannot be bound to an lvalue can affect the viability of the function (see~\ref{over.ics.ref}). @@ -2138,12 +2138,12 @@ Except for an implicit object parameter, for which see~\ref{over.match.funcs}, an implicit conversion sequence cannot be formed if it requires binding an lvalue reference -other than a reference to a non-volatile \tcode{const} type +other than a reference to a non-volatile \keyword{const} type to an rvalue or binding an rvalue reference to an lvalue other than a function lvalue. \begin{note} This means, for example, that a candidate function cannot be a viable -function if it has a non-\tcode{const} lvalue reference parameter (other than +function if it has a non-\keyword{const} lvalue reference parameter (other than the implicit object parameter) and the corresponding argument would require a temporary to be created to initialize the lvalue reference (see~\ref{dcl.init.ref}). @@ -2168,7 +2168,7 @@ match with the parameter. If the function is selected by overload resolution, the call will nonetheless be ill-formed because of -the prohibition on binding a non-\tcode{const} lvalue reference to a bit-field\iref{dcl.init.ref}. +the prohibition on binding a non-\keyword{const} lvalue reference to a bit-field\iref{dcl.init.ref}. \end{example} \rSec4[over.ics.list]{List-initialization sequence} @@ -2656,16 +2656,16 @@ is better than conversion of \tcode{B*} to -\tcode{void*}, +\tcode{\keyword{void}*}, and conversion of \tcode{A*} to -\tcode{void*} +\tcode{\keyword{void}*} is better than conversion of \tcode{B*} to -\tcode{void*}. +\tcode{\keyword{void}*}. \item If class \tcode{B} @@ -3826,7 +3826,7 @@ the constraints described above, they are ordinary namespace-scope functions and function templates. In particular, they are looked up like ordinary functions and function templates and they follow the same overload resolution rules. Also, -they can be declared \tcode{inline} or \tcode{constexpr}, +they can be declared \keyword{inline} or \keyword{constexpr}, they can have internal, module, or external linkage, they can be called explicitly, their addresses can be taken, etc. diff --git a/source/preprocessor.tex b/source/preprocessor.tex index a19ccb057c..436aa27844 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -494,7 +494,7 @@ Thus, the constant expression in the following \tcode{\#if} directive and -\tcode{if} statement\iref{stmt.if} +\keyword{if} statement\iref{stmt.if} is not guaranteed to evaluate to the same value in these two contexts: \begin{codeblock} @@ -1829,7 +1829,7 @@ \indextext{__stdc_mb_might_neq_wc__@\mname{STDC_MB_MIGHT_NEQ_WC}}% \mname{STDC_MB_MIGHT_NEQ_WC}\\ The integer literal \tcode{1}, intended to indicate that, in the encoding for -\tcode{wchar_t}, a member of the basic character set need not have a code value equal to +\keyword{wchar_t}, a member of the basic character set need not have a code value equal to its value when used as the lone character in an ordinary character literal. \item @@ -1844,7 +1844,7 @@ An integer literal of the form \tcode{yyyymmL} (for example, \tcode{199712L}). If this symbol is defined, then every character in the Unicode required set, when -stored in an object of type \tcode{wchar_t}, has the same value as the code point +stored in an object of type \keyword{wchar_t}, has the same value as the code point of that character. The \defn{Unicode required set} consists of all the characters that are defined by ISO/IEC 10646, along with all amendments and technical corrigenda as of the specified year and month. diff --git a/source/ranges.tex b/source/ranges.tex index 695748219f..df8337d1d4 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -2423,7 +2423,7 @@ \pnum \begin{note} -The \tcode{noexcept} clause is needed by the default \tcode{iter_move} +The \keyword{noexcept} clause is needed by the default \tcode{iter_move} implementation. \end{note} \end{itemdescr} diff --git a/source/regex.tex b/source/regex.tex index 1eb7b52085..d3bddffc55 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -13,7 +13,7 @@ \pnum The following subclauses describe a basic regular expression class template and its traits that can handle char-like\iref{strings.general} template arguments, -two specializations of this class template that handle sequences of \tcode{char} and \tcode{wchar_t}, +two specializations of this class template that handle sequences of \tcode{char} and \keyword{wchar_t}, a class template that holds the result of a regular expression match, a series of algorithms that allow a character sequence to be operated upon by a regular expression, @@ -192,7 +192,7 @@ \begin{note} Class template \tcode{regex_traits} meets the requirements for a regular expression traits class when it is specialized for -\tcode{char} or \tcode{wchar_t}. This class template is described in +\tcode{char} or \keyword{wchar_t}. This class template is described in the header \libheader{regex}, and is described in \ref{re.traits}. \end{note} @@ -1101,7 +1101,7 @@ \begin{itemdescr} \pnum \effects -Imbues \tcode{this} with a copy of the +Imbues \keyword{this} with a copy of the locale \tcode{loc}. \begin{note} Calling \tcode{imbue} with a diff --git a/source/statements.tex b/source/statements.tex index bb45c19397..95d406a899 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -77,31 +77,31 @@ \pnum \indextext{\idxgram{condition}{s}!rules for}% The rules for \grammarterm{condition}{s} apply both to -\grammarterm{selection-statement}{s} and to the \tcode{for} and \tcode{while} +\grammarterm{selection-statement}{s} and to the \keyword{for} and \keyword{while} statements\iref{stmt.iter}. A \grammarterm{condition} that is not an \grammarterm{expression} is a declaration\iref{dcl.dcl}. The \grammarterm{declarator} shall not specify a function or an array. The \grammarterm{decl-specifier-seq} shall not -define a class or enumeration. If the \tcode{auto} \grammarterm{type-specifier} appears in +define a class or enumeration. If the \keyword{auto} \grammarterm{type-specifier} appears in the \grammarterm{decl-specifier-seq}, the type of the identifier being declared is deduced from the initializer as described in~\ref{dcl.spec.auto}. \pnum The value of a \grammarterm{condition} that is an initialized declaration -in a statement other than a \tcode{switch} statement is the value of the +in a statement other than a \keyword{switch} statement is the value of the declared variable contextually converted to \tcode{bool}\iref{conv}. If that conversion is ill-formed, the program is ill-formed. The value of a \grammarterm{condition} that is an initialized declaration in a -\tcode{switch} statement is the value of the declared variable if it has +\keyword{switch} statement is the value of the declared variable if it has integral or enumeration type, or of that variable implicitly converted to integral or enumeration type otherwise. The value of a \grammarterm{condition} that is an expression is the value of the expression, contextually converted to \tcode{bool} for statements other -than \tcode{switch}; +than \keyword{switch}; if that conversion is ill-formed, the program is ill-formed. The value of the condition will be referred to as simply ``the condition'' where the usage is unambiguous. @@ -114,7 +114,7 @@ \pnum In the \grammarterm{decl-specifier-seq} of a \grammarterm{condition}, each \grammarterm{decl-specifier} shall be either a \grammarterm{type-specifier} -or \tcode{constexpr}. +or \keyword{constexpr}. \rSec1[stmt.label]{Labeled statement}% \indextext{statement!labeled} @@ -143,7 +143,7 @@ \pnum \indextext{label!\idxcode{case}}% \indextext{label!\idxcode{default}}% -Case labels and default labels shall occur only in \tcode{switch} statements. +Case labels and default labels shall occur only in \keyword{switch} statements. \rSec1[stmt.expr]{Expression statement}% @@ -170,7 +170,7 @@ Most statements are expression statements --- usually assignments or function calls. A null statement is useful to carry a label just before the \tcode{\}} of a compound statement and to supply a null body to an -iteration statement such as a \tcode{while} +iteration statement such as a \keyword{while} statement\iref{stmt.while}. \end{note} @@ -233,21 +233,21 @@ \pnum If the condition\iref{stmt.select} yields \tcode{true} the first -substatement is executed. If the \tcode{else} part of the selection +substatement is executed. If the \keyword{else} part of the selection statement is present and the condition yields \tcode{false}, the second substatement is executed. If the first substatement is reached via a label, the condition is not evaluated and the second substatement is -not executed. In the second form of \tcode{if} statement -(the one including \tcode{else}), if the first substatement is also an -\tcode{if} statement then that inner \tcode{if} statement shall contain -an \tcode{else} part. +not executed. In the second form of \keyword{if} statement +(the one including \keyword{else}), if the first substatement is also an +\keyword{if} statement then that inner \tcode{if} statement shall contain +an \keyword{else} part. \begin{footnote} -In other words, the \tcode{else} is associated with the nearest un-elsed -\tcode{if}. +In other words, the \keyword{else} is associated with the nearest un-elsed +\keyword{if}. \end{footnote} \pnum -If the \tcode{if} statement is of the form \tcode{if constexpr}, the value +If the \keyword{if} statement is of the form \tcode{if constexpr}, the value of the condition shall be a contextually converted constant expression of type \tcode{bool}\iref{expr.const}; this form is called a \defn{constexpr if} statement. If the value of the @@ -261,9 +261,9 @@ Odr-uses\iref{basic.def.odr} in a discarded statement do not require an entity to be defined. \end{note} -A \tcode{case} or \tcode{default} label appearing within such an -\tcode{if} statement shall be associated with a \tcode{switch} -statement\iref{stmt.switch} within the same \tcode{if} statement. +A \keyword{case} or \keyword{default} label appearing within such an +\keyword{if} statement shall be associated with a \keyword{switch} +statement\iref{stmt.switch} within the same \keyword{if} statement. A label\iref{stmt.label} declared in a substatement of a constexpr if statement shall only be referred to by a statement\iref{stmt.goto} in the same substatement. @@ -290,7 +290,7 @@ \end{example} \pnum -An \tcode{if} statement of the form +An \keyword{if} statement of the form \begin{ncsimplebnf} \keyword{if} \opt{\keyword{constexpr}} \terminal{(} init-statement condition \terminal{)} statement \end{ncsimplebnf} @@ -301,7 +301,7 @@ \bnfindent \keyword{if} \opt{\keyword{constexpr}} \terminal{(} condition \terminal{)} statement\br \terminal{\}} \end{ncsimplebnf} -and an \tcode{if} statement of the form +and an \keyword{if} statement of the form \begin{ncsimplebnf} \keyword{if} \opt{\keyword{constexpr}} \terminal{(} init-statement condition \terminal{)} statement \keyword{else} statement \end{ncsimplebnf} @@ -319,7 +319,7 @@ \indextext{statement!\idxcode{switch}} \pnum -The \tcode{switch} statement causes control to be transferred to one of +The \keyword{switch} statement causes control to be transferred to one of several statements depending on the value of a condition. \pnum @@ -331,7 +331,7 @@ promotions\iref{conv.prom}, the condition is converted to the promoted type. Any -statement within the \tcode{switch} statement can be labeled with one or +statement within the \keyword{switch} statement can be labeled with one or more case labels as follows: \begin{ncbnf} \indextext{label!\idxcode{case}}% @@ -348,40 +348,40 @@ \begin{codeblock} default : \end{codeblock} -within a \tcode{switch} statement. +within a \keyword{switch} statement. \pnum -Switch statements can be nested; a \tcode{case} or \tcode{default} label +Switch statements can be nested; a \keyword{case} or \keyword{default} label is associated with the smallest switch enclosing it. \pnum -When the \tcode{switch} statement is executed, its condition is +When the \keyword{switch} statement is executed, its condition is evaluated. \indextext{label!\idxcode{case}}% If one of the case constants has the same value as the condition, control is passed to the statement following the matched case label. If no case constant matches the condition, and if there is a \indextext{label!\idxcode{default}}% -\tcode{default} label, control passes to the statement labeled by the -default label. If no case matches and if there is no \tcode{default} +\keyword{default} label, control passes to the statement labeled by the +default label. If no case matches and if there is no \keyword{default} then none of the statements in the switch is executed. \pnum -\tcode{case} and \tcode{default} labels in themselves do not alter the +\keyword{case} and \keyword{default} labels in themselves do not alter the flow of control, which continues unimpeded across such labels. To exit -from a switch, see \tcode{break}, \ref{stmt.break}. +from a switch, see \keyword{break}, \ref{stmt.break}. \begin{note} Usually, the substatement that is the subject of a switch is compound -and \tcode{case} and \tcode{default} labels appear on the top-level +and \keyword{case} and \keyword{default} labels appear on the top-level statements contained within the (compound) substatement, but this is not required. \indextext{statement!declaration in \tcode{switch}}% Declarations can appear in the substatement of a -\tcode{switch} statement. +\keyword{switch} statement. \end{note} \pnum -A \tcode{switch} statement of the form +A \keyword{switch} statement of the form \begin{ncsimplebnf} \keyword{switch} \terminal{(} init-statement condition \terminal{)} statement \end{ncsimplebnf} @@ -454,21 +454,21 @@ int i; } \end{codeblock} -Thus after the \tcode{while} statement, \tcode{i} is no longer in scope. +Thus after the \keyword{while} statement, \tcode{i} is no longer in scope. \end{example} \rSec2[stmt.while]{The \tcode{while} statement}% \indextext{statement!\idxcode{while}} \pnum -In the \tcode{while} statement the substatement is executed repeatedly +In the \keyword{while} statement the substatement is executed repeatedly until the value of the condition\iref{stmt.select} becomes \tcode{false}. The test takes place before each execution of the substatement. \pnum \indextext{statement!declaration in \tcode{while}}% -A \tcode{while} statement is equivalent to +A \keyword{while} statement is equivalent to \begin{ncsimplebnf} \exposid{label} \terminal{:}\br \terminal{\{}\br @@ -509,7 +509,7 @@ if that conversion is ill-formed, the program is ill-formed. \pnum -In the \tcode{do} statement the substatement is executed repeatedly +In the \keyword{do} statement the substatement is executed repeatedly until the value of the expression becomes \tcode{false}. The test takes place after each execution of the statement. @@ -517,7 +517,7 @@ \indextext{statement!\idxcode{for}} \pnum -The \tcode{for} statement +The \keyword{for} statement \begin{ncsimplebnf} \keyword{for} \terminal{(} init-statement \opt{condition} \terminal{;} \opt{expression} \terminal{)} statement \end{ncsimplebnf} @@ -535,7 +535,7 @@ in the same scope as the \grammarterm{condition}, and except that a \indextext{statement!\tcode{continue} in \tcode{for}}% -\tcode{continue} in \grammarterm{statement} (not enclosed in another +\keyword{continue} in \grammarterm{statement} (not enclosed in another iteration statement) will execute \grammarterm{expression} before re-evaluating \grammarterm{condition}. \begin{note} @@ -550,14 +550,14 @@ Either or both of the \grammarterm{condition} and the \grammarterm{expression} can be omitted. A missing \grammarterm{condition} -makes the implied \tcode{while} clause +makes the implied \keyword{while} clause equivalent to \tcode{while(true)}. \rSec2[stmt.ranged]{The range-based \tcode{for} statement}% \indextext{statement!range based for@range based \tcode{for}} \pnum -The range-based \tcode{for} statement +The range-based \keyword{for} statement \begin{ncsimplebnf} \keyword{for} \terminal{(} \opt{init-statement} for-range-declaration \terminal{:} for-range-initializer \terminal{)} statement \end{ncsimplebnf} @@ -626,7 +626,7 @@ \pnum In the \grammarterm{decl-specifier-seq} of a \grammarterm{for-range-declaration}, each \grammarterm{decl-specifier} shall be either a \grammarterm{type-specifier} -or \tcode{constexpr}. The \grammarterm{decl-specifier-seq} shall not define a +or \keyword{constexpr}. The \grammarterm{decl-specifier-seq} shall not define a class or enumeration.% \indextext{statement!iteration|)} @@ -679,12 +679,12 @@ \indextext{statement!\idxcode{break}} \pnum -The \tcode{break} statement shall occur only in an +The \keyword{break} statement shall occur only in an \indextext{\idxgram{iteration-statement}}% \indextext{statement!\idxcode{switch}}% -\grammarterm{iteration-statement} or a \tcode{switch} statement and causes +\grammarterm{iteration-statement} or a \keyword{switch} statement and causes termination of the smallest enclosing \grammarterm{iteration-statement} or -\tcode{switch} statement; control passes to the statement following the +\keyword{switch} statement; control passes to the statement following the terminated statement, if any. \rSec2[stmt.cont]{The \tcode{continue} statement}% @@ -692,7 +692,7 @@ \pnum The -\tcode{continue} +\keyword{continue} statement shall occur only in an \indextext{\idxgram{iteration-statement}}% \grammarterm{iteration-statement} @@ -731,7 +731,7 @@ \end{codeblock} \end{minipage} -a \tcode{continue} not contained in an enclosed iteration statement is +a \keyword{continue} not contained in an enclosed iteration statement is equivalent to \tcode{goto} \exposid{contin}. \rSec2[stmt.return]{The \tcode{return} statement}% @@ -745,14 +745,14 @@ The \grammarterm{expr-or-braced-init-list} of a \tcode{return} statement is called its operand. A \tcode{return} statement with no operand shall be used only in a function whose return type is -\cv{}~\tcode{void}, a constructor\iref{class.ctor}, or a +\cv{}~\keyword{void}, a constructor\iref{class.ctor}, or a destructor\iref{class.dtor}. \indextext{\idxcode{return}!constructor and}% \indextext{\idxcode{return}!constructor and}% -A \tcode{return} statement with an operand of type \tcode{void} shall be used only -in a function whose return type is \cv{}~\tcode{void}. +A \tcode{return} statement with an operand of type \keyword{void} shall be used only +in a function whose return type is \cv{}~\keyword{void}. A \tcode{return} statement with any other operand shall be used only -in a function whose return type is not \cv{}~\tcode{void}; +in a function whose return type is not \cv{}~\keyword{void}; \indextext{conversion!return type}% the \tcode{return} statement initializes the glvalue result or prvalue result object of the (explicit or implicit) function call @@ -781,7 +781,7 @@ Flowing off the end of a constructor, a destructor, or -a non-coroutine function with a \cv{}~\tcode{void} return type is +a non-coroutine function with a \cv{}~\keyword{void} return type is equivalent to a \tcode{return} with no operand. Otherwise, flowing off the end of a function other than \tcode{main}\iref{basic.start.main} or a coroutine\iref{dcl.fct.def.coroutine} @@ -827,15 +827,15 @@ and \placeholder{S} is defined as follows: \begin{itemize} \item -If the operand is a \grammarterm{braced-init-list} or an expression of non-\tcode{void} type, +If the operand is a \grammarterm{braced-init-list} or an expression of non-\keyword{void} type, \placeholder{S} is \placeholder{p}\tcode{.return_value(}\grammarterm{expr-or-braced-init-list}{}\tcode{)}. -The expression \placeholder{S} shall be a prvalue of type \tcode{void}. +The expression \placeholder{S} shall be a prvalue of type \keyword{void}. \item Otherwise, \placeholder{S} is the \grammarterm{compound-statement} \tcode{\{}{ }\opt{\grammarterm{expression}} \tcode{;} \placeholder{p}\tcode{.return_void()}\tcode{;{ }\}}. The expression \placeholder{p}\tcode{.return_void()} -shall be a prvalue of type \tcode{void}. +shall be a prvalue of type \keyword{void}. \end{itemize} \pnum @@ -893,8 +893,8 @@ unless all such variables have vacuous initialization\iref{basic.life}, the transfer of control shall not be a jump. \begin{footnote} -The transfer from the condition of a \tcode{switch} statement to a -\tcode{case} label is considered a jump in this respect. +The transfer from the condition of a \keyword{switch} statement to a +\keyword{case} label is considered a jump in this respect. \end{footnote} When a \grammarterm{declaration-statement} is executed, $P$ and $Q$ are the points immediately before and after it; diff --git a/source/strings.tex b/source/strings.tex index 4fb7250836..fddb71a10b 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -4974,7 +4974,7 @@ \pnum Let \tcode{S} be \tcode{basic_string_view}, and \tcode{sv} be an instance of \tcode{S}. -Implementations shall provide sufficient additional overloads marked \tcode{constexpr} and \tcode{noexcept} +Implementations shall provide sufficient additional overloads marked \keyword{constexpr} and \keyword{noexcept} so that an object \tcode{t} with an implicit conversion to \tcode{S} can be compared according to \tref{string.view.comparison.overloads}. \begin{libtab2}{Additional \tcode{basic_string_view} comparison overloads}{string.view.comparison.overloads}{cc}{Expression}{Equivalent to} \tcode{t == sv} & \tcode{S(t) == sv} \\ @@ -5492,7 +5492,7 @@ \pnum The contents and meaning of the header \libheader{cwchar} are the same as the C standard library header -\libheader{wchar.h}, except that it does not declare a type \tcode{wchar_t}. +\libheader{wchar.h}, except that it does not declare a type \keyword{wchar_t}. \pnum \begin{note} @@ -5533,7 +5533,7 @@ are the same as the C standard library header \libheader{uchar.h}, except that it declares the additional \tcode{mbrtoc8} and \tcode{c8rtomb} functions -and does not declare types \tcode{char16_t} nor \tcode{char32_t}. +and does not declare types \keyword{char16_t} nor \keyword{char32_t}. \xrefc{7.28} @@ -5692,7 +5692,7 @@ \pnum \returns The number of bytes stored in the array object (including any shift sequences). -If \tcode{c8} does not contribute to a sequence of \tcode{char8_t} +If \tcode{c8} does not contribute to a sequence of \keyword{char8_t} corresponding to a valid multibyte character, the value of the macro \tcode{EILSEQ} is stored in \tcode{errno}, \tcode{(size_t) (-1)} is returned, and the conversion state is unspecified. diff --git a/source/support.tex b/source/support.tex index df19a26c7b..072ef10913 100644 --- a/source/support.tex +++ b/source/support.tex @@ -86,7 +86,7 @@ \pnum The contents and meaning of the header \libheaderdef{cstddef} are the same as the C standard library header \libheader{stddef.h}, -except that it does not declare the type \tcode{wchar_t}, +except that it does not declare the type \keyword{wchar_t}, that it also declares the type \tcode{byte} and its associated operations\iref{support.types.byteops}, and as noted in @@ -240,7 +240,7 @@ \pnum The contents and meaning of the header \libheader{cstdlib} are the same as the C standard library header \libheader{stdlib.h}, -except that it does not declare the type \tcode{wchar_t}, +except that it does not declare the type \keyword{wchar_t}, and except as noted in \ref{support.types.nullptr}, \ref{support.types.layout}, @@ -262,11 +262,11 @@ \pnum \indexlibraryglobal{nullptr_t}% The type \tcode{nullptr_t} is a synonym -for the type of a \tcode{nullptr} expression, and it +for the type of a \keyword{nullptr} expression, and it has the characteristics described in~\ref{basic.fundamental} and~\ref{conv.ptr}. \begin{note} -Although \tcode{nullptr}'s address cannot be taken, the address of another +Although \keyword{nullptr}'s address cannot be taken, the address of another \tcode{nullptr_t} object that is an lvalue can be taken. \end{note} @@ -882,7 +882,7 @@ \pnum For all members declared -\tcode{static} \tcode{constexpr} +\keyword{static} \keyword{constexpr} in the \tcode{numeric_limits} template, specializations shall define these values in such a way @@ -2355,7 +2355,7 @@ \begin{example} \begin{codeblock} T* p1 = new T; // throws \tcode{bad_alloc} if it fails -T* p2 = new(nothrow) T; // returns \tcode{nullptr} if it fails +T* p2 = new(nothrow) T; // returns \keyword{nullptr} if it fails \end{codeblock} \end{example} \end{itemdescr} @@ -2539,12 +2539,12 @@ \tcode{operator delete[]} to note the repetition count or element size of the array. Those operations are performed elsewhere in the array -\tcode{new} +\keyword{new} and -\tcode{delete} +\keyword{delete} expressions. The array -\tcode{new} +\keyword{new} expression, can, however, increase the \tcode{size} argument to \tcode{operator new[]} to obtain space to store supplemental information. @@ -3050,7 +3050,7 @@ struct X { int n; }; const X *p = new const X{3}; const int a = p->n; -new (const_cast(p)) const X{5}; // \tcode{p} does not point to new object\iref{basic.life} because its type is \tcode{const} +new (const_cast(p)) const X{5}; // \tcode{p} does not point to new object\iref{basic.life} because its type is \keyword{const} const int b = p->n; // undefined behavior const int c = std::launder(p)->n; // OK \end{codeblock} @@ -3248,7 +3248,7 @@ defines the type of objects thrown as exceptions by the implementation to report the execution of an invalid \indextext{cast!dynamic}% -\tcode{dynamic_cast} +\keyword{dynamic_cast} expression\iref{expr.dynamic.cast}. \indexlibrarymember{what}{bad_cast}% @@ -3637,7 +3637,7 @@ suitable for conversion and display as a \tcode{wstring}~(\ref{string.classes}, \ref{locale.codecvt}). The return value remains valid until the exception object from which -it is obtained is destroyed or a non-\tcode{const} +it is obtained is destroyed or a non-\keyword{const} member function of the exception object is called. \end{itemdescr} @@ -3936,7 +3936,7 @@ \pnum \begin{note} \tcode{nested_exception} has a virtual destructor to make it a -polymorphic class. Its presence can be tested for with \tcode{dynamic_cast}. +polymorphic class. Its presence can be tested for with \keyword{dynamic_cast}. \end{note} \indexlibraryctor{nested_exception}% @@ -4669,7 +4669,7 @@ The member \grammarterm{typedef-name} \tcode{type} denotes the common comparison type\iref{class.spaceship} of \tcode{Ts...}, the expanded parameter pack, or -\tcode{void} if any element of \tcode{Ts} +\keyword{void} if any element of \tcode{Ts} is not a comparison category type. \begin{note} This is \tcode{std::strong_ordering} if the expansion is empty. @@ -5754,7 +5754,7 @@ has more restricted behavior in this document. A \tcode{setjmp}/\tcode{longjmp} call pair has undefined behavior if replacing the \tcode{setjmp} and \tcode{longjmp} -by \tcode{catch} and \tcode{throw} would invoke any non-trivial destructors for any objects +by \keyword{catch} and \tcode{throw} would invoke any non-trivial destructors for any objects with automatic storage duration. A call to \tcode{setjmp} or \tcode{longjmp} has undefined behavior if invoked in a suspension context of a coroutine\iref{expr.await}. @@ -5837,7 +5837,7 @@ except for plain lock-free atomic operations and functions explicitly identified as signal-safe; \begin{note} -This implicitly excludes the use of \tcode{new} and \tcode{delete} expressions +This implicitly excludes the use of \keyword{new} and \keyword{delete} expressions that rely on a library-provided memory allocator. \end{note} @@ -5845,7 +5845,7 @@ an access to an object with thread storage duration; \item -a \tcode{dynamic_cast} expression; +a \keyword{dynamic_cast} expression; \item throwing of an exception; diff --git a/source/templates.tex b/source/templates.tex index bfb9318e21..a0cc7fb4cc 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -258,16 +258,16 @@ \pnum There is no semantic difference between -\tcode{class} +\keyword{class} and -\tcode{typename} +\keyword{typename} in a \grammarterm{type-parameter-key}. -\tcode{typename} +\keyword{typename} followed by an \grammarterm{unqualified-id} names a template type parameter. -\tcode{typename} +\keyword{typename} followed by a \grammarterm{qualified-id} denotes the type in a non-type @@ -284,7 +284,7 @@ \end{footnote} \grammarterm{parameter-declaration}. A \grammarterm{template-parameter} of the form -\tcode{class} \grammarterm{identifier} is a \grammarterm{type-parameter}. +\keyword{class} \grammarterm{identifier} is a \grammarterm{type-parameter}. \begin{example} \begin{codeblock} class T { @\commentellip@ }; @@ -438,7 +438,7 @@ \begin{note} A non-type \grammarterm{template-parameter} -cannot be declared to have type \cv{} \tcode{void}. +cannot be declared to have type \cv{} \keyword{void}. \begin{example} \begin{codeblock} template class X; // error @@ -747,8 +747,8 @@ \tcode{>} \begin{footnote} A \tcode{>} that encloses the \grammarterm{type-id} -of a \tcode{dynamic_cast}, \tcode{static_cast}, \tcode{reinterpret_cast} -or \tcode{const_cast}, or which encloses the \grammarterm{template-argument}{s} +of a \keyword{dynamic_cast}, \keyword{static_cast}, \keyword{reinterpret_cast} +or \keyword{const_cast}, or which encloses the \grammarterm{template-argument}{s} of a subsequent \grammarterm{template-id}, is considered nested for the purpose of this description. \end{footnote} @@ -797,7 +797,7 @@ \end{note} \begin{note} As is the case with the -\tcode{typename} +\keyword{typename} prefix, the \keyword{template} prefix is allowed @@ -1239,7 +1239,7 @@ B<5> b1; // OK, template parameter type is \tcode{int} B<'a'> b2; // OK, template parameter type is \tcode{char} B<2.5> b3; // OK, template parameter type is \tcode{double} -B b4; // error: template parameter type cannot be \tcode{void} +B b4; // error: template parameter type cannot be \keyword{void} \end{codeblock} \end{example} @@ -3114,7 +3114,7 @@ When a friend declaration refers to a specialization of a function template, the function parameter declarations shall not include default arguments, nor shall -the \tcode{inline}, \tcode{constexpr}, or \tcode{consteval} specifiers +the \keyword{inline}, \keyword{constexpr}, or \keyword{consteval} specifiers be used in such a declaration. \pnum @@ -4294,10 +4294,10 @@ A \grammarterm{typename-specifier} denotes the type or class template denoted by the \grammarterm{simple-type-specifier}\iref{dcl.type.simple} -formed by omitting the keyword \tcode{typename}. +formed by omitting the keyword \keyword{typename}. \begin{note} The usual qualified name lookup\iref{basic.lookup.qual} applies -even in the presence of \tcode{typename}. +even in the presence of \keyword{typename}. \end{note} \begin{example} \begin{codeblock} @@ -4369,18 +4369,18 @@ \begin{codeblock} template T::R f(); // OK, return type of a function declaration at global scope template void f(T::R); // ill-formed, no diagnostic required: attempt to declare - // a \tcode{void} variable template + // a \keyword{void} variable template template struct S { using Ptr = PtrTraits::Ptr; // OK, in a \grammarterm{defining-type-id} T::R f(T::P p) { // OK, class scope - return static_cast(p); // OK, \grammarterm{type-id} of a \tcode{static_cast} + return static_cast(p); // OK, \grammarterm{type-id} of a \keyword{static_cast} } auto g() -> S::Ptr; // OK, \grammarterm{trailing-return-type} }; template void f() { - void (*pf)(T::X); // variable \tcode{pf} of type \tcode{void*} initialized with \tcode{T::X} + void (*pf)(T::X); // variable \tcode{pf} of type \tcode{\keyword{void}*} initialized with \tcode{T::X} void g(T::X); // error: \tcode{T::X} at block scope does not denote a type - // (attempt to declare a \tcode{void} variable) + // (attempt to declare a \keyword{void} variable) } \end{codeblock} \end{example} @@ -4466,7 +4466,7 @@ instantiation uses \begin{itemize} \item the value of a const object of integral or unscoped enumeration type or - \item the value of a \tcode{constexpr} object or + \item the value of a \keyword{constexpr} object or \item the value of a reference or \item the definition of a constexpr function, \end{itemize} @@ -5030,7 +5030,7 @@ subexpression is type-dependent. \pnum -\tcode{this} +\keyword{this} is type-dependent if the current class\iref{expr.prim.this} is dependent\iref{temp.dep.type}. @@ -5868,7 +5868,7 @@ \end{codeblock} Nothing in this example requires -\tcode{class} +\keyword{class} \tcode{Z}, \tcode{Z::g()}, or @@ -6106,7 +6106,7 @@ There are two forms of explicit instantiation: an explicit instantiation definition and an explicit instantiation declaration. An explicit instantiation -declaration begins with the \tcode{extern} keyword. +declaration begins with the \keyword{extern} keyword. \pnum An explicit instantiation shall not use @@ -6117,7 +6117,7 @@ member function of a class template, or variable template shall not -use the \tcode{inline}, \tcode{constexpr}, or \tcode{consteval} specifiers. +use the \keyword{inline}, \keyword{constexpr}, or \keyword{consteval} specifiers. No \grammarterm{attribute-specifier-seq}\iref{dcl.attr.grammar} shall appertain to an explicit instantiation. @@ -6179,7 +6179,7 @@ template int *var; // error: instantiated variable has type \tcode{int} template auto av = T(); -template int av; // OK, variable with type \tcode{int} can be redeclared with type \tcode{auto} +template int av; // OK, variable with type \tcode{int} can be redeclared with type \keyword{auto} template auto f() {} template void f(); // error: function with deduced return type @@ -6989,16 +6989,16 @@ template void h(Z, Z*); int main() { - // \#1: function type is \tcode{f(int)}, \tcode{t} is non \tcode{const} + // \#1: function type is \tcode{f(int)}, \tcode{t} is non \keyword{const} f(1); - // \#2: function type is \tcode{f(int)}, \tcode{t} is \tcode{const} + // \#2: function type is \tcode{f(int)}, \tcode{t} is \keyword{const} f(1); - // \#3: function type is \tcode{g(int)}, \tcode{x} is \tcode{const} + // \#3: function type is \tcode{g(int)}, \tcode{x} is \keyword{const} g(1); - // \#4: function type is \tcode{g(int)}, \tcode{x} is \tcode{const} + // \#4: function type is \tcode{g(int)}, \tcode{x} is \keyword{const} g(1); // \#5: function type is \tcode{h(int, const int*)} @@ -7080,7 +7080,7 @@ }; int main() { ZZ zz; - f(1, a); // OK, deduction fails for \#1 because there is no conversion from \tcode{int} to \tcode{void*} + f(1, a); // OK, deduction fails for \#1 because there is no conversion from \tcode{int} to \tcode{\keyword{void}*} f(zz, 42); // OK, deduction fails for \#1 because \tcode{C} is not satisfied } \end{codeblock} @@ -7100,7 +7100,7 @@ type and in template parameter declarations. The expressions include not only constant expressions such as those that appear in array bounds or as nontype template arguments but also general expressions (i.e., non-constant expressions) -inside \tcode{sizeof}, \tcode{decltype}, and other contexts that allow non-constant +inside \tcode{sizeof}, \keyword{decltype}, and other contexts that allow non-constant expressions. The substitution proceeds in lexical order and stops when a condition that causes deduction to fail is encountered. If substitution into different declarations of the same function template would @@ -7213,7 +7213,7 @@ \begin{itemize} \item Attempting to instantiate a pack expansion containing multiple packs of differing lengths. \item -Attempting to create an array with an element type that is \tcode{void}, a +Attempting to create an array with an element type that is \keyword{void}, a function type, or a reference type, or attempting to create an array with a size that is zero or negative. \begin{example} @@ -7271,7 +7271,7 @@ \item Attempting to create a pointer to reference type. \item -Attempting to create a reference to \tcode{void}. +Attempting to create a reference to \keyword{void}. \item Attempting to create ``pointer to member of \tcode{T}'' when \tcode{T} is not a class type. @@ -7305,7 +7305,7 @@ \item Attempting to create a function type in which a parameter has a type -of \tcode{void}, or in which the return type is a function type +of \keyword{void}, or in which the return type is a function type or array type. \end{itemize} \end{note} @@ -7742,7 +7742,7 @@ \item If the original \tcode{A} is a function pointer or pointer-to-member-function type, -its \tcode{noexcept}. +its \keyword{noexcept}. \item Any cv-qualifiers in \tcode{A} that can be restored by a qualification conversion. @@ -8118,7 +8118,7 @@ \tcode{T} are non-deduced. If a type is specified as -\tcode{void} +\keyword{void} \tcode{f(typename} \tcode{A::B,} \tcode{A)}, diff --git a/source/threads.tex b/source/threads.tex index 40f87717de..4597e8a0d0 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -2172,7 +2172,7 @@ The calling thread owns the mutex. \pnum -\returntype \tcode{void}. +\returntype \keyword{void}. \pnum \throws @@ -2249,7 +2249,7 @@ Releases the calling thread's ownership of the mutex. \pnum -\returntype \tcode{void}. +\returntype \keyword{void}. \pnum \sync @@ -2643,7 +2643,7 @@ The calling thread has a shared lock on the mutex. \pnum -\returntype \tcode{void}. +\returntype \keyword{void}. \pnum \throws @@ -2670,7 +2670,7 @@ Releases a shared lock on the mutex held by the calling thread. \pnum -\returntype \tcode{void}. +\returntype \keyword{void}. \pnum \sync @@ -3397,7 +3397,7 @@ \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}. +\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. \item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is \tcode{true}. \end{itemize} @@ -3435,7 +3435,7 @@ \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}. +\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. \item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is \tcode{true}. \end{itemize} @@ -3474,7 +3474,7 @@ \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}. +\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. \item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is \tcode{true}. \end{itemize} @@ -3511,7 +3511,7 @@ \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}. +\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. \item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is \tcode{true}. \end{itemize} @@ -3879,7 +3879,7 @@ \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}. +\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. \item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is \tcode{true}. \end{itemize} @@ -3912,7 +3912,7 @@ \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}. +\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. \item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is \tcode{true}. \end{itemize} @@ -3952,7 +3952,7 @@ \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}. +\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. \item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is \tcode{true}. \end{itemize} @@ -3989,7 +3989,7 @@ \pnum \errors \begin{itemize} -\item \tcode{operation_not_permitted} --- if \tcode{pm} is \tcode{nullptr}. +\item \tcode{operation_not_permitted} --- if \tcode{pm} is \keyword{nullptr}. \item \tcode{resource_deadlock_would_occur} --- if on entry \tcode{owns} is \tcode{true}. \end{itemize} @@ -5998,7 +5998,7 @@ \end{codeblock} \pnum -The \tcode{enum} type \tcode{launch} is a bitmask type\iref{bitmask.types} with +The \keyword{enum} type \tcode{launch} is a bitmask type\iref{bitmask.types} with elements \tcode{launch::async} and \tcode{launch::deferred}. \begin{note} Implementations can provide bitmasks to specify restrictions on task diff --git a/source/time.tex b/source/time.tex index 40656c65e8..506854d055 100644 --- a/source/time.tex +++ b/source/time.tex @@ -28,7 +28,7 @@ \indextext{STATICALLY-WIDEN@\exposid{STATICALLY-WIDEN}}% Let \exposid{STATICALLY-WIDEN}\tcode{("...")} be \tcode{"..."} if \tcode{charT} is \tcode{char} and -\tcode{L"..."} if \tcode{charT} is \tcode{wchar_t}. +\tcode{L"..."} if \tcode{charT} is \keyword{wchar_t}. \rSec1[time.syn]{Header \tcode{} synopsis} @@ -1135,7 +1135,7 @@ \pnum \begin{note} -The \tcode{typedef} name \tcode{type} is a synonym for the +The \keyword{typedef} name \tcode{type} is a synonym for the \tcode{duration} with the largest tick \tcode{period} possible where both \tcode{duration} arguments will convert to it without requiring a division operation. The representation of this type is intended to be able to hold any @@ -1821,7 +1821,7 @@ \pnum \begin{note} This function does not use any implicit conversions; all conversions -are done with \tcode{static_cast}. It avoids multiplications and divisions when +are done with \keyword{static_cast}. It avoids multiplications and divisions when it is known at compile time that one or more arguments is 1. Intermediate computations are carried out in the widest representation and only converted to the destination representation at the final step. diff --git a/source/utilities.tex b/source/utilities.tex index 72437e4c04..9f206dc7f9 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -565,10 +565,10 @@ These function templates cannot be used to compare \tcode{byte}, \tcode{char}, -\tcode{char8_t}, -\tcode{char16_t}, -\tcode{char32_t}, -\tcode{wchar_t}, and +\keyword{char8_t}, +\keyword{char16_t}, +\keyword{char32_t}, +\keyword{wchar_t}, and \tcode{bool}. \end{note} @@ -740,7 +740,7 @@ \pnum \remarks -The expression inside \tcode{explicit} evaluates to \tcode{true} +The expression inside \keyword{explicit} evaluates to \tcode{true} if and only if either \tcode{first_type} or \tcode{second_type} is not implicitly default-constructible. \begin{note} @@ -769,7 +769,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !is_convertible_v || !is_convertible_v @@ -797,7 +797,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !is_convertible_v || !is_convertible_v \end{codeblock} @@ -822,7 +822,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !is_convertible_v || !is_convertible_v \end{codeblock} @@ -850,7 +850,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !is_convertible_v || !is_convertible_v \end{codeblock} @@ -1189,7 +1189,7 @@ \end{itemdecl} \pnum -The \tcode{struct} \tcode{piecewise_construct_t} is an empty class type +The \keyword{struct} \tcode{piecewise_construct_t} is an empty class type used as a unique type to disambiguate constructor and function overloading. Specifically, \tcode{pair} has a constructor with \tcode{piecewise_construct_t} as the first argument, immediately followed by two \tcode{tuple}\iref{tuple} arguments used @@ -1425,7 +1425,7 @@ \pnum \remarks -The expression inside \tcode{explicit} evaluates to \tcode{true} +The expression inside \keyword{explicit} evaluates to \tcode{true} if and only if $\tcode{T}_i$ is not copy-list-initializable from an empty list for at least one $i$. @@ -1453,7 +1453,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !conjunction_v...> \end{codeblock} @@ -1478,7 +1478,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !conjunction_v...> \end{codeblock} @@ -1545,7 +1545,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !conjunction_v...> \end{codeblock} @@ -1582,7 +1582,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !conjunction_v...> \end{codeblock} @@ -1610,7 +1610,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !is_convertible_v || !is_convertible_v \end{codeblock} @@ -1639,7 +1639,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !is_convertible_v || !is_convertible_v \end{codeblock} @@ -2710,7 +2710,7 @@ \remarks If \tcode{T}'s selected constructor is a constexpr constructor, this constructor is a constexpr constructor. -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !is_convertible_v \end{codeblock} @@ -2752,7 +2752,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !is_convertible_v \end{codeblock} @@ -2795,7 +2795,7 @@ \pnum \remarks -The expression inside \tcode{explicit} is equivalent to: +The expression inside \keyword{explicit} is equivalent to: \begin{codeblock} !is_convertible_v \end{codeblock} @@ -3911,7 +3911,7 @@ if \tcode{bool(o) == true}, then \tcode{hash>()(o)} evaluates to the same value as \tcode{hash>()(*o)}; otherwise it evaluates to an unspecified value. -The member functions are not guaranteed to be \tcode{noexcept}. +The member functions are not guaranteed to be \keyword{noexcept}. \end{itemdescr} @@ -4142,7 +4142,7 @@ \pnum \remarks -This function is \tcode{constexpr} if and only if the +This function is \keyword{constexpr} if and only if the value-initialization of the alternative type $\tcode{T}_0$ would satisfy the requirements for a constexpr function. The exception specification is equivalent to @@ -4964,7 +4964,7 @@ \pnum \returns A pointer to the value stored in the \tcode{variant}, if \tcode{v != nullptr} -and \tcode{v->index() == I}. Otherwise, returns \tcode{nullptr}. +and \tcode{v->index() == I}. Otherwise, returns \keyword{nullptr}. \end{itemdescr} \indexlibraryglobal{get_if}% @@ -5304,7 +5304,7 @@ \pnum The specialization \tcode{hash>} is enabled\iref{unord.hash} if and only if every specialization in \tcode{hash>...} is enabled. -The member functions are not guaranteed to be \tcode{noexcept}. +The member functions are not guaranteed to be \keyword{noexcept}. \end{itemdescr} \indexlibrarymember{hash}{monostate}% @@ -5935,7 +5935,7 @@ \returns If \tcode{operand != nullptr \&\& operand->type() == typeid(T)}, a pointer to the object contained by \tcode{operand}; -otherwise, \tcode{nullptr}. +otherwise, \keyword{nullptr}. \pnum \begin{example} @@ -7385,7 +7385,7 @@ \pnum \remarks -If \tcode{element_type} is \cv{}~\tcode{void}, the type of +If \tcode{element_type} is \cv{}~\keyword{void}, the type of \tcode{r} is unspecified; otherwise, it is \tcode{element_type\&}. \end{itemdescr} @@ -8558,7 +8558,7 @@ \pnum \effects -Calls \tcode{delete} on \tcode{ptr}. +Calls \keyword{delete} on \tcode{ptr}. \end{itemdescr} \rSec4[unique.ptr.dltr.dflt1]{\tcode{default_delete}} @@ -9115,7 +9115,7 @@ \pnum \effects Assigns \tcode{p} to the stored pointer, and then if and only if the old value of the -stored pointer, \tcode{old_p}, was not equal to \tcode{nullptr}, calls +stored pointer, \tcode{old_p}, was not equal to \keyword{nullptr}, calls \tcode{get_deleter()(old_p)}. \begin{note} The order of these operations is significant @@ -9738,7 +9738,7 @@ \pnum \indexlibraryglobal{shared_ptr}% The \tcode{shared_ptr} class template stores a pointer, usually obtained -via \tcode{new}. \tcode{shared_ptr} implements semantics of shared ownership; +via \keyword{new}. \tcode{shared_ptr} implements semantics of shared ownership; the last remaining owner of the pointer is responsible for destroying the object, or otherwise releasing the resources associated with the stored pointer. A \tcode{shared_ptr} is said to be empty if it does not own a pointer. @@ -10299,7 +10299,7 @@ \pnum \remarks -When \tcode{T} is an array type or \cv{}~\tcode{void}, +When \tcode{T} is an array type or \cv{}~\keyword{void}, it is unspecified whether this member function is declared. If it is declared, it is unspecified what its return type is, except that the declaration (although not necessarily the @@ -11011,7 +11011,7 @@ \pnum \returns If \tcode{p} owns a deleter \tcode{d} of type cv-unqualified -\tcode{D}, returns \tcode{addressof(d)}; otherwise returns \tcode{nullptr}. +\tcode{D}, returns \tcode{addressof(d)}; otherwise returns \keyword{nullptr}. The returned pointer remains valid as long as there exists a \tcode{shared_ptr} instance that owns \tcode{d}. @@ -11488,7 +11488,7 @@ When enabled, for an object \tcode{p} of type \tcode{UP}, \tcode{hash()(p)} evaluates to the same value as \tcode{hash()(p.get())}. -The member functions are not guaranteed to be \tcode{noexcept}. +The member functions are not guaranteed to be \keyword{noexcept}. \end{itemdescr} \indexlibrarymember{hash}{shared_ptr}% @@ -11673,10 +11673,10 @@ \begin{itemdescr} \pnum \returns -A derived class shall implement this function to return \tcode{true} if memory allocated from \tcode{this} can be deallocated from \tcode{other} and vice-versa, +A derived class shall implement this function to return \tcode{true} if memory allocated from \keyword{this} can be deallocated from \tcode{other} and vice-versa, otherwise \tcode{false}. \begin{note} -It is possible that the most-derived type of \tcode{other} does not match the type of \tcode{this}. +It is possible that the most-derived type of \tcode{other} does not match the type of \keyword{this}. For a derived class \tcode{D}, an implementation of this function can immediately return \tcode{false} if \tcode{dynamic_cast(\&other) == nullptr}. @@ -12480,7 +12480,7 @@ \pnum \effects Sets \tcode{upstream_rsrc} to \tcode{upstream} and -\tcode{current_buffer} to \tcode{nullptr}. +\tcode{current_buffer} to \keyword{nullptr}. If \tcode{initial_size} is specified, sets \tcode{next_buffer_size} to at least \tcode{initial_size}; otherwise sets \tcode{next_buffer_size} to an @@ -12537,8 +12537,8 @@ \pnum \begin{note} The memory is released back to \tcode{upstream_rsrc} -even if some blocks that were allocated from \tcode{this} -have not been deallocated from \tcode{this}. +even if some blocks that were allocated from \keyword{this} +have not been deallocated from \keyword{this}. \end{note} \end{itemdescr} @@ -13330,7 +13330,7 @@ \indexlibrary{invoke@\tcode{\placeholder{INVOKE}}}% Define \tcode{\placeholdernc{INVOKE}(f, t$_1$, t$_2$, $\dotsc$, t$_N$)} as \tcode{static_cast(\placeholdernc{INVOKE}(f, t$_1$, t$_2$, $\dotsc$, t$_N$))} -if \tcode{R} is \cv{}~\tcode{void}, otherwise +if \tcode{R} is \cv{}~\keyword{void}, otherwise \tcode{\placeholdernc{INVOKE}(f, t$_1$, t$_2$, $\dotsc$, t$_N$)} implicitly converted to \tcode{R}. @@ -13390,7 +13390,7 @@ \begin{note} This implies that each of the copy/move constructors has the same exception-specification as -the corresponding implicit definition and is declared as \tcode{constexpr} +the corresponding implicit definition and is declared as \keyword{constexpr} if the corresponding implicit definition would be considered to be constexpr. \end{note} @@ -15330,7 +15330,7 @@ \begin{itemdescr} \pnum \effects -If \tcode{*this != nullptr}, destroys the target of \tcode{this}. +If \tcode{*this != nullptr}, destroys the target of \keyword{this}. \pnum \ensures @@ -15384,7 +15384,7 @@ \begin{itemdescr} \pnum \effects -If \tcode{*this != nullptr}, destroys the target of \tcode{this}. +If \tcode{*this != nullptr}, destroys the target of \keyword{this}. \end{itemdescr} \rSec4[func.wrap.func.mod]{Modifiers} @@ -15806,7 +15806,7 @@ \pnum If the library provides an explicit or partial specialization of \tcode{hash}, that specialization is enabled except as noted otherwise, -and its member functions are \tcode{noexcept} except as noted otherwise. +and its member functions are \keyword{noexcept} except as noted otherwise. \pnum If \tcode{H} is a disabled specialization of \tcode{hash}, @@ -16422,7 +16422,7 @@ \indexlibraryglobal{is_void}% \tcode{template}\br \tcode{struct is_void;} & -\tcode{T} is \tcode{void} & \\ \rowsep +\tcode{T} is \keyword{void} & \\ \rowsep \indexlibraryglobal{is_null_pointer}% \tcode{template}\br \tcode{struct is_null_pointer;} & @@ -16579,21 +16579,21 @@ \tcode{struct is_trivial;} & \tcode{T} is a trivial type\iref{basic.types} & \tcode{remove_all_extents_t} shall be a complete - type or \cv{}~\tcode{void}. \\ \rowsep + type or \cv{}~\keyword{void}. \\ \rowsep \indexlibraryglobal{is_trivially_copyable}% \tcode{template}\br \tcode{struct is_trivially_copyable;} & \tcode{T} is a trivially copyable type\iref{basic.types} & \tcode{remove_all_extents_t} shall be a complete type or - \cv{}~\tcode{void}. \\ \rowsep + \cv{}~\keyword{void}. \\ \rowsep \indexlibraryglobal{is_standard_layout}% \tcode{template}\br \tcode{struct is_standard_layout;} & \tcode{T} is a standard-layout type\iref{basic.types} & \tcode{remove_all_extents_t} shall be a complete - type or \cv{}~\tcode{void}. \\ \rowsep + type or \cv{}~\keyword{void}. \\ \rowsep \indexlibrary{\idxcode{is_empty}!class}% \tcode{template}\br @@ -16632,7 +16632,7 @@ \tcode{template}\br \tcode{struct is_aggregate;} & \tcode{T} is an aggregate type\iref{dcl.init.aggr} & - \tcode{remove_all_extents_t} shall be a complete type or \cv~\tcode{void}. \\ \rowsep + \tcode{remove_all_extents_t} shall be a complete type or \cv~\keyword{void}. \\ \rowsep \indexlibrary{\idxcode{is_signed}!class}% \tcode{template}\br @@ -16670,18 +16670,18 @@ \tcode{template}\br \tcode{struct is_constructible;} & For a function type \tcode{T} or - for a \cv{}~\tcode{void} type \tcode{T}, + for a \cv{}~\keyword{void} type \tcode{T}, \tcode{is_constructible_v} is \tcode{false}, otherwise \seebelow & \tcode{T} and all types in the template parameter pack \tcode{Args} - shall be complete types, \cv{}~\tcode{void}, + shall be complete types, \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_default_constructible}% \tcode{template}\br \tcode{struct is_default_constructible;} & \tcode{is_constructible_v} is \tcode{true}. & - \tcode{T} shall be a complete type, \cv{}~\tcode{void}, + \tcode{T} shall be a complete type, \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_copy_constructible}% @@ -16689,7 +16689,7 @@ \tcode{struct is_copy_constructible;} & For a referenceable type \tcode{T}\iref{defns.referenceable}, the same result as \tcode{is_constructible_v}, otherwise \tcode{false}. & - \tcode{T} shall be a complete type, \cv{}~\tcode{void}, + \tcode{T} shall be a complete type, \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_move_constructible}% @@ -16697,7 +16697,7 @@ \tcode{struct is_move_constructible;} & For a referenceable type \tcode{T}, the same result as \tcode{is_constructible_v}, otherwise \tcode{false}. & - \tcode{T} shall be a complete type, \cv{}~\tcode{void}, + \tcode{T} shall be a complete type, \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_assignable}% @@ -16716,7 +16716,7 @@ context'' and can result in the program being ill-formed. \end{tailnote} & - \tcode{T} and \tcode{U} shall be complete types, \cv{}~\tcode{void}, + \tcode{T} and \tcode{U} shall be complete types, \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_copy_assignable}% @@ -16724,7 +16724,7 @@ \tcode{struct is_copy_assignable;} & For a referenceable type \tcode{T}, the same result as \tcode{is_assignable_v}, otherwise \tcode{false}. & - \tcode{T} shall be a complete type, \cv{}~\tcode{void}, + \tcode{T} shall be a complete type, \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_move_assignable}% @@ -16732,7 +16732,7 @@ \tcode{struct is_move_assignable;} & For a referenceable type \tcode{T}, the same result as \tcode{is_assignable_v}, otherwise \tcode{false}. & - \tcode{T} shall be a complete type, \cv{}~\tcode{void}, + \tcode{T} shall be a complete type, \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_swappable_with}% @@ -16757,7 +16757,7 @@ \end{tailnote} & \tcode{T} and \tcode{U} shall be complete types, - \cv{}~\tcode{void}, or + \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_swappable}% @@ -16767,7 +16767,7 @@ the same result as \tcode{is_swappable_with_v}, otherwise \tcode{false}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_destructible}% @@ -16781,26 +16781,26 @@ when treated as an unevaluated operand\iref{expr.prop}, where \tcode{U} is \tcode{remove_all_extents_t}. & - \tcode{T} shall be a complete type, \cv{}~\tcode{void}, + \tcode{T} shall be a complete type, \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_trivially_constructible}% \tcode{template}\br - \tcode{struct}\br + \keyword{struct}\br \tcode{is_trivially_constructible;} & \tcode{is_constructible_v} is \tcode{true} and the variable definition for \tcode{is_constructible}, as defined below, is known to call no operation that is not trivial~(\ref{basic.types}, \ref{special}). & \tcode{T} and all types in the template parameter pack \tcode{Args} shall be complete types, - \cv{}~\tcode{void}, or arrays of unknown bound. \\ \rowsep + \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_trivially_default_constructible}% \tcode{template}\br \tcode{struct is_trivially_default_constructible;} & \tcode{is_trivially_constructible_v} is \tcode{true}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_trivially_copy_constructible}% @@ -16809,7 +16809,7 @@ For a referenceable type \tcode{T}, the same result as \tcode{is_trivially_constructible_v}, otherwise \tcode{false}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_trivially_move_constructible}% @@ -16818,7 +16818,7 @@ For a referenceable type \tcode{T}, the same result as \tcode{is_trivially_constructible_v}, otherwise \tcode{false}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_trivially_assignable}% @@ -16827,7 +16827,7 @@ \tcode{is_assignable_v} is \tcode{true} and the assignment, as defined by \tcode{is_assignable}, is known to call no operation that is not trivial ~(\ref{basic.types}, \ref{special}). & - \tcode{T} and \tcode{U} shall be complete types, \cv{}~\tcode{void}, + \tcode{T} and \tcode{U} shall be complete types, \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_trivially_copy_assignable}% @@ -16836,7 +16836,7 @@ For a referenceable type \tcode{T}, the same result as \tcode{is_trivially_assignable_v}, otherwise \tcode{false}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_trivially_move_assignable}% @@ -16845,7 +16845,7 @@ For a referenceable type \tcode{T}, the same result as \tcode{is_trivially_assignable_v}, otherwise \tcode{false}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown bound. \\ \rowsep + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_trivially_destructible}% \tcode{template}\br @@ -16854,7 +16854,7 @@ \tcode{remove_all_extents_t} is either a non-class type or a class type with a trivial destructor. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_constructible}% @@ -16866,7 +16866,7 @@ throw any exceptions\iref{expr.unary.noexcept}. & \tcode{T} and all types in the template parameter pack \tcode{Args} - shall be complete types, \cv{}~\tcode{void}, + shall be complete types, \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_default_constructible}% @@ -16874,7 +16874,7 @@ \tcode{struct is_nothrow_default_constructible;} & \tcode{is_nothrow_constructible_v} is \tcode{true}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_copy_constructible}% @@ -16883,7 +16883,7 @@ For a referenceable type \tcode{T}, the same result as \tcode{is_nothrow_constructible_v}, otherwise \tcode{false}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_move_constructible}% @@ -16892,14 +16892,14 @@ For a referenceable type \tcode{T}, the same result as \tcode{is_nothrow_constructible_v}, otherwise \tcode{false}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown bound. \\ \rowsep + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_assignable}% \tcode{template}\br \tcode{struct is_nothrow_assignable;} & \tcode{is_assignable_v} is \tcode{true} and the assignment is known not to throw any exceptions\iref{expr.unary.noexcept}. & - \tcode{T} and \tcode{U} shall be complete types, \cv{}~\tcode{void}, + \tcode{T} and \tcode{U} shall be complete types, \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_copy_assignable}% @@ -16908,7 +16908,7 @@ For a referenceable type \tcode{T}, the same result as \tcode{is_nothrow_assignable_v}, otherwise \tcode{false}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_move_assignable}% @@ -16917,7 +16917,7 @@ For a referenceable type \tcode{T}, the same result as \tcode{is_nothrow_assignable_v}, otherwise \tcode{false}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_swappable_with}% @@ -16928,7 +16928,7 @@ \tcode{is_swappable_with} is known not to throw any exceptions\iref{expr.unary.noexcept}. & \tcode{T} and \tcode{U} shall be complete types, - \cv{}~\tcode{void}, or + \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_swappable}% @@ -16938,7 +16938,7 @@ the same result as \tcode{is_nothrow_swappable_with_v}, otherwise \tcode{false}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_destructible}% @@ -16947,7 +16947,7 @@ \tcode{is_destructible_v} is \tcode{true} and the indicated destructor is known not to throw any exceptions\iref{expr.unary.noexcept}. & \tcode{T} shall be a complete type, - \cv{}~\tcode{void}, or an array of unknown + \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{has_virtual_destructor}% @@ -16962,7 +16962,7 @@ For an array type \tcode{T}, the same result as \tcode{has_unique_object_representations_v>}, otherwise \seebelow. & - \tcode{T} shall be a complete type, \cv{}~\tcode{void}, or + \tcode{T} shall be a complete type, \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \end{libreqtab3b} @@ -17166,7 +17166,7 @@ \tcode{struct is_convertible;} & \seebelow & \tcode{From} and \tcode{To} shall be complete types, - \cv{}~\tcode{void}, or arrays of unknown bound. \\ \rowsep + \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_convertible}% \tcode{template}\br @@ -17175,14 +17175,14 @@ the conversion, as defined by \tcode{is_convertible}, is known not to throw any exceptions\iref{expr.unary.noexcept} & \tcode{From} and \tcode{To} shall be complete types, - \cv{}~\tcode{void}, or arrays of unknown bound. \\ \rowsep + \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_layout_compatible}% \tcode{template}\br \tcode{struct is_layout_compatible;} & \tcode{T} and \tcode{U} are layout-compatible\iref{basic.types} & \tcode{T} and \tcode{U} shall be complete types, - \cv{}~\tcode{void}, + \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_pointer_interconvertible_base_of}% @@ -17206,7 +17206,7 @@ The expression \tcode{\placeholdernc{INVOKE}(declval(), declval()...)} is well-formed when treated as an unevaluated operand & \tcode{Fn} and all types in the template parameter pack \tcode{ArgTypes} - shall be complete types, \cv{}~\tcode{void}, or + shall be complete types, \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_invocable_r}% @@ -17215,7 +17215,7 @@ The expression \tcode{\placeholdernc{INVOKE}(declval(), declval()...)} is well-formed when treated as an unevaluated operand & \tcode{Fn}, \tcode{R}, and all types in the template parameter pack \tcode{ArgTypes} - shall be complete types, \cv{}~\tcode{void}, or + shall be complete types, \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_invocable}% @@ -17225,7 +17225,7 @@ the expression \tcode{\placeholdernc{INVOKE}(declval(), declval()...)} is known not to throw any exceptions\iref{expr.unary.noexcept} & \tcode{Fn} and all types in the template parameter pack \tcode{ArgTypes} - shall be complete types, \cv{}~\tcode{void}, or + shall be complete types, \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_nothrow_invocable_r}% @@ -17235,7 +17235,7 @@ the expression \tcode{\placeholdernc{INVOKE}(declval(), declval()...)} is known not to throw any exceptions\iref{expr.unary.noexcept} & \tcode{Fn}, \tcode{R}, and all types in the template parameter pack \tcode{ArgTypes} - shall be complete types, \cv{}~\tcode{void}, or + shall be complete types, \cv{}~\keyword{void}, or arrays of unknown bound. \\ \end{libreqtab3f} @@ -17538,7 +17538,7 @@ \tcode{template\br struct add_pointer;} & If \tcode{T} names a referenceable type\iref{defns.referenceable} or a - \cv{}~\tcode{void} type then + \cv{}~\keyword{void} type then the member typedef \tcode{type} names the same type as \tcode{remove_reference_t*}; otherwise, \tcode{type} names \tcode{T}. \\ @@ -17635,13 +17635,13 @@ the member \tcode{type} is defined or omitted as specified in Note A, below. If it is omitted, there shall be no member \tcode{type}. Each type in the template parameter pack \tcode{T} shall be - complete, \cv{}~\tcode{void}, or an array of unknown bound. \\ \rowsep + complete, \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep \indexlibraryglobal{basic_common_reference}% \tcode{template class,} \hspace*{2ex}\tcode{template class>} - \tcode{struct} + \keyword{struct} \hspace*{2ex}\tcode{basic_common_reference;} & Unless this trait is specialized (as specified in Note D, below), @@ -17652,7 +17652,7 @@ & The member \grammarterm{typedef-name} \tcode{type} is defined or omitted as specified in Note C, below. Each type in the parameter pack \tcode{T} shall - be complete or \cv{} \tcode{void}. \\ \rowsep + be complete or \cv{} \keyword{void}. \\ \rowsep \indexlibraryglobal{underlying_type}% \tcode{template}\br @@ -17683,7 +17683,7 @@ context'' and can result in the program being ill-formed. \end{note} \expects \tcode{Fn} and all types in the template parameter pack \tcode{ArgTypes} - are complete types, \cv{}~\tcode{void}, or arrays of + are complete types, \cv{}~\keyword{void}, or arrays of unknown bound.\\ \rowsep \indexlibraryglobal{unwrap_reference}% @@ -20313,7 +20313,7 @@ individual arguments. \pnum -Let \tcode{charT} be either \tcode{char} or \tcode{wchar_t}. +Let \tcode{charT} be either \tcode{char} or \keyword{wchar_t}. Each specialization of \tcode{formatter} is either enabled or disabled, as described below. \begin{note} @@ -20352,10 +20352,10 @@ for each cv-unqualified arithmetic type \tcode{ArithmeticT} other than \tcode{char}, -\tcode{wchar_t}, -\tcode{char8_t}, -\tcode{char16_t}, or -\tcode{char32_t}, +\keyword{wchar_t}, +\keyword{char8_t}, +\keyword{char16_t}, or +\keyword{char32_t}, a specialization \begin{codeblock} template<> struct formatter; @@ -20820,7 +20820,7 @@ initializes \tcode{value} with \tcode{v}; \item otherwise, if \tcode{T} is \tcode{char} and \tcode{char_type} is -\tcode{wchar_t}, initializes \tcode{value} with +\keyword{wchar_t}, initializes \tcode{value} with \tcode{static_cast(v)}; \item otherwise, if \tcode{T} is a signed integer type\iref{basic.fundamental}