From 9bda6fb52fbeb95f968ceed77c3d1b80ebea2674 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 24 Jun 2025 19:26:42 -0700 Subject: [PATCH 01/24] LWG4198 schedule_from isn't starting the schedule sender if decay-copying results throws --- source/exec.tex | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 8fa3c30a24..b3bd99ce73 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -3026,11 +3026,19 @@ 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}}. +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 +3089,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}@); }; From ca8c1f54324973ab693d4d03a3d9532e59f25d74 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 24 Jun 2025 19:42:47 -0700 Subject: [PATCH 02/24] LWG4202 enable-sender should be a variable template --- source/exec.tex | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index b3bd99ce73..447ac50fc2 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -1946,9 +1946,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 +1992,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} From b6d773d10237cb13eb2629e4bd99768e42f00366 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 24 Jun 2025 21:29:20 -0700 Subject: [PATCH 03/24] LWG4203 Constraints on get-state functions are incorrect --- source/exec.tex | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 447ac50fc2..06fae0729b 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -1279,6 +1279,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}, @@ -3009,7 +3011,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; @@ -3039,7 +3041,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>}. +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 @@ -3514,9 +3516,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 @@ -3543,7 +3549,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 @@ -4174,7 +4180,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} @@ -4201,7 +4208,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@; @@ -4238,7 +4245,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<>}. @@ -4426,7 +4433,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} @@ -4471,14 +4478,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) { From 9002782f81935194e907a8f9cdfe111ea5ea781c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 24 Jun 2025 22:59:06 -0700 Subject: [PATCH 04/24] LWG4204 specification of as-sndr2(Sig) in [exec.let] is incomplete --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 06fae0729b..34febd8508 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -3567,7 +3567,7 @@ Then \tcode{ops2_variant_t} denotes the type \begin{codeblock} -variant, @\exposid{receiver2}@>...> +variant, @\exposid{receiver2}@>...> \end{codeblock} except with duplicate types removed. From 0450df0dfdcc63d04ab8df49c947006567edf034 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 24 Jun 2025 23:05:48 -0700 Subject: [PATCH 05/24] LWG4205 let_[*].transform_env is specified in terms of the let_* sender itself instead of its child [exec.let] Added : before codeblock for consistency. --- source/exec.tex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 34febd8508..b2c7335776 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -3612,8 +3612,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 From 9e7d5b5610d2007d9f07c1cfd11f27c6df53c22d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 24 Jun 2025 23:24:07 -0700 Subject: [PATCH 06/24] LWG4208 Wording needs to ensure that in connect(sndr, rcvr) that rcvr expression is only evaluated once --- source/exec.tex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/exec.tex b/source/exec.tex index b2c7335776..872a0a4ef5 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -2577,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}. From 3b4b53e4e99faaff2e4870bb81f6a8d724392a89 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 24 Jun 2025 23:27:52 -0700 Subject: [PATCH 07/24] LWG4209 default_domain::transform_env should be returning FWD-ENV(env) --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 872a0a4ef5..6885ceb7e9 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -2247,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 From 4fb7ce6cee166c27bae0c1c9795cc20e8424f10a Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 24 Jun 2025 23:31:09 -0700 Subject: [PATCH 08/24] LWG4188 ostream::sentry destructor should handle exceptions --- source/iostreams.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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} From 978696a145dd6caf7242f79eeddb1a674574c6ec Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 24 Jun 2025 23:35:08 -0700 Subject: [PATCH 09/24] LWG4200 The operation_state concept can be simplified --- source/exec.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index 6885ceb7e9..ecdffc0557 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} From 0d0bce127314a2b07caf6e13927932edee029ec4 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 24 Jun 2025 23:44:12 -0700 Subject: [PATCH 10/24] LWG4201 with-await-transform::await_transform should not use a deduced return type --- source/exec.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index ecdffc0557..2f928ba629 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -2156,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)); } }; From d4ae4b0bd49e9ebd28ae9eeff09746cadcb3c79c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 24 Jun 2025 23:52:23 -0700 Subject: [PATCH 11/24] LWG4217 Clarify mdspan layout mapping requirements for rank == 0 --- source/containers.tex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/containers.tex b/source/containers.tex index d7032dfd28..db8f9e7958 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -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} From 408782294d9163be8b72a20620e9cda5c62d6b85 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 00:44:10 -0700 Subject: [PATCH 12/24] LWG4222 expected constructor from a single value missing a constraint [expected.object.cons]p23.2 Fly-by fix expression (">" in wrong place). --- source/utilities.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index ced638f3f7..3edee64da5 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 From 6cb65d4f46d33c5e4efebf8c0d2aac1699f18611 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 01:01:39 -0700 Subject: [PATCH 13/24] LWG4224 Philox engines should be freestanding --- source/numerics.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index 529ed10969..d497d6a296 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} From 527b455beaafa867da244da7b9a0a56cbce6ce3c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 01:05:32 -0700 Subject: [PATCH 14/24] LWG4227 Missing noexcept operator in [exec.when.all] --- source/exec.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exec.tex b/source/exec.tex index 2f928ba629..75700088d7 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -4196,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} From fbc37ec1e48f85965d3c991f2cd5e67f74fcba9f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 01:17:28 -0700 Subject: [PATCH 15/24] LWG4231 datapar::chunk should use simd-size-type instead of size_t --- source/numerics.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index d497d6a296..e77e126fe8 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -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 @@ -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} From 0b834965b6d51d2c38a14cfe38daea40b8e79ea9 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 01:22:34 -0700 Subject: [PATCH 16/24] LWG4232 datapar::resize does not resize --- source/numerics.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index e77e126fe8..f6567f36ac 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -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} From c1285b7d9a9175c4fe4e39d07a5f91713bf8ec20 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 01:26:08 -0700 Subject: [PATCH 17/24] LWG4233 The helper lambda of std::erase for hive should specify return type as bool --- source/containers.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index db8f9e7958..3872ba2dcc 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} From be45d8a366963d5376bd6050b2c2fa44c4ac0f18 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 01:28:53 -0700 Subject: [PATCH 18/24] LWG4234 Including doesn't provide std::begin/end --- source/iterators.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/iterators.tex b/source/iterators.tex index e073c00100..ccd545cfc4 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -7243,6 +7243,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}, From de326ef80de136b8404baf403dc8b92912a51e73 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 02:20:58 -0700 Subject: [PATCH 19/24] LWG4235 cache_latest_view and to_input_view miss reserve_hint --- source/ranges.tex | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/source/ranges.tex b/source/ranges.tex index c16eba7f10..5c8153b0c5 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -17311,6 +17311,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 +17366,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 +17675,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 +17737,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} From 543742d40227dbe0fbcdbcb8a534898c291630e8 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 13:57:33 -0700 Subject: [PATCH 20/24] LWG4236 chunk_view::outer-iterator::value_type should provide reserve_hint --- source/ranges.tex | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/source/ranges.tex b/source/ranges.tex index 5c8153b0c5..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}}% From 6ff27d1ec425298d7e8bdf8c507a342f756066b9 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 14:01:04 -0700 Subject: [PATCH 21/24] LWG4239 flat_map's transparent comparator no longer works for string literals --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 3872ba2dcc..125532df27 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -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)...); From 660bdecd9dc91761a1329f86fd47a0ffa8c18a61 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 14:03:59 -0700 Subject: [PATCH 22/24] LWG4242 ranges::distance does not work with volatile iterators --- source/iterators.tex | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/iterators.tex b/source/iterators.tex index ccd545cfc4..c5460d8d9f 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}% From b06b8198c447a6d07c2fac3e1c46e60ef0849bdb Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 14:08:32 -0700 Subject: [PATCH 23/24] LWG4245 Operators that interact with counted_iterator and default_sentinel_t should be noexcept --- source/iterators.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index c5460d8d9f..7423730269 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -5971,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}@; @@ -5984,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<=>( @@ -6315,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} @@ -6328,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} @@ -6381,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} From 9d78e1e3a36bf58637af4b6dafca2ad32c552803 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 25 Jun 2025 14:17:54 -0700 Subject: [PATCH 24/24] LWG4247 Header is not yet freestanding --- source/lib-intro.tex | 1 + source/utilities.tex | 2 ++ 2 files changed, 3 insertions(+) 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/utilities.tex b/source/utilities.tex index 3edee64da5..1df2e2f5fe 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -15505,6 +15505,8 @@ \indexheader{stdbit.h}% \begin{codeblock} +// all freestanding + #define @\libmacro{__STDC_VERSION_STDBIT_H__}@ 202311L #define @\libmacro{__STDC_ENDIAN_BIG__}@ @\seebelow@