diff --git a/source/algorithms.tex b/source/algorithms.tex index baf3e4f25f..0c5d2b5cb6 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -2316,16 +2316,6 @@ template<@\libconcept{input_or_output_iterator}@ O, @\libconcept{copy_constructible}@ F> requires @\libconcept{invocable}@ && @\libconcept{indirectly_writable}@> constexpr O generate_n(O first, iter_difference_t n, F gen); - template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@ S, - @\libconcept{copy_constructible}@ F> - requires @\libconcept{invocable}@ && @\libconcept{indirectly_writable}@> - O generate(Ep&& exec, O first, S last, F gen); // freestanding-deleted - template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\libconcept{copy_constructible}@ F> - requires @\libconcept{invocable}@ && @\libconcept{indirectly_writable}@, invoke_result_t> - borrowed_iterator_t generate(Ep&& exec, R&& r, F gen); // freestanding-deleted - template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ O, @\libconcept{copy_constructible}@ F> - requires @\libconcept{invocable}@ && @\libconcept{indirectly_writable}@> - O generate_n(Ep&& exec, O first, iter_difference_t n, F gen); // freestanding-deleted } // \ref{alg.remove}, remove @@ -2857,12 +2847,12 @@ class Comp = ranges::less, class Proj = identity> requires @\libconcept{sortable}@ I stable_sort(Ep&& exec, I first, S last, Comp comp = {}, - Proj proj = {}); // freestanding-deleted + Proj proj = {}); // hosted template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Comp = ranges::less, class Proj = identity> requires @\libconcept{sortable}@, Comp, Proj> borrowed_iterator_t - stable_sort(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // freestanding-deleted + stable_sort(Ep&& exec, R&& r, Comp comp = {}, Proj proj = {}); // hosted } template @@ -3261,12 +3251,12 @@ requires @\libconcept{permutable}@ subrange stable_partition(Ep&& exec, I first, S last, Pred pred, - Proj proj = {}); // freestanding-deleted + Proj proj = {}); // hosted template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Proj = identity, @\libconcept{indirect_unary_predicate}@, Proj>> Pred> requires @\libconcept{permutable}@> borrowed_subrange_t - stable_partition(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // freestanding-deleted + stable_partition(Ep&& exec, R&& r, Pred pred, Proj proj = {}); // hosted } template requires @\libconcept{sortable}@ I inplace_merge(Ep&& exec, I first, I middle, S last, Comp comp = {}, - Proj proj = {}); // freestanding-deleted + Proj proj = {}); // hosted template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, class Comp = ranges::less, class Proj = identity> requires @\libconcept{sortable}@, Comp, Proj> borrowed_iterator_t inplace_merge(Ep&& exec, R&& r, iterator_t middle, Comp comp = {}, - Proj proj = {}); // freestanding-deleted + Proj proj = {}); // hosted } // \ref{alg.set.operations}, set operations @@ -7492,17 +7482,6 @@ template<@\libconcept{input_or_output_iterator}@ O, @\libconcept{copy_constructible}@ F> requires @\libconcept{invocable}@ && @\libconcept{indirectly_writable}@> constexpr O ranges::generate_n(O first, iter_difference_t n, F gen); - -template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ O, @\libconcept{sized_sentinel_for}@ S, - @\libconcept{copy_constructible}@ F> - requires @\libconcept{invocable}@ && @\libconcept{indirectly_writable}@> - O ranges::generate(Ep&& exec, O first, S last, F gen); -template<@\exposconcept{execution-policy}@ Ep, @\exposconcept{sized-random-access-range}@ R, @\libconcept{copy_constructible}@ F> - requires @\libconcept{invocable}@ && @\libconcept{indirectly_writable}@, invoke_result_t> - borrowed_iterator_t ranges::generate(Ep&& exec, R&& r, F gen); -template<@\exposconcept{execution-policy}@ Ep, @\libconcept{random_access_iterator}@ O, @\libconcept{copy_constructible}@ F> - requires @\libconcept{invocable}@ && @\libconcept{indirectly_writable}@> - O ranges::generate_n(Ep&& exec, O first, iter_difference_t n, F gen); \end{itemdecl} \begin{itemdescr} diff --git a/source/containers.tex b/source/containers.tex index 89f3bca5fe..63cf29baa1 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -8847,7 +8847,8 @@ \pnum \throws \tcode{length_error} if any of \tcode{x}'s active blocks -are not within the bounds of \exposid{current-limits}. +are not within the bounds of \exposid{current-limits}, +as well as any exceptions thrown by the allocator. \pnum \complexity @@ -10651,6 +10652,18 @@ \tcode{*this}. \end{itemdescr} +\indexlibrarymember{operator bool}{vector::reference}% +\begin{itemdecl} +constexpr reference::operator bool() const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +\tcode{true} if the value of the bit referred to by \tcode{*this} is one, +\tcode{false} otherwise. +\end{itemdescr} + \indexlibrarymember{flip}{vector::reference}% \begin{itemdecl} constexpr void reference::flip() noexcept; @@ -19494,8 +19507,8 @@ \effects Adds elements to \exposid{c} as if by: \begin{codeblock} -ranges::for_each(rg, [&](auto&& e) { - @\exposid{c}@.insert(@\exposid{c}@.end(), std::forward(e)); +ranges::for_each(rg, [&](value_type e) { + @\exposid{c}@.insert(@\exposid{c}@.end(), std::move(e)); }); \end{codeblock} Then, @@ -20182,8 +20195,8 @@ \effects Adds elements to \exposid{c} as if by: \begin{codeblock} -ranges::for_each(rg, [&](auto&& e) { - @\exposid{c}@.insert(@\exposid{c}@.end(), std::forward(e)); +ranges::for_each(rg, [&](value_type e) { + @\exposid{c}@.insert(@\exposid{c}@.end(), std::move(e)); }); \end{codeblock} Then, sorts the range of newly inserted elements with respect to \exposid{compare}, @@ -20392,10 +20405,7 @@ concept @\defexposconcept{integral-constant-like}@ = // \expos is_integral_v> && !is_same_v> && - @\libconcept{convertible_to}@ && - @\libconcept{equality_comparable_with}@ && - bool_constant::value && - bool_constant(T()) == T::value>::value; + @\exposconcept{constexpr-wrapper-like}@; template constexpr size_t @\defexposconcept{maybe-static-ext}@ = dynamic_extent; // \expos @@ -21289,12 +21299,12 @@ inline constexpr full_extent_t full_extent{}; template - constexpr auto submdspan_extents(const extents&, SliceSpecifiers...); + constexpr auto subextents(const extents&, SliceSpecifiers...); // \ref{mdspan.sub.canonical}, \tcode{submdspan} slice canonicalization template - constexpr auto submdspan_canonicalize_slices(const extents& src, - Slices... slices); + constexpr auto canonical_slices(const extents& src, + Slices... slices); // \ref{mdspan.sub.sub}, \tcode{submdspan} function template template; template - mdspan(const typename AccessorType::data_handle_type&, const MappingType&, + mdspan(typename AccessorType::data_handle_type, const MappingType&, const AccessorType&) -> mdspan; @@ -25846,11 +25856,12 @@ \rSec4[mdspan.sub.canonical]{\tcode{submdspan} slice canonicalization} -\indexlibraryglobal{submdspan_canonicalize_slices}% +%FIXME: "Slices" is used instead of "SliceSpecifiers" in the synopsis declaration. +\indexlibraryglobal{canonical_slices}% \begin{itemdecl} template - constexpr auto submdspan_canonicalize_slices(const extents& src, - SliceSpecifiers... slices); + constexpr auto canonical_slices(const extents& src, + SliceSpecifiers... slices); \end{itemdecl} \begin{itemdescr} @@ -25882,20 +25893,20 @@ \tcode{make_tuple(\exposid{canonical-slice}(slices)...)}. \end{itemdescr} -\rSec4[mdspan.sub.extents]{\tcode{submdspan_extents} function} +\rSec4[mdspan.sub.extents]{\tcode{subextents} function} -\indexlibraryglobal{submdspan_extents}% +\indexlibraryglobal{subextents}% \begin{itemdecl} template - constexpr auto submdspan_extents(const extents& src, - SliceSpecifiers... raw_slices); + constexpr auto subextents(const extents& src, + SliceSpecifiers... raw_slices); \end{itemdecl} \begin{itemdescr} \pnum Let \tcode{slices} be the pack introduced by the following declaration: \begin{codeblock} -auto [...slices] = submdspan_canonicalize_slices(src, raw_slices...); +auto [...slices] = canonical_slices(src, raw_slices...); \end{codeblock} \pnum @@ -26048,7 +26059,7 @@ An object \tcode{smr} of type \tcode{SMR} such that \begin{itemize} \item - \tcode{smr.mapping.extents() == submdspan_extents(m.extents(), valid_slices...)} + \tcode{smr.mapping.extents() == subextents(m.extents(), valid_slices...)} is \tcode{true};\newline and \item for each integer pack \tcode{i} @@ -26121,7 +26132,7 @@ \pnum Let \tcode{sub_ext} be -the result of \tcode{submdspan_extents(extents(), slices...)} and +the result of \tcode{subextents(extents(), slices...)} and let \tcode{SubExtents} be \tcode{decl\-type(sub_ext)}. \pnum @@ -26502,7 +26513,7 @@ \pnum Let \tcode{slices} be the pack introduced by the following declaration: \begin{codeblock} -auto [...slices] = submdspan_canonicalize_slices(src, raw_slices...); +auto [...slices] = canonical_slices(src, raw_slices...); \end{codeblock} \pnum diff --git a/source/diagnostics.tex b/source/diagnostics.tex index 47be572caa..fc53cdb3bf 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -495,8 +495,11 @@ \pnum If \mname{VA_ARGS} does not expand to -an \grammarterm{assignment-expression}, +a well-formed \grammarterm{assignment-expression}, the program is ill-formed. +If such an \grammarterm{assignment-expression} is ill-formed when +treated as an unevaluated operand\iref{expr.await, expr.yield}, +the program is ill-formed, no diagnostic required. \pnum The macro \tcode{assert} is redefined according to diff --git a/source/exec.tex b/source/exec.tex index 4455a1c991..cba1458af9 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -7227,7 +7227,6 @@ public: using sender_concept = sender_t; - using completion_signatures = @\seebelow@; using allocator_type = @\seebelow@; using scheduler_type = @\seebelow@; using stop_source_type = @\seebelow@; @@ -7240,6 +7239,9 @@ task(task&&) noexcept; ~task(); + template + static consteval auto get_completion_signatures(); + template<@\libconcept{receiver}@ Rcvr> @\exposid{state}@ connect(Rcvr&& rcvr) &&; @@ -7281,19 +7283,6 @@ contain an element which is not of the form \tcode{set_error_t(E)} for some type \tcode{E}. -\pnum -The type alias \tcode{completion_signatures} is a specialization -of \tcode{execution::completion_signatures} with the template -arguments (in unspecified order): -\begin{itemize} -\item \tcode{set_value_t()} if \tcode{T} is \tcode{void}, -and \tcode{set_value_t(T)} otherwise; -\item template arguments of the specialization of -\tcode{execution::completion_signatures} denoted by \tcode{error_types}; -and -\item \tcode{set_stopped_t()}. -\end{itemize} - \pnum \tcode{allocator_type} shall meet the \oldconcept{Allocator} requirements. @@ -7325,6 +7314,32 @@ \end{codeblock} \end{itemdescr} +\indexlibrarymember{get_completion_signatures}{task}% +\begin{itemdecl} +template + static consteval auto get_completion_signatures(); +\end{itemdecl} +\begin{itemdescr} +\pnum +Let the type \tcode{C} be a specialization +of \tcode{execution::completion_signatures} +with the template arguments (in unspecified order): +\begin{itemize} +\item +\tcode{set_value_t()} if \tcode{T} is \tcode{void}, +and \tcode{set_value_t(T)} otherwise; +\item +template arguments of the specialization of +\tcode{execution::completion_signatures} denoted by \tcode{error_types}; +and +\item \tcode{set_stopped_t()}. +\end{itemize} + +\pnum +\returns +\tcode{C()}. +\end{itemdescr} + \indexlibrarymember{connect}{task}% \begin{itemdecl} template<@\libconcept{receiver}@ Rcvr> @@ -7476,8 +7491,8 @@ template @\unspec@ yield_value(with_error error); - template - auto await_transform(A&& a); + template<@\libconcept{sender}@ Sender> + auto await_transform(Sender&& sndr); template auto await_transform(change_coroutine_scheduler sch); @@ -7568,7 +7583,7 @@ \tcode{set_value(std::move(\exposid{RCVR}(*this)))} if \tcode{is_void} is \tcode{true}, and otherwise \item - \tcode{set_value(std::move(\exposid{RCVR}(*this)), *\exposid{result})}. + \tcode{set_value(std::move(\exposid{RCVR}(*this)), std::move(*\exposid{result}))}. \end{itemize} \end{itemdescr} @@ -7596,7 +7611,7 @@ \indexlibrarymember{await_transform}{task::promise_type}% \begin{itemdecl} template<@\libconcept{sender}@ Sender> - auto await_transform(Sender&& sndr) noexcept; + auto await_transform(Sender&& sndr); \end{itemdecl} \begin{itemdescr} \pnum @@ -7610,14 +7625,14 @@ \indexlibrarymember{await_transform}{task::promise_type}% \begin{itemdecl} template - auto await_transform(change_coroutine_scheduler sch) noexcept; + auto await_transform(change_coroutine_scheduler sch); \end{itemdecl} \begin{itemdescr} \pnum \effects Equivalent to: \begin{codeblock} -return await_transform(just(exchange(@\exposid{SCHED}@(*this), scheduler_type(sch.scheduler))), *this); +return as_awaitable(just(exchange(@\exposid{SCHED}@(*this), scheduler_type(sch.scheduler))), *this); \end{codeblock} \end{itemdescr} diff --git a/source/future.tex b/source/future.tex index 14b1e41efe..a8772f6647 100644 --- a/source/future.tex +++ b/source/future.tex @@ -929,7 +929,7 @@ \begin{itemdescr} \pnum \returns -\tcode{system_encoded_string()}. +\tcode{native_encoded_string()}. \end{itemdescr} \indexlibrarymember{generic_string}{path}% @@ -940,7 +940,7 @@ \begin{itemdescr} \pnum \returns -\tcode{generic_system_encoded_string()}. +\tcode{generic_native_encoded_string()}. \end{itemdescr} \rSec1[depr.atomics]{Deprecated atomic operations} diff --git a/source/iostreams.tex b/source/iostreams.tex index 2ec4c6445e..a430c8dc69 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -13717,7 +13717,7 @@ basic_string string(const Allocator& a = Allocator()) const; std::string display_string() const; - std::string system_encoded_string() const; + std::string native_encoded_string() const; std::wstring wstring() const; std::u8string u8string() const; std::u16string u16string() const; @@ -13729,7 +13729,7 @@ basic_string generic_string(const Allocator& a = Allocator()) const; std::string generic_display_string() const; - std::string generic_system_encoded_string() const; + std::string generic_native_encoded_string() const; std::wstring generic_wstring() const; std::u8string generic_u8string() const; std::u16string generic_u16string() const; @@ -14051,7 +14051,8 @@ so no conversion from \tcode{char} value type arguments or to \tcode{char} value type return values is performed. For Windows-based operating systems, the -native ordinary encoding is determined by calling a Windows API function. +native ordinary encoding is determined by +the current locale encoding and the Windows \tcode{AreFileApisANSI} function. \end{note} \begin{note} This results in behavior identical to other C and \Cpp{} @@ -14704,7 +14705,7 @@ \indexlibrarymember{u16string}{path}% \indexlibrarymember{u32string}{path}% \begin{itemdecl} -std::string system_encoded_string() const; +std::string native_encoded_string() const; std::wstring wstring() const; std::u8string u8string() const; std::u16string u16string() const; @@ -14779,7 +14780,7 @@ \indexlibrarymember{generic_u16string}{path}% \indexlibrarymember{generic_u32string}{path}% \begin{itemdecl} -std::string generic_system_encoded_string() const; +std::string generic_native_encoded_string() const; std::wstring generic_wstring() const; std::u8string generic_u8string() const; std::u16string generic_u16string() const; diff --git a/source/iterators.tex b/source/iterators.tex index 9e972f19ae..7d97d4395a 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1675,6 +1675,7 @@ template concept @\deflibconcept{sentinel_for}@ = @\libconcept{semiregular}@ && + !@\exposid{is-integer-like}@ && @\libconcept{input_or_output_iterator}@ && @\exposconcept{weakly-equality-comparable-with}@; // see \ref{concept.equalitycomparable} \end{itemdecl} diff --git a/source/lib-intro.tex b/source/lib-intro.tex index abe4ecf3b7..2e4d71e566 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -564,6 +564,13 @@ template using @\exposidnc{synth-three-way-result}@ = // \expos decltype(@\exposidnc{synth-three-way}@(declval(), declval())); + + template + concept @\defexposconceptnc{constexpr-wrapper-like}@ = // \expos + @\libconcept{convertible_to}@ && + @\libconcept{equality_comparable_with}@ && + bool_constant::value && + bool_constant(T()) == T::value>::value; } \end{codeblock} @@ -3103,6 +3110,14 @@ Unless \tcode{\placeholder{F}} is designated an addressable function, it is unspecified if or how a reflection value designating the associated entity can be formed. +For any value \tcode{\placeholder{p}} of type \tcode{meta::info} that +represents a reflection of a parameter of \tcode{\placeholder{F}}, +it is unspecified if \tcode{has_identifier(\placeholder{p})} +returns \tcode{true} or \tcode{false}, and +if \tcode{meta::has_identifier(\placeholder{p})} is \tcode{true}, then +the \ntmbs{} produced by +\tcode{meta::identifier_of(\placeholder{p})} and +\tcode{meta::u8identifier_of(\placeholder{p})} is unspecified. %FIXME: Why is this not an example, but a note that begins with "For example"? \begin{note} For example, it is possible that \tcode{std::meta::members_of} @@ -3787,6 +3802,16 @@ the \Cpp{} standard library may be recursively reentered} which functions in the \Cpp{} standard library may be recursively reentered. +\pnum +During the execution of +a standard library non-static member function $F$ on an object, +if that object is accessed through a glvalue that is not obtained, +directly or indirectly, +from the object parameter of $F$, +in a manner that can conflict\iref{intro.races} +with any access that $F$ is permitted to perform\iref{res.on.data.races}, +the behavior is undefined unless otherwise specified. + \rSec3[res.on.data.races]{Data race avoidance} \pnum diff --git a/source/memory.tex b/source/memory.tex index a7f16411e8..c4ff8b920c 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -1019,6 +1019,10 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\mandates +Alignment is a power of two. + \pnum \expects \tcode{p} points to @@ -2637,6 +2641,10 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\constraints +\tcode{*declval()} is a well-formed expression. + \pnum \mandates \tcode{reference_converts_from_temporary_v, decltype(\linebreak{}*declval())>} is \tcode{false}. diff --git a/source/meta.tex b/source/meta.tex index c76fa23ee5..b2a168331b 100644 --- a/source/meta.tex +++ b/source/meta.tex @@ -810,16 +810,16 @@ // pseudo-mutators template<@\exposconcept{constexpr-param}@ T> constexpr auto operator++(this T) noexcept - -> constant_wrapper<++Y> { return {}; } + -> constant_wrapper<(++T::value)> { return {}; } template<@\exposconcept{constexpr-param}@ T> constexpr auto operator++(this T, int) noexcept - -> constant_wrapper { return {}; } + -> constant_wrapper<(T::value++)> { return {}; } template<@\exposconcept{constexpr-param}@ T> constexpr auto operator--(this T) noexcept - -> constant_wrapper<--Y> { return {}; } + -> constant_wrapper<(--T::value)> { return {}; } template<@\exposconcept{constexpr-param}@ T> constexpr auto operator--(this T, int) noexcept - -> constant_wrapper { return {}; } + -> constant_wrapper<(T::value--)> { return {}; } template<@\exposconcept{constexpr-param}@ T, @\exposconcept{constexpr-param}@ R> constexpr auto operator+=(this T, R) noexcept @@ -861,9 +861,9 @@ template<@\exposconcept{constexpr-param}@ R> constexpr auto operator=(R) const noexcept - -> constant_wrapper { return {}; } + -> constant_wrapper<(value = R::value)> { return {}; } - constexpr operator decltype(auto)() const noexcept { return value; } + constexpr operator decltype(value)() const noexcept { return value; } }; } \end{codeblock} @@ -1548,6 +1548,8 @@ the initialization \tcode{T t(\exposidnc{VAL});} is well-formed and binds \tcode{t} to a temporary object whose lifetime is extended\iref{class.temporary}. + The full-expression of the variable initialization is + treated as an unevaluated operand\iref{expr.context}. Access checking is performed as if in a context unrelated to \tcode{T} and \tcode{U}. Only the validity of the immediate context of @@ -1571,6 +1573,8 @@ the initialization \tcode{T t = \exposidnc{VAL};} is well-formed and binds \tcode{t} to a temporary object whose lifetime is extended\iref{class.temporary}. + The full-expression of the variable initialization is + treated as an unevaluated operand\iref{expr.context}. Access checking is performed as if in a context unrelated to \tcode{T} and \tcode{U}. Only the validity of the immediate context of @@ -1639,6 +1643,8 @@ \begin{note} These tokens are never interpreted as a function declaration. \end{note} +The full-expression of the variable initialization is +treated as an unevaluated operand\iref{expr.context}. Access checking is performed as if in a context unrelated to \tcode{T} and any of the \tcode{Args}. Only the validity of the immediate context of the variable initialization is considered. @@ -1937,7 +1943,8 @@ \indexlibraryglobal{is_convertible}% \pnum The predicate condition for a template specialization \tcode{is_convertible} -shall be satisfied if and only if the return expression in the following code would be +shall be satisfied if and only if +the return statement\iref{stmt.return} in the following code would be well-formed, including any implicit conversions to the return type of the function: \begin{codeblock} @@ -1951,9 +1958,11 @@ array types, function types, and \cv{}~\keyword{void}. \end{note} Access checking is performed -in a context unrelated to \tcode{To} and \tcode{From}. Only the validity of -the immediate context of the \grammarterm{expression} of the \tcode{return} statement\iref{stmt.return} -(including initialization of the returned object or reference) is considered. +in a context unrelated to \tcode{To} and \tcode{From}. +The operand of the \tcode{return} statement +(including initialization of the returned object or reference, if any) +is treated as an unevaluated operand\iref{expr.context}, and +only the validity of its immediate context is considered. \begin{note} The initialization can result in side effects such as the @@ -3416,30 +3425,44 @@ \begin{itemdescr} \pnum -Let \tcode{T} be \tcode{ranges::range_value_t} and -$\tcode{\placeholder{e}}_i$ be \tcode{static_cast(*$\tcode{\placeholder{it}}_i$)}, -where $\tcode{\placeholder{it}}_i$ is an iterator to the $i^\text{th}$ element of \tcode{r}. +Let \tcode{U} be \tcode{ranges::range_value_t} and +\tcode{T} be \tcode{remove_all_extents_t}. \pnum \mandates -\tcode{T} is a structural type\iref{temp.param}, -\tcode{is_constructible_v>} is \tcode{true}, and -\tcode{T} satisfies \libconcept{copy_constructible}. +\begin{itemize} +\item \tcode{T} is a structural type\iref{temp.param}, +\item \tcode{T} satisfies \libconcept{copy_constructible}, and +\item +if \tcode{U} is not an array type, then +\tcode{is_constructible_v>} is \tcode{true}. +\end{itemize} \pnum Let $V$ be the pack of values of type \tcode{info} of the same size as \tcode{r}, where the $i^\text{th}$ element is -\tcode{reflect_constant($\tcode{\placeholder{e}}_i$)}. +\begin{itemize} +\item +\tcode{reflect_constant_array(*$\tcode{\placeholder{it}}_i$)} +if \tcode{U} is an array type, +\item +\tcode{reflect_constant(static_cast(*$\tcode{\placeholder{it}}_i$))} +otherwise, +\end{itemize} +and $\tcode{\placeholder{it}}_i$ is an iterator to +the $i^\text{th}$ element of \tcode{r}. \pnum Let $P$ be \begin{itemize} \item the template parameter object\iref{temp.param} - of type \tcode{const T[sizeof...(\brk{}$V$)]} - initialized with\linebreak - \tcode{\{[:$V$:]...\}} if \tcode{sizeof...($V$) > 0} is \tcode{true}, otherwise + of type \tcode{const T[sizeof...($V$)]}, + such that \tcode{$P$[$I$]} is template-argument-equivalent\iref{temp.type} + to the object represented by \tcode{$V$...[$I$]} + for all $I$ in the range \range{0}{sizeof...($V$)} + if \tcode{sizeof...($V$) > 0} is \tcode{true}, otherwise \item the template parameter object of type \tcode{const array} initialized with \tcode{\{\}}. @@ -3451,10 +3474,21 @@ \pnum \throws -Any exception thrown by the evaluation of any $\tcode{\placeholder{e}}_i$, or +Any of +\begin{itemize} +\item +an exception thrown by any operation +on \tcode{r} or +on iterators and sentinels referring to \tcode{r}, +\item +an exception thrown +by the evaluation of any argument of \tcode{reflect_constant} or +by any evaluation of \tcode{reflect_constant_array}, or +\item \tcode{meta::exception} -if evaluation of any \tcode{reflect_constant($\tcode{\placeholder{e}}_i$)} +if any invocation of \tcode{reflect_constant} would exit via an exception. +\end{itemize} \pnum \begin{note} @@ -3510,8 +3544,12 @@ Equivalent to: \begin{codeblock} using U = remove_cvref_t; -if constexpr (meta::is_class_type(^^U)) { - return addressof(meta::extract(meta::reflect_constant(std::forward(t)))); +if constexpr (meta::is_class_type(^^U) || meta::is_union_type(^^U)) { + return addressof(meta::extract( + meta::reflect_constant(std::forward(t)))); +} else if constexpr (meta::is_array_type(^^U)) { + return addressof(meta::extract( + meta::reflect_constant_array(std::forward(t)))); } else { return define_static_array(span(addressof(t), 1)).data(); } @@ -3815,7 +3853,7 @@ Otherwise, if \tcode{r} represents the parameter $P$ of a function $F$, then let $S$ be the set of declarations, ignoring any explicit instantiations, - that precede some point in the evaluation context + that are reachable from a point in the evaluation context and that declare either $F$ or a templated function of which $F$ is a specialization; \tcode{true} if @@ -3901,7 +3939,7 @@ Otherwise, if \tcode{r} represents the parameter $P$ of a function $F$, then let $S$ be the set of declarations, ignoring any explicit instantiations, - that precede some point in the evaluation context + that are reachable from a point in the evaluation context and that declare either $F$ or a templated function of which $F$ is a specialization; the name that was introduced by a declaration in $S$ @@ -4030,7 +4068,7 @@ \begin{itemize} \item If $E$ is defined by a declaration $D$ - that precedes a point $P$ in the evaluation context + that is reachable from a point $P$ in the evaluation context and $P$ does not occur within an \grammarterm{enum-specifier} of $D$, then a reflection of $E$. \item @@ -4662,13 +4700,13 @@ \item If $F$ is a specialization of a templated function $T$, then \tcode{true} if there exists a declaration $D$ of $T$ - that precedes some point in the evaluation context + that is reachable from a point in the evaluation context and $D$ specifies a default argument for the parameter of $T$ corresponding to $P$. Otherwise, \tcode{false}. \item Otherwise, if there exists a declaration $D$ of $F$ - that precedes some point in the evaluation context + that is reachable from a point in the evaluation context and $D$ specifies a default argument for $P$, then \tcode{true}. \end{itemize} @@ -5985,8 +6023,9 @@ \pnum \returns A \tcode{vector} containing all of the reflections $R$ -representing each annotation applying to each declaration of $E$ that precedes either -some point in the evaluation context\iref{expr.const.reflect} or +representing each annotation applying to each declaration of $E$ +that is reachable from either +a point in the evaluation context\iref{expr.const.reflect} or a point immediately following the \grammarterm{class-specifier} of the outermost class for which such a point is in a complete-class context. For any two reflections $R_1$ and $R_2$ in the returned \tcode{vector}, @@ -6611,6 +6650,9 @@ \item if $V$ equals \tcode{0}, then \tcode{options.name} does not contain a value; and + \item + if \tcode{options.name} does not contain a value, then + \tcode{is_const(type) || is_volatile(type)} is \tcode{false}; and \end{itemize} \item if \tcode{options.alignment} contains a value, diff --git a/source/numerics.tex b/source/numerics.tex index 31a2e217d6..46bb6d73b8 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -13834,12 +13834,21 @@ \tcode{InVec::value_type} and \tcode{Scalar} are either a floating-point type, or a specialization of \tcode{complex}. Let \tcode{a} be -\tcode{\exposid{abs-if-needed}(declval())}. -Then, \tcode{decltype(\linebreak init + a * a} is convertible to \tcode{Scalar}. +\tcode{\exposid{abs-if-needed}(declval())} and +let \tcode{init_abs} be \tcode{\exposid{abs-if-needed}(init)}. +Then, \tcode{decltype(init_abs * init_abs + a * a)} +is convertible to \tcode{Scalar}. \pnum \returns -The square root of the sum of the square of \tcode{init} and the squares of the absolute values of the elements of \tcode{v}. +The square root of the sum +whose terms are the following: +\begin{itemize} +\item +the square of the absolute value of \tcode{init}, and +\item +the squares of the absolute values of the elements of \tcode{v}. +\end{itemize} \begin{note} For \tcode{init} equal to zero, this is the Euclidean norm (also called 2-norm) of the vector \tcode{v}. @@ -14032,17 +14041,24 @@ \pnum \mandates -\tcode{InVec::value_type} and \tcode{Scalar} are either a floating-point type, or +\tcode{InMat::value_type} and \tcode{Scalar} are either a floating-point type, or a specialization of \tcode{complex}. Let \tcode{a} be -\tcode{\exposid{abs-if-needed}(declval())}. -Then, \tcode{decltype(\linebreak init + a * a)} +\tcode{\exposid{abs-if-needed}(declval())} and +let \tcode{init_abs} be \tcode{\exposid{abs-if-needed}(init)}. +Then, \tcode{decltype(init_abs * init_abs + a * a)} is convertible to \tcode{Scalar}. \pnum \returns -The square root of the sum of squares -of \tcode{init} and the absolute values of the elements of \tcode{A}. +The square root of the sum +whose terms are the following: +\begin{itemize} +\item +the square of the absolute value of \tcode{init}, and +\item +the squares of the absolute values of the elements of \tcode{A}. +\end{itemize} \begin{note} For \tcode{init} equal to zero, this is the Frobenius norm of the matrix \tcode{A}. @@ -16534,6 +16550,11 @@ \tcode{T} is \defn{value-preserving} if all possible values of \tcode{U} can be represented with type \tcode{T}. +\pnum +If a program declares an explicit or partial specialization of +any of the templates specified in subclause \ref{simd}, +the program is ill-formed, no diagnostic required. + \rSec2[simd.expos]{Exposition-only types, variables, and concepts} \begin{codeblock} @@ -16544,13 +16565,6 @@ constexpr @\exposidnc{simd-size-type} \exposidnc{simd-size-v} = \seebelownc@; // \expos template constexpr size_t @\exposidnc{mask-element-size} = \seebelownc@; // \expos -template - concept @\defexposconceptnc{constexpr-wrapper-like}@ = // \expos - @\libconcept{convertible_to}@ && - @\libconcept{equality_comparable_with}@ && - bool_constant::value && - bool_constant(T()) == T::value>::value; - template concept @\defexposconceptnc{explicitly-convertible-to}@ = // \expos requires { @@ -17491,10 +17505,6 @@ (converting) loads and stores for the given type \tcode{T} on arrays of type \tcode{U}. \end{note} - -\pnum -The behavior of a program that adds specializations for \tcode{alignment} -is undefined. \end{itemdescr} \indexlibrarymember{rebind}{simd} diff --git a/source/ranges.tex b/source/ranges.tex index 58f2ef0c01..18bed31c3c 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -7925,7 +7925,8 @@ } } - constexpr auto begin() const requires @\libconcept{forward_range}@ && @\libconcept{forward_range}@ { + constexpr auto begin() const requires @\libconcept{forward_range}@ && @\libconcept{forward_range}@ && + @\libconcept{forward_range}@ { return @\exposid{outer-iterator}@{*this, ranges::begin(@\exposid{base_}@)}; } @@ -7935,7 +7936,8 @@ } constexpr auto end() const { - if constexpr (@\libconcept{forward_range}@ && @\libconcept{forward_range}@ && @\libconcept{common_range}@) + if constexpr (@\libconcept{forward_range}@ && @\libconcept{forward_range}@ && @\libconcept{common_range}@ && + @\libconcept{forward_range}@) return @\exposid{outer-iterator}@{*this, ranges::end(@\exposid{base_}@)}; else return default_sentinel; diff --git a/source/strings.tex b/source/strings.tex index 3bc1e0268a..3fd210ff1a 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -2014,6 +2014,8 @@ \tcode{data() + size()} points at an object with value \tcode{charT()} (a ``null terminator''\indextext{string!null terminator}), and \tcode{size() <= capacity()} is \tcode{true}. +The program has undefined behavior if +the null terminator is modified to any value other than \tcode{charT()}. \indexlibraryglobal{basic_string}% @@ -3101,10 +3103,7 @@ \pnum \returns -\tcode{*(begin() + pos)} if \tcode{pos < size()}. Otherwise, -returns a reference to an object of type \tcode{charT} with value -\tcode{charT()}, where modifying the object to any value other than -\tcode{charT()} leads to undefined behavior. +\tcode{data()[pos]}. \pnum \throws @@ -4291,42 +4290,17 @@ \begin{itemdecl} constexpr const charT* c_str() const noexcept; constexpr const charT* data() const noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\returns -A pointer \tcode{p} such that \tcode{p + i == addressof(operator[](i))} for each -\tcode{i} in \crange{0}{size()}. - -\pnum -\complexity -Constant time. - -\pnum -\remarks -The program shall not modify any of the values stored in the character array; otherwise, the behavior is undefined. -\end{itemdescr} - -\indexlibrarymember{data}{basic_string}% -\begin{itemdecl} constexpr charT* data() noexcept; \end{itemdecl} \begin{itemdescr} \pnum \returns -A pointer \tcode{p} such that \tcode{p + i == addressof(operator[](i))} for each -\tcode{i} in \crange{0}{size()}. +\tcode{to_address(begin())}. \pnum \complexity Constant time. - -\pnum -\remarks -The program shall not modify the value stored at \tcode{p + size()} -to any value other than \tcode{charT()}; otherwise, the behavior is undefined. \end{itemdescr} \indexlibrarymember{operator basic_string_view}{basic_string}% @@ -4443,7 +4417,10 @@ Equivalent to: \begin{codeblock} basic_string_view s = *this, sv = t; -return s.@\placeholder{G}@(sv, pos); +if (auto result = s.@\placeholder{G}@(sv, pos); result == s.npos) + return npos; +else + return result; \end{codeblock} \pnum diff --git a/source/support.tex b/source/support.tex index 203a1bf45f..d8dae6f46e 100644 --- a/source/support.tex +++ b/source/support.tex @@ -997,7 +997,11 @@ \item \indexlibraryglobal{round_to_nearest}% \tcode{round_to_nearest} -if the rounding style is to the nearest representable value +if the rounding style is to the nearest representable value; +%FIXME: The wording "equally near" seems problematic. +if there are two equally near such values, +%FIXME: Can multiple values have an "even least significant digit"? Or none at all? +the one with an even least significant digit is chosen \item \indexlibraryglobal{round_toward_infinity}% \tcode{round_toward_infinity} @@ -2369,8 +2373,8 @@ constexpr void* operator new (std::size_t size, void* ptr) noexcept; constexpr void* operator new[](std::size_t size, void* ptr) noexcept; -void operator delete (void* ptr, void*) noexcept; -void operator delete[](void* ptr, void*) noexcept; +constexpr void operator delete (void* ptr, void*) noexcept; +constexpr void operator delete[](void* ptr, void*) noexcept; \end{codeblock} \rSec2[new.delete]{Storage allocation and deallocation} @@ -2940,7 +2944,7 @@ \indexlibrarymember{delete}{operator}% \begin{itemdecl} -void operator delete(void* ptr, void*) noexcept; +constexpr void operator delete(void* ptr, void*) noexcept; \end{itemdecl} \begin{itemdescr} @@ -2958,7 +2962,7 @@ \indexlibrarymember{delete}{operator}% \begin{itemdecl} -void operator delete[](void* ptr, void*) noexcept; +constexpr void operator delete[](void* ptr, void*) noexcept; \end{itemdecl} \begin{itemdescr} @@ -3143,9 +3147,12 @@ \pnum \expects \tcode{p} represents the address \placeholder{A} of a byte in memory. -An object \placeholder{X} that is within its lifetime\iref{basic.life} -and whose type is similar\iref{conv.qual} to \tcode{T} -is located at the address \placeholder{A}. +An object \placeholder{X} +whose type is similar\iref{conv.qual} to \tcode{T} +is located at the address \placeholder{A}, and +is either within its lifetime\iref{basic.life} or +is an array element subobject +whose containing array object is within its lifetime. All bytes of storage that would be reachable through\iref{basic.compound} the result are reachable through \tcode{p}. diff --git a/source/text.tex b/source/text.tex index df0dc1baea..473255ae52 100644 --- a/source/text.tex +++ b/source/text.tex @@ -6394,19 +6394,31 @@ \item For integral types, the locale-specific form causes the context's locale to be used -to insert the appropriate digit group separator characters. +to insert the appropriate digit group separator characters +as if obtained with +\tcode{numpunct::grouping} and +\tcode{numpunct::thousands_sep}. \item For floating-point types, the locale-specific form causes the context's locale to be used -to insert the appropriate digit group and radix separator characters. +to insert the appropriate digit group and radix separator characters +as if obtained with +\tcode{numpunct::grouping}, +\tcode{numpunct::thousands_sep}, and +\tcode{numpunct::decimal_point}. \item For the textual representation of \tcode{bool}, the locale-specific form causes the context's locale to be used to insert the appropriate string as if obtained -with \tcode{numpunct::truename} or \tcode{numpunct::falsename}. +with \tcode{numpunct::truename} or \tcode{numpunct::\brk{}falsename}. \end{itemize} +If the string literal encoding is a Unicode encoding form and +the locale is among an implementation-defined set of locales, +each replacement that depends on the locale is performed as if +the replacement character sequence is converted to +the string literal encoding. \pnum The \fmtgrammarterm{type} determines how the data should be presented. @@ -6434,7 +6446,9 @@ let \range{first}{last} be a range large enough to hold the \tcode{to_chars} output and \tcode{value} be the formatting argument value. -Formatting is done as if by calling \tcode{to_chars} as specified +Formatting is done as if by calling \tcode{to_chars} as specified, +transcoding the \tcode{to_chars} output to the wide literal encoding if +\tcode{charT} is \tcode{wchar_t}, and copying the output through the output iterator of the format context. \begin{note} Additional padding and adjustments are performed diff --git a/source/threads.tex b/source/threads.tex index bfd7367295..fa61b9da83 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -3159,6 +3159,7 @@ bool is_lock_free() const noexcept; constexpr explicit atomic_ref(T&); + explicit atomic_ref(T&&) = delete; constexpr atomic_ref(const atomic_ref&) noexcept; template constexpr atomic_ref(const atomic_ref&) noexcept; @@ -3237,6 +3238,9 @@ \pnum The alignment required for an object to be referenced by an atomic reference, which is at least \tcode{alignof(T)}. +For any type \tcode{U} similar to \tcode{T}, +the value of \tcode{required_alignment} +is the same as \tcode{atomic_ref>::required_alignment}. \pnum \begin{note} @@ -3260,6 +3264,9 @@ The static data member \tcode{is_always_lock_free} is \tcode{true} if the \tcode{atomic_ref} type's operations are always lock-free, and \tcode{false} otherwise. +For any type \tcode{U} similar to \tcode{T}, +the value of \tcode{is_always_lock_free} +is the same as \tcode{atomic_ref>::is_always_lock_free}. \end{itemdescr} \indexlibrarymember{is_lock_free}{atomic_ref}% @@ -3656,6 +3663,7 @@ bool is_lock_free() const noexcept; constexpr explicit atomic_ref(@\placeholder{integral-type}@&); + explicit atomic_ref(@\placeholder{integral-type}@&&) = delete; constexpr atomic_ref(const atomic_ref&) noexcept; template constexpr atomic_ref(const atomic_ref&) noexcept; @@ -3880,6 +3888,7 @@ bool is_lock_free() const noexcept; constexpr explicit atomic_ref(@\placeholder{floating-point-type}@&); + explicit atomic_ref(@\placeholder{floating-point-type}@&&) = delete; constexpr atomic_ref(const atomic_ref&) noexcept; template constexpr atomic_ref(const atomic_ref&) noexcept; @@ -4174,6 +4183,7 @@ bool is_lock_free() const noexcept; constexpr explicit atomic_ref(@\placeholder{pointer-type}@&); + explicit atomic_ref(@\placeholder{pointer-type}@&&) = delete; constexpr atomic_ref(const atomic_ref&) noexcept; template constexpr atomic_ref(const atomic_ref&) noexcept; @@ -7087,6 +7097,7 @@ #define @\libmacro{ATOMIC_BOOL_LOCK_FREE}@ @\seebelow@ #define @\libmacro{ATOMIC_CHAR_LOCK_FREE}@ @\seebelow@ +#define @\libmacro{ATOMIC_CHAR8_T_LOCK_FREE}@ @\seebelow@ #define @\libmacro{ATOMIC_CHAR16_T_LOCK_FREE}@ @\seebelow@ #define @\libmacro{ATOMIC_CHAR32_T_LOCK_FREE}@ @\seebelow@ #define @\libmacro{ATOMIC_WCHAR_T_LOCK_FREE}@ @\seebelow@ @@ -9490,6 +9501,16 @@ \pnum Condition variable construction and destruction need not be synchronized. +\pnum +The definitions in \ref{thread.condition} +make use of the following exposition-only function: +\begin{codeblock} +template + chrono::steady_clock::time_point @\exposid{rel-to-abs}@(const Dur& rel_time) + { return chrono::steady_clock::now() + + chrono::ceil(rel_time); } +\end{codeblock} + \rSec2[condition.variable.syn]{Header \tcode{} synopsis} \indexheader{condition_variable}% @@ -9836,7 +9857,7 @@ \effects Equivalent to: \begin{codeblock} -return wait_until(lock, chrono::steady_clock::now() + rel_time); +return wait_until(lock, @\exposid{rel-to-abs}@(rel_time)); \end{codeblock} \pnum @@ -9946,7 +9967,7 @@ \effects Equivalent to: \begin{codeblock} -return wait_until(lock, chrono::steady_clock::now() + rel_time, std::move(pred)); +return wait_until(lock, @\exposid{rel-to-abs}@(rel_time), std::move(pred)); \end{codeblock} \pnum @@ -10220,7 +10241,7 @@ \effects Equivalent to: \begin{codeblock} -return wait_until(lock, chrono::steady_clock::now() + rel_time); +return wait_until(lock, @\exposid{rel-to-abs}@(rel_time)); \end{codeblock} \pnum @@ -10288,7 +10309,7 @@ \effects Equivalent to: \begin{codeblock} -return wait_until(lock, chrono::steady_clock::now() + rel_time, std::move(pred)); +return wait_until(lock, @\exposid{rel-to-abs}@(rel_time), std::move(pred)); \end{codeblock} \end{itemdescr} @@ -10407,7 +10428,7 @@ \effects Equivalent to: \begin{codeblock} -return wait_until(lock, std::move(stoken), chrono::steady_clock::now() + rel_time, +return wait_until(lock, std::move(stoken), @\exposid{rel-to-abs}@(rel_time), std::move(pred)); \end{codeblock} \end{itemdescr} diff --git a/source/time.tex b/source/time.tex index fa46de5bfb..1b640d0657 100644 --- a/source/time.tex +++ b/source/time.tex @@ -1287,7 +1287,10 @@ \pnum \tcode{Rep} shall be an arithmetic type or a class emulating an arithmetic type. -If \tcode{duration} is instantiated with a \tcode{duration} type as the argument for the template +If a specialization of \tcode{duration} +is instantiated with +a cv-qualified type or a specialization of \tcode{duration} +as the argument for the template parameter \tcode{Rep}, the program is ill-formed. \pnum @@ -10788,11 +10791,17 @@ the locale's alternate time representation. \\ \rowsep \tcode{\%y} & -The last two decimal digits of the year. +The last two decimal digits of the year, +regardless of the sign of the year. If the result is a single digit, it is prefixed by \tcode{0}. The modified command \tcode{\%Oy} produces the locale's alternative representation. The modified command \tcode{\%Ey} produces the locale's alternative representation of offset from \tcode{\%EC} (year only). +\begin{tailexample} +\begin{codeblock} +cout << format("{:%C %y}", -1976y); // prints \tcode{-20 76} +\end{codeblock} +\end{tailexample} \\ \rowsep \tcode{\%Y} & The year as a decimal number. @@ -11465,7 +11474,8 @@ The modified command \tcode{\%EX} interprets the locale's alternate time representation. \\ \rowsep \tcode{\%y} & -The last two decimal digits of the year. +The last two decimal digits of the year, +regardless of the sign of the year. If the century is not otherwise specified (e.g., with \tcode{\%C}), values in the range \crange{69}{99} @@ -11478,6 +11488,12 @@ Leading zeroes are permitted but not required. The modified commands \tcode{\%Ey} and \tcode{\%Oy} interpret the locale's alternative representation. +\begin{tailexample} +\begin{codeblock} +year y; +istringstream{"-20 76"} >> parse("%3C %y", y); // results in \tcode{y == -1976y} being \tcode{true} +\end{codeblock} +\end{tailexample} \\ \rowsep \tcode{\%Y} & The year as a decimal number. diff --git a/source/utilities.tex b/source/utilities.tex index 09be66f705..65ae79164f 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -3966,7 +3966,7 @@ \begin{itemdescr} \pnum -\mandates +\constraints \tcode{is_constructible_v} is \tcode{true}. \pnum @@ -5925,7 +5925,8 @@ \pnum \throws -Any exception thrown by direct-initializing any $\tcode{T}_i$ for all $i$. +Any exception thrown by +the initialization of the contained value. \pnum \remarks @@ -5956,7 +5957,8 @@ \pnum \throws -Any exception thrown by move-constructing any $\tcode{T}_i$ for all $i$. +Any exception thrown by +the initialization of the contained value. \pnum \remarks @@ -6024,7 +6026,8 @@ \pnum \throws -Any exception thrown by the initialization of the selected alternative $\tcode{T}_j$. +Any exception thrown by +the initialization of the contained value. \pnum \remarks @@ -6058,7 +6061,8 @@ \pnum \throws -Any exception thrown by calling the selected constructor of \tcode{T}. +Any exception thrown by +the initialization of the contained value. \pnum \remarks @@ -6091,7 +6095,8 @@ \pnum \throws -Any exception thrown by calling the selected constructor of \tcode{T}. +Any exception thrown by +the initialization of the contained value. \pnum \remarks @@ -6125,7 +6130,8 @@ \pnum \throws -Any exception thrown by calling the selected constructor of $\tcode{T}_I$. +Any exception thrown by +the initialization of the contained value. \pnum \remarks @@ -6158,6 +6164,11 @@ \ensures \tcode{index()} is \tcode{I}. +\pnum +\throws +Any exception thrown by +the initialization of the contained value. + \pnum \remarks If $\tcode{T}_I$'s selected constructor is a constexpr constructor, this @@ -10542,7 +10553,7 @@ constexpr reference& operator=(const reference& x) noexcept; // for \tcode{b[i] = b[j];} constexpr const reference& operator=(bool x) const noexcept; constexpr operator bool() const noexcept; // for \tcode{x = b[i];} - constexpr bool operator~() const noexcept; // flips the bit + constexpr bool operator~() const noexcept; constexpr reference& flip() noexcept; // for \tcode{b[i].flip();} friend constexpr void swap(reference x, reference y) noexcept; @@ -10687,6 +10698,29 @@ \tcode{*this}. \end{itemdescr} +\indexlibrarymember{operator bool}{bitset::reference}% +\begin{itemdecl} +constexpr reference::operator bool() const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +\tcode{true} if the value of the bit referred to by \tcode{*this} is one, +\tcode{false} otherwise. +\end{itemdescr} + +\indexlibrarymember{operator~}{bitset::reference}% +\begin{itemdecl} +constexpr bool reference::operator~() const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +\tcode{!bool(*this)}. +\end{itemdescr} + \indexlibrarymember{swap}{bitset::reference}% \begin{itemdecl} constexpr void swap(reference x, reference y) noexcept;