diff --git a/source/containers.tex b/source/containers.tex index d7032dfd28..125532df27 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -8942,7 +8942,7 @@ \indexlibrarymember{erase}{hive}% \begin{itemdecl} -template +template typename hive::size_type erase(hive& c, const U& value); \end{itemdecl} @@ -8952,7 +8952,7 @@ \effects Equivalent to: \begin{codeblock} -return erase_if(c, [&](auto& elem) { return elem == value; }); +return erase_if(c, [&](const auto& elem) -> bool { return elem == value; }); \end{codeblock} \end{itemdescr} @@ -17940,7 +17940,7 @@ \tcode{*this} and \tcode{args...} are unchanged. Otherwise equivalent to: \begin{codeblock} -auto key_it = ranges::upper_bound(@\exposid{c}@.keys, k, @\exposid{compare}@); +auto key_it = upper_bound(@\exposid{c}@.keys.begin(), @\exposid{c}@.keys.end(), k, @\exposid{compare}@); auto value_it = @\exposid{c}@.values.begin() + distance(@\exposid{c}@.keys.begin(), key_it); @\exposid{c}@.keys.emplace(key_it, std::forward(k)); @\exposid{c}@.values.emplace(value_it, std::forward(args)...); @@ -21803,6 +21803,13 @@ \pnum \returns $s_r$ as defined in \tcode{m.is_strided()} above. + +\pnum +\begin{note} +It is not required for \tcode{m.stride(r)} to be well-formed +if \tcode{m.extents().rank()} is zero, +even if \tcode{m.is_always_strided()} is \tcode{true}. +\end{note} \end{itemdescr} \begin{itemdecl} diff --git a/source/exec.tex b/source/exec.tex index 8fa3c30a24..75700088d7 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -1189,9 +1189,8 @@ template concept @\deflibconcept{operation_state}@ = @\libconcept{derived_from}@ && - is_object_v && requires (O& o) { - { start(o) } noexcept; + start(o); }; } \end{codeblock} @@ -1279,6 +1278,8 @@ the expression \tcode{\exposid{FWD-ENV}(env).query(q, as...)} is ill-formed if \tcode{forwarding_query(q)} is \tcode{false}; otherwise, it is expression-equivalent to \tcode{env.query(q, as...)}. +The type \tcode{\exposid{FWD-ENV-T}(Env)} is +\tcode{decltype(\exposid{FWD-ENV}(declval()))}. \pnum For a query object \tcode{q} and \tcode{a} subexpression \tcode{v}, @@ -1946,9 +1947,12 @@ @\exposconcept{is-sender}@ || @\exposconcept{is-awaitable}@>>; // \ref{exec.awaitable} + template + inline constexpr bool enable_sender = @\exposconcept{enable-sender}@; + template concept @\deflibconcept{sender}@ = - bool(@\exposconcept{enable-sender}@>) && + enable_sender> && requires (const remove_cvref_t& sndr) { { get_env(sndr) } -> @\exposconcept{queryable}@; } && @@ -1989,6 +1993,17 @@ starting the resulting operation state are permissible completions for \tcode{Sndr} and \tcode{Env}. +\pnum +\remarks +Pursuant to \ref{namespace.std}, +users may specialize \tcode{enable_sender} to +\tcode{true} for cv-unqualified program-defined types that +model \libconcept{sender}, and +\tcode{false} for types that do not. +Such specializations shall +be usable in constant expressions\iref{expr.const} and +have type \tcode{const bool}. + \pnum A type models the exposition-only concept \defexposconcept{valid-completion-signatures} @@ -2141,8 +2156,9 @@ } template<@\exposconcept{has-as-awaitable}@ T> - decltype(auto) await_transform(T&& value) - noexcept(noexcept(std::forward(value).as_awaitable(declval()))) { + auto await_transform(T&& value) + noexcept(noexcept(std::forward(value).as_awaitable(declval()))) + -> decltype(std::forward(value).as_awaitable(declval())) { return std::forward(value).as_awaitable(static_cast(*this)); } }; @@ -2231,7 +2247,7 @@ tag_of_t().transform_env(std::forward(sndr), std::forward(env)) \end{codeblock} if that expression is well-formed; -otherwise, \tcode{static_cast(std::forward(env))}. +otherwise, \tcode{\exposid{FWD-ENV}(std::forward(env))}. \pnum \mandates @@ -2561,6 +2577,9 @@ \item Otherwise, \tcode{\exposid{connect-awaitable}(new_sndr, rcvr)}. \end{itemize} +%%FIXME: This sentence should be joined with the previous sentences; +%%FIXME: how to do that with the embeded "madates"?? +Except that \tcode{rcvr} is evaluated only once. \mandates \tcode{\libconcept{sender} \&\& \libconcept{receiver}} is \tcode{true}. @@ -2995,7 +3014,7 @@ is initialized with a callable object equivalent to the following lambda: \begin{codeblock} [](Sndr&& sndr, Rcvr& rcvr) noexcept(@\seebelow@) - requires @\libconcept{sender_in}@<@\exposid{child-type}@, env_of_t> { + requires @\libconcept{sender_in}@<@\exposid{child-type}@, @\exposid{FWD-ENV-T}@(env_of_t)> { auto& [_, sch, child] = sndr; @@ -3025,12 +3044,20 @@ \pnum Let \tcode{Sigs} be a pack of the arguments to the \tcode{completion_signatures} specialization -named by \tcode{completion_signatures_of_t<\exposid{child-type}, env_of_t>}. -Let \exposid{as-tuple} be an alias template -that transforms a completion signature \tcode{Tag(Args...)} into -the tuple specialization \tcode{\exposid{decayed-tuple}}. +named by \tcode{completion_signatures_of_t<\exposid{child-type}, \exposid{FWD-ENV-T}(env_of_t)>}. +Let \exposid{as-tuple} be an alias template such that +\tcode{\exposid{as-tuple}} denotes +the type \tcode{\exposid{decayed-tuple}}, and +let \exposid{is-no\-throw-decay-copy-sig} be a variable template such that +\tcode{auto(\exposid{is-nothrow-decay-copy-sig})} is +a constant expression of type \tcode{bool} and +equal to \tcode{(is_nothrow_constructible_v, Args> \&\& ...)}. +Let \exposid{error-completion} be a pack consisting of +the type \tcode{set_error_t(exception_ptr)} +if \tcode{(\exposid{is-nothrow-decay-copy-sig} \&\&...)} is \tcode{false}, +and an empty pack otherwise. Then \tcode{variant_t} denotes -the type \tcode{variant...>}, +the type \tcode{variant..., \exposid{error-completion}...>}, except with duplicate types removed. \pnum @@ -3081,15 +3108,14 @@ [](auto, auto& state, auto& rcvr, Tag, Args&&... args) noexcept -> void { using result_t = @\exposid{decayed-tuple}@; - constexpr bool nothrow = is_nothrow_constructible_v; + constexpr bool nothrow = (is_nothrow_constructible_v, Args> && ...); try { state.@\exposid{async-result}@.template emplace(Tag(), std::forward(args)...); } catch (...) { - if constexpr (!nothrow) { - set_error(std::move(rcvr), current_exception()); - return; - } + if constexpr (!nothrow) + state.@\exposid{async-result}@.template emplace>(set_error, current_exception()); } start(state.@\exposid{op-state}@); }; @@ -3493,9 +3519,13 @@ \item given a query object \tcode{q}, the expression \tcode{e.query(q)} is expression-equivalent -to \tcode{\exposid{env}.query(q)} if that expression is valid, -otherwise \tcode{e.query(q)} is expression-equivalent -to \tcode{get_env(\exposid{rcvr}).query(q)}. +to \tcode{\exposid{env}.query(q)} if that expression is valid; +otherwise, +if the type of \tcode{q} satisfies \exposconcept{forwarding-query}, +\tcode{e.query(q)} is expression-equivalent +to \tcode{get_env(\exposid{rcvr}).query(q)}; +otherwise, +\tcode{e.query(q)} is ill-formed. \end{itemize} \pnum @@ -3522,7 +3552,7 @@ \pnum Let \tcode{Sigs} be a pack of the arguments to the \tcode{completion_signatures} specialization named by -\tcode{completion_signatures_of_t<\exposid{child-type}, env_of_t>}. +\tcode{completion_signatures_of_t<\exposid{child-type}, \exposid{FWD-ENV-T}(env_of_t)>}. Let \tcode{LetSigs} be a pack of those types in \tcode{Sigs} with a return type of \tcode{\exposid{decayed-typeof}<\exposid{set-cpo}>}. Let \exposid{as-tuple} be an alias template @@ -3540,7 +3570,7 @@ Then \tcode{ops2_variant_t} denotes the type \begin{codeblock} -variant, @\exposid{receiver2}@>...> +variant, @\exposid{receiver2}@>...> \end{codeblock} except with duplicate types removed. @@ -3585,8 +3615,11 @@ is \tcode{false}, then the expression \tcode{\exposid{let-cpo}.transform_env(sndr, env)} is ill-formed. -Otherwise, it is equal to -\tcode{\exposid{JOIN-ENV}(\exposid{let-env}(sndr), \exposid{FWD-ENV}(env))}. +Otherwise, it is equal to: +\begin{codeblock} +auto& [_, _, child] = sndr; +return @\exposid{JOIN-ENV}@(@\exposid{let-env}@(child), @\exposid{FWD-ENV}@(env)); +\end{codeblock} \pnum Let the subexpression \tcode{out_sndr} denote @@ -4153,7 +4186,8 @@ \tcode{e.query(get_stop_token)} is expression-equivalent to \tcode{state.\exposid{stop-src}.get_token()}, and \item -given a query object \tcode{q} with type other than \cv{} \tcode{stop_token_t}, +given a query object \tcode{q} with type other than \cv{} \tcode{stop_token_t} +and whose type satisfies \exposconceptx{forwarding-que\-ry}{forwarding-query}, \tcode{e.query(q)} is expression-equivalent to \tcode{get_env(rcvr).query(q)}. \end{itemize} @@ -4162,7 +4196,7 @@ is initialized with a callable object equivalent to the following lambda expression: \begin{codeblock} -[](Sndr&& sndr, Rcvr& rcvr) noexcept(@$e$@) -> decltype(@$e$@) { +[](Sndr&& sndr, Rcvr& rcvr) noexcept(noexcept(@$e$@)) -> decltype(@$e$@) { return @$e$@; } \end{codeblock} @@ -4180,7 +4214,7 @@ template struct @\exposid{make-state}@ { - template<@\exposconcept{max-1-sender-in}@>... Sndrs> + template<@\exposconcept{max-1-sender-in}@<@\exposid{FWD-ENV-T}@(env_of_t)>... Sndrs> auto operator()(auto, auto, Sndrs&&... sndrs) const { using values_tuple = @\seebelow@; using errors_variant = @\seebelow@; @@ -4217,7 +4251,7 @@ \pnum The alias \tcode{values_tuple} denotes the type \begin{codeblock} -tuple, @\exposid{decayed-tuple}@, optional>...> +tuple), @\exposid{decayed-tuple}@, optional>...> \end{codeblock} if that type is well-formed; otherwise, \tcode{tuple<>}. @@ -4405,7 +4439,7 @@ is initialized with a callable object equivalent to the following lambda: \begin{codeblock} [](Sndr&& sndr, Rcvr& rcvr) noexcept - -> type_identity, env_of_t>> { + -> type_identity, @\exposid{FWD-ENV-T}@(env_of_t)>> { return {}; } \end{codeblock} @@ -4450,14 +4484,14 @@ \tcode{Env} is \tcode{decltype((env))}. If \tcode{\exposconcept{sender-for}} is \tcode{false}, or -if the type \tcode{\exposid{single-sender-value-type}} +if the type \tcode{\exposid{single-sender-value-type}<\linebreak{}\exposid{child-type}, \exposid{FWD-ENV-T}(Env)>} is ill-formed or \tcode{void}, -then the expression \tcode{stopped_as_optional.transform_sender(sndr, env)} +then the expression \tcode{stopped_as_optional.\linebreak{}transform_sender(sndr, env)} is ill-formed; otherwise, it is equivalent to: \begin{codeblock} auto&& [_, _, child] = sndr; -using V = @\exposid{single-sender-value-type}@; +using V = @\exposid{single-sender-value-type}@<@\exposid{child-type}@, @\exposid{FWD-ENV-T}@(Env)>; return let_stopped( then(std::forward_like(child), [](Ts&&... ts) noexcept(is_nothrow_constructible_v) { diff --git a/source/iostreams.tex b/source/iostreams.tex index 638dc8bfd8..adaaf9b073 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -6257,7 +6257,8 @@ is \tcode{true}, calls -\tcode{os.rdbuf()->pubsync()}. If that function returns $-1$, sets \tcode{badbit} in +\tcode{os.rdbuf()->pubsync()}. If that function returns $-1$ or +exits via an exception, sets \tcode{badbit} in \tcode{os.rdstate()} without propagating an exception. \end{itemdescr} diff --git a/source/iterators.tex b/source/iterators.tex index e073c00100..7423730269 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -3068,7 +3068,13 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return last - static_cast\&>(first);} +Equivalent to: +\begin{codeblock} +if constexpr (!is_array_v>) + return last - first; +else + return last - static_cast>(first); +\end{codeblock} \end{itemdescr} \indexlibraryglobal{distance}% @@ -5965,9 +5971,9 @@ friend constexpr iter_difference_t operator-( const counted_iterator& x, const counted_iterator& y); friend constexpr iter_difference_t operator-( - const counted_iterator& x, default_sentinel_t); + const counted_iterator& x, default_sentinel_t) noexcept; friend constexpr iter_difference_t operator-( - default_sentinel_t, const counted_iterator& y); + default_sentinel_t, const counted_iterator& y) noexcept; constexpr counted_iterator& operator-=(iter_difference_t n) requires @\libconcept{random_access_iterator}@; @@ -5978,7 +5984,7 @@ friend constexpr bool operator==( const counted_iterator& x, const counted_iterator& y); friend constexpr bool operator==( - const counted_iterator& x, default_sentinel_t); + const counted_iterator& x, default_sentinel_t) noexcept; template<@\libconcept{common_with}@ I2> friend constexpr strong_ordering operator<=>( @@ -6309,7 +6315,7 @@ \indexlibrarymember{operator-}{counted_iterator}% \begin{itemdecl} friend constexpr iter_difference_t operator-( - const counted_iterator& x, default_sentinel_t); + const counted_iterator& x, default_sentinel_t) noexcept; \end{itemdecl} \begin{itemdescr} @@ -6322,7 +6328,7 @@ \indexlibrarymember{operator-}{counted_iterator}% \begin{itemdecl} friend constexpr iter_difference_t operator-( - default_sentinel_t, const counted_iterator& y); + default_sentinel_t, const counted_iterator& y) noexcept; \end{itemdecl} \begin{itemdescr} @@ -6375,7 +6381,7 @@ \indexlibrarymember{operator==}{counted_iterator}% \begin{itemdecl} friend constexpr bool operator==( - const counted_iterator& x, default_sentinel_t); + const counted_iterator& x, default_sentinel_t) noexcept; \end{itemdecl} \begin{itemdescr} @@ -7243,6 +7249,7 @@ \libheaderrefx{flat_map}{flat.map.syn}, \libheaderrefx{flat_set}{flat.set.syn}, \libheaderrefx{forward_list}{forward.list.syn}, +\libheaderref{hive}, \libheaderrefx{inplace_vector}{inplace.vector.syn}, \libheaderref{list}, \libheaderrefx{map}{associative.map.syn}, diff --git a/source/lib-intro.tex b/source/lib-intro.tex index ea7a21b782..334009aa3c 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1623,6 +1623,7 @@ \ref{expected} & Expected objects & \tcode{} \\ \rowsep \ref{function.objects} & Function objects & \tcode{} \\ \rowsep \ref{bit} & Bit manipulation & \tcode{} \\ \rowsep +\ref{stdbit.h.syn} & C-compatible bit manipulation & \tcode{} \\ \rowsep \ref{array} & Class template \tcode{array} & \tcode{} \\ \rowsep \ref{inplace.vector} & Class template \tcode{inplace_vector} & \tcode{} \\ \rowsep \ref{views.contiguous} & Contiguous access & \tcode{} \\ \rowsep diff --git a/source/numerics.tex b/source/numerics.tex index 529ed10969..f6567f36ac 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -1403,7 +1403,7 @@ // \ref{rand.eng.philox}, class template \tcode{philox_engine} template - class philox_engine; + class philox_engine; // partially freestanding // \ref{rand.predef}, engines and engine adaptors with predefined parameters using minstd_rand0 = @\seebelow@; // freestanding @@ -1415,8 +1415,8 @@ using ranlux24 = @\seebelow@; // freestanding using ranlux48 = @\seebelow@; // freestanding using knuth_b = @\seebelow@; - using philox4x32 = @\seebelow@; - using philox4x64 = @\seebelow@; + using philox4x32 = @\seebelow@; // freestanding + using philox4x64 = @\seebelow@; // freestanding using default_random_engine = @\seebelow@; @@ -3303,10 +3303,10 @@ // inserters and extractors template friend basic_ostream& - operator<<(basic_ostream& os, const philox_engine& x); + operator<<(basic_ostream& os, const philox_engine& x); // hosted template friend basic_istream& - operator>>(basic_istream& is, philox_engine& x); + operator>>(basic_istream& is, philox_engine& x); // hosted }; } \end{codeblock} @@ -16598,9 +16598,9 @@ template constexpr auto chunk(const basic_simd_mask<@\exposid{mask-element-size}@, Abi>& x) noexcept; - template + template<@\exposid{simd-size-type}@ N, class T, class Abi> constexpr auto chunk(const basic_simd& x) noexcept; - template + template<@\exposid{simd-size-type}@ N, size_t Bytes, class Abi> constexpr auto chunk(const basic_simd_mask& x) noexcept; template @@ -17131,10 +17131,10 @@ \pnum If \tcode V is a specialization of \tcode{basic_simd}, let \tcode{Abi1} denote an ABI tag such that \tcode{basic_simd::\brk{}size()} equals -\tcode{V::size()}. +\tcode{N}. If \tcode V is a specialization of \tcode{basic_simd_mask}, let \tcode{Abi1} denote an ABI tag such that \tcode{basic_simd_mask::\brk{}size()} equals \tcode{V::size()}. +Abi1>::size()} equals \tcode{N}. \pnum Where present, the member typedef \tcode{type} names \tcode{basic_simd} @@ -18370,7 +18370,7 @@ \end{itemdescr} \begin{itemdecl} -template +template<@\exposid{simd-size-type}@ N, class T, class Abi> constexpr auto chunk(const basic_simd& x) noexcept; \end{itemdecl} @@ -18381,7 +18381,7 @@ \end{itemdescr} \begin{itemdecl} -template +template<@\exposid{simd-size-type}@ N, size_t Bytes, class Abi> constexpr auto chunk(const basic_simd_mask& x) noexcept; \end{itemdecl} diff --git a/source/ranges.tex b/source/ranges.tex index c16eba7f10..5cadc835ff 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -14009,6 +14009,8 @@ constexpr auto size() const requires @\libconcept{sized_sentinel_for}@, iterator_t>; + + constexpr auto reserve_hint() const noexcept; }; } \end{codeblock} @@ -14062,6 +14064,20 @@ \end{codeblock} \end{itemdescr} +\indexlibrarymember{reserve_hint}{chunk_view::\exposid{outer-iterator}::value_type}% +\begin{itemdecl} +constexpr auto reserve_hint() const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: +\begin{codeblock} +return @\exposid{to-unsigned-like}@(@\exposid{parent_}@->@\exposid{remainder_}@); +\end{codeblock} +\end{itemdescr} + \rSec3[range.chunk.inner.iter]{Class \tcode{chunk_view::\exposid{inner-iterator}}} \indexlibraryglobal{chunk_view::\exposid{inner-iterator}}% @@ -17311,6 +17327,9 @@ constexpr auto size() requires @\libconcept{sized_range}@; constexpr auto size() const requires @\libconcept{sized_range}@; + + constexpr auto reserve_hint() requires @\libconcept{approximately_sized_range}@; + constexpr auto reserve_hint() const requires @\libconcept{approximately_sized_range}@; }; template @@ -17363,6 +17382,18 @@ Equivalent to: \tcode{return ranges::size(\exposid{base_});} \end{itemdescr} +\indexlibrarymember{reserve_hint}{cache_latest_view}% +\begin{itemdecl} +constexpr auto reserve_hint() requires @\libconcept{approximately_sized_range}@; +constexpr auto reserve_hint() const requires @\libconcept{approximately_sized_range}@; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return ranges::reserve_hint(\exposid{base_});} +\end{itemdescr} + \rSec3[range.cache.latest.iterator]{Class \tcode{cache_latest_view::\exposid{iterator}}} \indexlibraryglobal{cache_latest_view::\exposid{iiterator}}% @@ -17660,6 +17691,9 @@ constexpr auto size() requires @\libconcept{sized_range}@; constexpr auto size() const requires @\libconcept{sized_range}@; + + constexpr auto reserve_hint() requires @\libconcept{approximately_sized_range}@; + constexpr auto reserve_hint() const requires @\libconcept{approximately_sized_range}@; }; template @@ -17719,6 +17753,18 @@ Equivalent to: \tcode{return ranges::size(\exposid{base_});} \end{itemdescr} +\indexlibrarymember{reserve_hint}{to_input_view}% +\begin{itemdecl} +constexpr auto reserve_hint() requires @\libconcept{approximately_sized_range}@; +constexpr auto reserve_hint() const requires @\libconcept{approximately_sized_range}@; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return ranges::reserve_hint(\exposid{base_});} +\end{itemdescr} + \rSec3[range.to.input.iterator]{Class template \tcode{to_input_view::\exposid{iterator}}} \begin{codeblock} diff --git a/source/utilities.tex b/source/utilities.tex index ced638f3f7..1df2e2f5fe 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -7789,7 +7789,9 @@ \item \tcode{is_same_v, in_place_t>} is \tcode{false}; and \item -\tcode{is_same_v>, expected} is \tcode{false}; and +\tcode{is_same_v, expected>} is \tcode{false}; and +\item +\tcode{is_same_v, unexpect_t>} is \tcode{false}; and \item \tcode{remove_cvref_t} is not a specialization of \tcode{unexpected}; and \item @@ -15503,6 +15505,8 @@ \indexheader{stdbit.h}% \begin{codeblock} +// all freestanding + #define @\libmacro{__STDC_VERSION_STDBIT_H__}@ 202311L #define @\libmacro{__STDC_ENDIAN_BIG__}@ @\seebelow@