From 8f8695064280fcdad99ab8680935f6555368ef00 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2025 19:23:58 -0800 Subject: [PATCH 1/9] LWG3578 Iterator SCARYness in the context of associative container merging --- source/containers.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 825c283008..a36bba936c 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -3535,7 +3535,7 @@ \pnum \expects -\tcode{a.get_allocator() == a2.get_allocator()}. +\tcode{a.get_allocator() == a2.get_allocator()} is \tcode{true}. \pnum \effects @@ -3550,7 +3550,8 @@ \ensures Pointers and references to the transferred elements of \tcode{a2} refer to those same elements but as members of \tcode{a}. -Iterators referring to the transferred elements +If \tcode{a.begin()} and \tcode{a2.begin()} have the same type, +iterators referring to the transferred elements will continue to refer to their elements, but they now behave as iterators into \tcode{a}, not into \tcode{a2}. From c17aba2cae826db248704fdc4b323b3ffd14898d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2025 19:27:38 -0800 Subject: [PATCH 2/9] LWG3956 chrono::parse uses from_stream as a customization point --- source/lib-intro.tex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 8d21e19b18..2e4d9f9d33 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1121,7 +1121,8 @@ \pnum Whenever an unqualified name other than -\tcode{swap}, \tcode{make_error_code}, \tcode{make_error_condition}, or +\tcode{swap}, \tcode{make_error_code}, \tcode{make_error_condition}, +\tcode{from_stream}, or \tcode{submdspan_mapping} is used in the specification of a declaration \tcode{D} in \ref{\firstlibchapter} through \ref{\lastlibchapter} or \ref{depr}, @@ -1145,7 +1146,8 @@ in an overload resolution context for swappable values\iref{swappable.requirements}. The meanings of the unqualified names -\tcode{make_error_code}, \tcode{make_error_condition}, and +\tcode{make_error_code}, \tcode{make_error_condition}, +\tcode{from_stream}, and \tcode{submdspan_mapping} are established as-if by performing argument-dependent lookup\iref{basic.lookup.argdep}. From 3506bbe19969791c9d3e0b4845abb0d8251823b4 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2025 19:37:11 -0800 Subject: [PATCH 3/9] LWG4172 unique_lock self-move-assignment is broken Change suggested on the LWG reflector: Use parens instead of braced-init. --- source/threads.tex | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 614bae78ef..12c0b7084f 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -7634,7 +7634,7 @@ unique_lock& operator=(const unique_lock&) = delete; unique_lock(unique_lock&& u) noexcept; - unique_lock& operator=(unique_lock&& u); + unique_lock& operator=(unique_lock&& u) noexcept; // \ref{thread.lock.unique.locking}, locking void lock(); @@ -7821,26 +7821,17 @@ \indexlibrarymember{operator=}{unique_lock}% \begin{itemdecl} -unique_lock& operator=(unique_lock&& u); +unique_lock& operator=(unique_lock&& u) noexcept; \end{itemdecl} \begin{itemdescr} \pnum \effects -If \tcode{owns} calls \tcode{pm->unlock()}. - -\pnum -\ensures -\tcode{pm == u_p.pm} and \tcode{owns == u_p.owns} (where \tcode{u_p} is the state of \tcode{u} just prior to this construction), \tcode{u.pm == 0} and \tcode{u.owns == false}. +Equivalent to: \tcode{unique_lock(std::move(u)).swap(*this)} \pnum -\begin{note} -With a recursive mutex it is possible for both \tcode{*this} and \tcode{u} to own the same mutex before the assignment. In this case, \tcode{*this} will own the mutex after the assignment and \tcode{u} will not. -\end{note} - -\pnum -\throws -Nothing. +\returns +\tcode{*this}. \end{itemdescr} \indexlibrarydtor{unique_lock}% @@ -8327,13 +8318,11 @@ \begin{itemdescr} \pnum \effects -If \tcode{owns} calls \tcode{pm->unlock_shared()}. +Equivalent to: \tcode{shared_lock(std::move(sl)).swap(*this)} \pnum -\ensures -\tcode{pm == sl_p.pm} and \tcode{owns == sl_p.owns} (where -\tcode{sl_p} is the state of \tcode{sl} just prior to this assignment), -\tcode{sl.pm == nullptr} and \tcode{sl.owns == false}. +\returns +\tcode{*this}. \end{itemdescr} \rSec4[thread.lock.shared.locking]{Locking} From 05c2eb8a0e3c0f869da8e88b75b5a8ffc92563b5 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2025 19:55:10 -0800 Subject: [PATCH 4/9] LWG4175 get_env() specified in terms of as_const() but this doesn't work with rvalue senders --- source/exec.tex | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index af6a5cf55c..59ebf56427 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -101,6 +101,13 @@ Otherwise, \tcode{make_exception_ptr(err)}. \end{itemize} +\pnum +For a subexpression \tcode{expr}, +let \tcode{\exposid{AS-CONST}(expr)} be expression-equivalent to +\begin{codeblock} +[](const auto& x) noexcept -> const auto& { return x; }(expr) +\end{codeblock} + \rSec1[exec.queryable]{Queries and queryables} \rSec2[exec.queryable.general]{General} @@ -789,7 +796,7 @@ The name \tcode{get_allocator} denotes a query object. For a subexpression \tcode{env}, \tcode{get_allocator(env)} is expression-equivalent to -\tcode{\exposid{MANDATE-NOTHROW}(as_const(env).query(get_allocator))}. +\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_allocator))}. \mandates If the expression above is well-formed, @@ -811,7 +818,7 @@ \tcode{get_stop_token(env)} is expression-equivalent to: \begin{itemize} \item -\tcode{\exposid{MANDATE-NOTHROW}(as_const(env).query(get_stop_token))} +\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_stop_token))} if that expression is well-formed. \mandates @@ -833,7 +840,7 @@ \tcode{execution::get_env(o)} is expression-equivalent to: \begin{itemize} \item -\tcode{\exposid{MANDATE-NOTHROW}(as_const(o).get_env())} +\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(o).get_env())} if that expression is well-formed. \mandates @@ -864,7 +871,7 @@ The name \tcode{get_domain} denotes a query object. For a subexpression \tcode{env}, \tcode{get_domain(env)} is expression-equivalent to -\tcode{\exposid{MANDATE-NOTHROW}(as_const(env).query(get_domain))}. +\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_domain))}. \pnum \tcode{forwarding_query(execution::get_domain)} is @@ -879,7 +886,7 @@ The name \tcode{get_scheduler} denotes a query object. For a subexpression \tcode{env}, \tcode{get_scheduler(env)} is expression-equivalent to -\tcode{\exposid{MANDATE-NOTHROW}(as_const(env).query(get_scheduler))}. +\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_scheduler))}. \mandates If the expression above is well-formed, @@ -900,7 +907,7 @@ The name \tcode{get_delegation_scheduler} denotes a query object. For a subexpression \tcode{env}, \tcode{get_delegation_scheduler(env)} is expression-equivalent to -\tcode{\exposid{MANDATE-NOTHROW}(as_const(env).query(get_delegation_scheduler))}. +\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(env).query(get_delegation_scheduler))}. \mandates If the expression above is well-formed, @@ -936,7 +943,7 @@ \tcode{get_forward_progress_guarantee(sch)} is expression-equivalent to: \begin{itemize} \item -\tcode{\exposid{MANDATE-NOTHROW}(as_const(sch).query(get_forward_progress_guarantee))}, +\tcode{\exposid{MANDATE-NOTHROW}(\exposid{AS-CONST}(sch).query(get_forward_progress_guarantee))}, if that expression is well-formed. \mandates @@ -970,7 +977,7 @@ Otherwise, \tcode{get_completion_scheduler<\exposid{completion-tag}>(q)} is expression-equivalent to \begin{codeblock} -@\exposid{MANDATE-NOTHROW}@(as_const(q).query(get_completion_scheduler<@\exposid{completion-tag}@>)) +@\exposid{MANDATE-NOTHROW}@(@\exposid{AS-CONST}@(q).query(get_completion_scheduler<@\exposid{completion-tag}@>)) \end{codeblock} \mandates If the expression above is well-formed, From 3187371eac3ba95e4e423400ba8ad20ecc295c56 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2025 20:02:21 -0800 Subject: [PATCH 5/9] LWG4179 Wrong range in [alg.search] --- source/algorithms.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 54005ee3d5..be5be73333 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -4606,7 +4606,7 @@ \begin{itemdescr} \pnum \returns -The first iterator \tcode{i} in the range \range{first1}{last1 - (last2 - first2)} +The first iterator \tcode{i} in the range \crange{first1}{last1 - (last2 - first2)} such that for every non-negative integer \tcode{n} less than \tcode{last2 - first2} the following corresponding conditions hold: @@ -4644,7 +4644,7 @@ \item \tcode{\{i, i + (last2 - first2)\}}, where \tcode{i} is - the first iterator in the range \range{first1}{last1 - (last2 - first2)} + the first iterator in the range \crange{first1}{last1 - (last2 - first2)} such that for every non-negative integer \tcode{n} less than \tcode{last2 - first2} the condition @@ -4705,7 +4705,7 @@ \pnum \returns -The first iterator \tcode{i} in the range \range{first}{last - count} +The first iterator \tcode{i} in the range \crange{first}{last - count} such that for every non-negative integer \tcode{n} less than \tcode{count} the condition $E$ is \tcode{true}. Returns \tcode{last} if no such iterator is found. @@ -4736,7 +4736,7 @@ \pnum \returns \tcode{\{i, i + count\}} -where \tcode{i} is the first iterator in the range \range{first}{last - count} +where \tcode{i} is the first iterator in the range \crange{first}{last - count} such that for every non-negative integer \tcode{n} less than \tcode{count}, the following condition holds: \tcode{invoke(pred, invoke(proj, *(i + n)), value)}. From fd4488ed1fa0feea3fc9952367b51ae3caf36dde Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2025 20:04:27 -0800 Subject: [PATCH 6/9] LWG4186 regex_traits::transform_primary mistakenly detects typeid of a function --- source/text.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/text.tex b/source/text.tex index 6047d05737..a525f2c352 100644 --- a/source/text.tex +++ b/source/text.tex @@ -10106,7 +10106,7 @@ \effects If \begin{codeblock} -typeid(use_facet>) == typeid(collate_byname) +typeid(use_facet>(getloc())) == typeid(collate_byname) \end{codeblock} and the form of the sort key returned by \tcode{collate_byname::transform(first, last)} is known and From 35afb0e565955ee4f84b843b6e019c4207cd77a2 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2025 20:36:33 -0800 Subject: [PATCH 7/9] LWG4189 cache_latest_view should be freestanding --- source/ranges.tex | 327 +++++++++++++++++++++++---------------------- source/support.tex | 2 +- 2 files changed, 166 insertions(+), 163 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 20eefbdafb..bc10e2b0af 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -27,6 +27,7 @@ \indexheader{ranges}% \indexlibraryglobal{all_t}% \begin{codeblock} +// mostly freestanding #include // see \ref{compare.syn} #include // see \ref{initializer.list.syn} #include // see \ref{iterator.synopsis} @@ -34,170 +35,170 @@ namespace std::ranges { inline namespace @\unspec@ { // \ref{range.access}, range access - inline constexpr @\unspec@ begin = @\unspec@; // freestanding - inline constexpr @\unspec@ end = @\unspec@; // freestanding - inline constexpr @\unspec@ cbegin = @\unspec@; // freestanding - inline constexpr @\unspec@ cend = @\unspec@; // freestanding - inline constexpr @\unspec@ rbegin = @\unspec@; // freestanding - inline constexpr @\unspec@ rend = @\unspec@; // freestanding - inline constexpr @\unspec@ crbegin = @\unspec@; // freestanding - inline constexpr @\unspec@ crend = @\unspec@; // freestanding - - inline constexpr @\unspec@ size = @\unspec@; // freestanding - inline constexpr @\unspec@ ssize = @\unspec@; // freestanding - inline constexpr @\unspec@ empty = @\unspec@; // freestanding - inline constexpr @\unspec@ data = @\unspec@; // freestanding - inline constexpr @\unspec@ cdata = @\unspec@; // freestanding + inline constexpr @\unspec@ begin = @\unspec@; + inline constexpr @\unspec@ end = @\unspec@; + inline constexpr @\unspec@ cbegin = @\unspec@; + inline constexpr @\unspec@ cend = @\unspec@; + inline constexpr @\unspec@ rbegin = @\unspec@; + inline constexpr @\unspec@ rend = @\unspec@; + inline constexpr @\unspec@ crbegin = @\unspec@; + inline constexpr @\unspec@ crend = @\unspec@; + + inline constexpr @\unspec@ size = @\unspec@; + inline constexpr @\unspec@ ssize = @\unspec@; + inline constexpr @\unspec@ empty = @\unspec@; + inline constexpr @\unspec@ data = @\unspec@; + inline constexpr @\unspec@ cdata = @\unspec@; } // \ref{range.range}, ranges template - concept range = @\seebelow@; // freestanding + concept range = @\seebelow@; template - constexpr bool enable_borrowed_range = false; // freestanding + constexpr bool enable_borrowed_range = false; template - concept borrowed_range = @\seebelow@; // freestanding + concept borrowed_range = @\seebelow@; template - using iterator_t = decltype(ranges::begin(declval())); // freestanding + using iterator_t = decltype(ranges::begin(declval())); template<@\libconcept{range}@ R> - using sentinel_t = decltype(ranges::end(declval())); // freestanding + using sentinel_t = decltype(ranges::end(declval())); template<@\libconcept{range}@ R> - using const_iterator_t = decltype(ranges::cbegin(declval())); // freestanding + using const_iterator_t = decltype(ranges::cbegin(declval())); template<@\libconcept{range}@ R> - using const_sentinel_t = decltype(ranges::cend(declval())); // freestanding + using const_sentinel_t = decltype(ranges::cend(declval())); template<@\libconcept{range}@ R> - using range_difference_t = iter_difference_t>; // freestanding + using range_difference_t = iter_difference_t>; template<@\libconcept{sized_range}@ R> - using range_size_t = decltype(ranges::size(declval())); // freestanding + using range_size_t = decltype(ranges::size(declval())); template<@\libconcept{range}@ R> - using range_value_t = iter_value_t>; // freestanding + using range_value_t = iter_value_t>; template<@\libconcept{range}@ R> - using range_reference_t = iter_reference_t>; // freestanding + using range_reference_t = iter_reference_t>; template<@\libconcept{range}@ R> - using range_const_reference_t = iter_const_reference_t>; // freestanding + using range_const_reference_t = iter_const_reference_t>; template<@\libconcept{range}@ R> - using range_rvalue_reference_t = iter_rvalue_reference_t>; // freestanding + using range_rvalue_reference_t = iter_rvalue_reference_t>; template<@\libconcept{range}@ R> - using range_common_reference_t = iter_common_reference_t>; // freestanding + using range_common_reference_t = iter_common_reference_t>; // \ref{range.sized}, sized ranges template - constexpr bool disable_sized_range = false; // freestanding + constexpr bool disable_sized_range = false; template - concept sized_range = @\seebelow@; // freestanding + concept sized_range = @\seebelow@; // \ref{range.view}, views template - constexpr bool enable_view = @\seebelow@; // freestanding + constexpr bool enable_view = @\seebelow@; - struct view_base {}; // freestanding + struct view_base {}; template - concept view = @\seebelow@; // freestanding + concept view = @\seebelow@; // \ref{range.refinements}, other range refinements template - concept output_range = @\seebelow@; // freestanding + concept output_range = @\seebelow@; template - concept input_range = @\seebelow@; // freestanding + concept input_range = @\seebelow@; template - concept forward_range = @\seebelow@; // freestanding + concept forward_range = @\seebelow@; template - concept bidirectional_range = @\seebelow@; // freestanding + concept bidirectional_range = @\seebelow@; template - concept random_access_range = @\seebelow@; // freestanding + concept random_access_range = @\seebelow@; template - concept contiguous_range = @\seebelow@; // freestanding + concept contiguous_range = @\seebelow@; template - concept common_range = @\seebelow@; // freestanding + concept common_range = @\seebelow@; template - concept viewable_range = @\seebelow@; // freestanding + concept viewable_range = @\seebelow@; template - concept constant_range = @\seebelow@; // freestanding + concept constant_range = @\seebelow@; // \ref{view.interface}, class template \tcode{view_interface} template requires is_class_v && @\libconcept{same_as}@> - class view_interface; // freestanding + class view_interface; // \ref{range.subrange}, sub-ranges - enum class @\libglobal{subrange_kind}@ : bool { @\libmember{unsized}{subrange_kind}@, @\libmember{sized}{subrange_kind}@ }; // freestanding + enum class @\libglobal{subrange_kind}@ : bool { @\libmember{unsized}{subrange_kind}@, @\libmember{sized}{subrange_kind}@ }; template<@\libconcept{input_or_output_iterator}@ I, @\libconcept{sentinel_for}@ S = I, subrange_kind K = @\seebelow@> requires (K == subrange_kind::sized || !@\libconcept{sized_sentinel_for}@) - class subrange; // freestanding + class subrange; template - constexpr bool @\libspec{enable_borrowed_range}{subrange}@> = true; // freestanding + constexpr bool @\libspec{enable_borrowed_range}{subrange}@> = true; template requires ((N == 0 && @\libconcept{copyable}@) || N == 1) - constexpr auto get(const subrange& r); // freestanding + constexpr auto get(const subrange& r); template requires (N < 2) - constexpr auto get(subrange&& r); // freestanding + constexpr auto get(subrange&& r); } namespace std { - using ranges::get; // freestanding + using ranges::get; } namespace std::ranges { // \ref{range.dangling}, dangling iterator handling - struct dangling; // freestanding + struct dangling; // \ref{range.elementsof}, class template \tcode{elements_of} template<@\libconcept{range}@ R, class Allocator = allocator> - struct elements_of; + struct elements_of; // hosted template<@\libconcept{range}@ R> - using borrowed_iterator_t = @\seebelow@; // freestanding + using borrowed_iterator_t = @\seebelow@; template<@\libconcept{range}@ R> - using borrowed_subrange_t = @\seebelow@; // freestanding + using borrowed_subrange_t = @\seebelow@; // \ref{range.utility.conv}, range conversions template requires (!@\libconcept{view}@) - constexpr C to(R&& r, Args&&... args); // freestanding + constexpr C to(R&& r, Args&&... args); template class C, @\libconcept{input_range}@ R, class... Args> - constexpr auto to(R&& r, Args&&... args); // freestanding + constexpr auto to(R&& r, Args&&... args); template requires (!@\libconcept{view}@) - constexpr auto to(Args&&... args); // freestanding + constexpr auto to(Args&&... args); template class C, class... Args> - constexpr auto to(Args&&... args); // freestanding + constexpr auto to(Args&&... args); // \ref{range.empty}, empty view template requires is_object_v - class empty_view; // freestanding + class empty_view; template - constexpr bool @\libspec{enable_borrowed_range}{empty_view}@> = true; // freestanding + constexpr bool @\libspec{enable_borrowed_range}{empty_view}@> = true; namespace views { template - constexpr empty_view @\libmember{empty}{views}@{}; // freestanding + constexpr empty_view @\libmember{empty}{views}@{}; } // \ref{range.single}, single view template<@\libconcept{move_constructible}@ T> requires is_object_v - class single_view; // freestanding + class single_view; - namespace views { inline constexpr @\unspecnc@ single = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ single = @\unspecnc@; } template using @\exposidnc{maybe-const}@ = conditional_t; // \expos @@ -205,140 +206,142 @@ // \ref{range.iota}, iota view template<@\libconcept{weakly_incrementable}@ W, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t> requires @\exposconcept{weakly-equality-comparable-with}@ && @\libconcept{copyable}@ - class iota_view; // freestanding + class iota_view; template - constexpr bool @\libspec{enable_borrowed_range}{iota_view}@> = true; // freestanding + constexpr bool @\libspec{enable_borrowed_range}{iota_view}@> = true; - namespace views { inline constexpr @\unspecnc@ iota = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ iota = @\unspecnc@; } // \ref{range.repeat}, repeat view template<@\libconcept{move_constructible}@ T, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t> requires @\seebelow@ - class repeat_view; // freestanding + class repeat_view; - namespace views { inline constexpr @\unspecnc@ repeat = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ repeat = @\unspecnc@; } // \ref{range.istream}, istream view template<@\libconcept{movable}@ Val, class CharT, class Traits = char_traits> requires @\seebelow@ - class basic_istream_view; + class basic_istream_view; // hosted template - using istream_view = basic_istream_view; + using istream_view = basic_istream_view; // hosted template - using wistream_view = basic_istream_view; + using wistream_view = basic_istream_view; // hosted - namespace views { template constexpr @\unspecnc@ istream = @\unspecnc@; } + namespace views { + template constexpr @\unspecnc@ istream = @\unspecnc@; // hosted + } // \ref{range.adaptor.object}, range adaptor objects template requires is_class_v && @\libconcept{same_as}@> - class range_adaptor_closure { }; // freestanding + class range_adaptor_closure { }; // \ref{range.all}, all view namespace views { - inline constexpr @\unspecnc@ all = @\unspecnc@; // freestanding + inline constexpr @\unspecnc@ all = @\unspecnc@; template<@\libconcept{viewable_range}@ R> - using all_t = decltype(all(declval())); // freestanding + using all_t = decltype(all(declval())); } // \ref{range.ref.view}, ref view template<@\libconcept{range}@ R> requires is_object_v - class ref_view; // freestanding + class ref_view; template - constexpr bool @\libspec{enable_borrowed_range}{ref_view}@> = true; // freestanding + constexpr bool @\libspec{enable_borrowed_range}{ref_view}@> = true; // \ref{range.owning.view}, owning view template<@\libconcept{range}@ R> requires @\seebelow@ - class owning_view; // freestanding + class owning_view; template - constexpr bool @\libspec{enable_borrowed_range}{owning_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{owning_view}@> = enable_borrowed_range; // \ref{range.as.rvalue}, as rvalue view template<@\libconcept{view}@ V> requires @\libconcept{input_range}@ - class as_rvalue_view; // freestanding + class as_rvalue_view; template - constexpr bool @\libspec{enable_borrowed_range}{as_rvalue_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{as_rvalue_view}@> = enable_borrowed_range; - namespace views { inline constexpr @\unspecnc@ as_rvalue = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ as_rvalue = @\unspecnc@; } // \ref{range.filter}, filter view template<@\libconcept{input_range}@ V, @\libconcept{indirect_unary_predicate}@> Pred> requires @\libconcept{view}@ && is_object_v - class filter_view; // freestanding + class filter_view; - namespace views { inline constexpr @\unspecnc@ filter = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ filter = @\unspecnc@; } // \ref{range.transform}, transform view template<@\libconcept{input_range}@ V, @\libconcept{move_constructible}@ F> requires @\libconcept{view}@ && is_object_v && @\libconcept{regular_invocable}@> && @\exposconcept{can-reference}@>> - class transform_view; // freestanding + class transform_view; - namespace views { inline constexpr @\unspecnc@ transform = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ transform = @\unspecnc@; } // \ref{range.take}, take view - template<@\libconcept{view}@> class take_view; // freestanding + template<@\libconcept{view}@> class take_view; template - constexpr bool @\libspec{enable_borrowed_range}{take_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{take_view}@> = enable_borrowed_range; - namespace views { inline constexpr @\unspecnc@ take = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ take = @\unspecnc@; } // \ref{range.take.while}, take while view template<@\libconcept{view}@ V, class Pred> requires @\libconcept{input_range}@ && is_object_v && @\libconcept{indirect_unary_predicate}@> - class take_while_view; // freestanding + class take_while_view; - namespace views { inline constexpr @\unspecnc@ take_while = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ take_while = @\unspecnc@; } // \ref{range.drop}, drop view template<@\libconcept{view}@ V> - class drop_view; // freestanding + class drop_view; template - constexpr bool @\libspec{enable_borrowed_range}{drop_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{drop_view}@> = enable_borrowed_range; - namespace views { inline constexpr @\unspecnc@ drop = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ drop = @\unspecnc@; } // \ref{range.drop.while}, drop while view template<@\libconcept{view}@ V, class Pred> requires @\libconcept{input_range}@ && is_object_v && @\libconcept{indirect_unary_predicate}@> - class drop_while_view; // freestanding + class drop_while_view; template - constexpr bool @\libspec{enable_borrowed_range}{drop_while_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{drop_while_view}@> = enable_borrowed_range; - namespace views { inline constexpr @\unspecnc@ drop_while = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ drop_while = @\unspecnc@; } // \ref{range.join}, join view template<@\libconcept{input_range}@ V> requires @\libconcept{view}@ && @\libconcept{input_range}@> - class join_view; // freestanding + class join_view; - namespace views { inline constexpr @\unspecnc@ join = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ join = @\unspecnc@; } // \ref{range.join.with}, join with view template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern> requires @\seebelow@ - class join_with_view; // freestanding + class join_with_view; - namespace views { inline constexpr @\unspecnc@ join_with = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ join_with = @\unspecnc@; } // \ref{range.lazy.split}, lazy split view template @@ -348,50 +351,50 @@ requires @\libconcept{view}@ && @\libconcept{view}@ && @\libconcept{indirectly_comparable}@, iterator_t, ranges::equal_to> && (@\libconcept{forward_range}@ || @\exposconcept{tiny-range}@) - class lazy_split_view; // freestanding + class lazy_split_view; // \ref{range.split}, split view template<@\libconcept{forward_range}@ V, @\libconcept{forward_range}@ Pattern> requires @\libconcept{view}@ && @\libconcept{view}@ && @\libconcept{indirectly_comparable}@, iterator_t, ranges::equal_to> - class split_view; // freestanding + class split_view; namespace views { - inline constexpr @\unspecnc@ lazy_split = @\unspecnc@; // freestanding - inline constexpr @\unspecnc@ split = @\unspecnc@; // freestanding + inline constexpr @\unspecnc@ lazy_split = @\unspecnc@; + inline constexpr @\unspecnc@ split = @\unspecnc@; } // \ref{range.concat}, concat view template<@\libconcept{input_range}@... Views> requires @\seebelow@ - class concat_view; // freestanding + class concat_view; - namespace views { inline constexpr @\unspecnc@ concat = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ concat = @\unspecnc@; } // \ref{range.counted}, counted view - namespace views { inline constexpr @\unspecnc@ counted = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ counted = @\unspecnc@; } // \ref{range.common}, common view template<@\libconcept{view}@ V> requires (!@\libconcept{common_range}@ && @\libconcept{copyable}@>) - class common_view; // freestanding + class common_view; template - constexpr bool @\libspec{enable_borrowed_range}{common_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{common_view}@> = enable_borrowed_range; - namespace views { inline constexpr @\unspecnc@ common = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ common = @\unspecnc@; } // \ref{range.reverse}, reverse view template<@\libconcept{view}@ V> requires @\libconcept{bidirectional_range}@ - class reverse_view; // freestanding + class reverse_view; template - constexpr bool @\libspec{enable_borrowed_range}{reverse_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{reverse_view}@> = enable_borrowed_range; - namespace views { inline constexpr @\unspecnc@ reverse = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ reverse = @\unspecnc@; } // \ref{range.as.const}, as const view template<@\libconcept{input_range}@ R> @@ -405,142 +408,142 @@ template<@\libconcept{view}@ V> requires @\libconcept{input_range}@ - class as_const_view; // freestanding + class as_const_view; template - constexpr bool @\libspec{enable_borrowed_range}{as_const_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{as_const_view}@> = enable_borrowed_range; - namespace views { inline constexpr @\unspecnc@ as_const = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ as_const = @\unspecnc@; } // \ref{range.elements}, elements view template<@\libconcept{input_range}@ V, size_t N> requires @\seebelow@ - class elements_view; // freestanding + class elements_view; template - constexpr bool @\libspec{enable_borrowed_range}{elements_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{elements_view}@> = enable_borrowed_range; template - using @\libglobal{keys_view}@ = elements_view; // freestanding + using @\libglobal{keys_view}@ = elements_view; template - using @\libglobal{values_view}@ = elements_view; // freestanding + using @\libglobal{values_view}@ = elements_view; namespace views { template - constexpr @\unspecnc@ elements = @\unspecnc@; // freestanding - inline constexpr auto @\libmember{keys}{views}@ = elements<0>; // freestanding - inline constexpr auto @\libmember{values}{views}@ = elements<1>; // freestanding + constexpr @\unspecnc@ elements = @\unspecnc@; + inline constexpr auto @\libmember{keys}{views}@ = elements<0>; + inline constexpr auto @\libmember{values}{views}@ = elements<1>; } // \ref{range.enumerate}, enumerate view template<@\libconcept{view}@ V> requires @\seebelow@ - class enumerate_view; // freestanding + class enumerate_view; template - constexpr bool @\libspec{enable_borrowed_range}{enumerate_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{enumerate_view}@> = enable_borrowed_range; - namespace views { inline constexpr @\unspecnc@ enumerate = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ enumerate = @\unspecnc@; } // \ref{range.zip}, zip view template<@\libconcept{input_range}@... Views> requires (@\libconcept{view}@ && ...) && (sizeof...(Views) > 0) - class zip_view; // freestanding + class zip_view; template - constexpr bool @\libspec{enable_borrowed_range}{zip_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{zip_view}@> = (enable_borrowed_range && ...); - namespace views { inline constexpr @\unspecnc@ zip = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ zip = @\unspecnc@; } // \ref{range.zip.transform}, zip transform view template<@\libconcept{move_constructible}@ F, @\libconcept{input_range}@... Views> requires (@\libconcept{view}@ && ...) && (sizeof...(Views) > 0) && is_object_v && @\libconcept{regular_invocable}@...> && @\exposconcept{can-reference}@...>> - class zip_transform_view; // freestanding + class zip_transform_view; - namespace views { inline constexpr @\unspecnc@ zip_transform = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ zip_transform = @\unspecnc@; } // \ref{range.adjacent}, adjacent view template<@\libconcept{forward_range}@ V, size_t N> requires @\libconcept{view}@ && (N > 0) - class adjacent_view; // freestanding + class adjacent_view; template - constexpr bool @\libspec{enable_borrowed_range}{adjacent_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{adjacent_view}@> = enable_borrowed_range; namespace views { template - constexpr @\unspecnc@ adjacent = @\unspecnc@; // freestanding - inline constexpr auto @\libmember{pairwise}{views}@ = adjacent<2>; // freestanding + constexpr @\unspecnc@ adjacent = @\unspecnc@; + inline constexpr auto @\libmember{pairwise}{views}@ = adjacent<2>; } // \ref{range.adjacent.transform}, adjacent transform view template<@\libconcept{forward_range}@ V, @\libconcept{move_constructible}@ F, size_t N> requires @\seebelow@ - class adjacent_transform_view; // freestanding + class adjacent_transform_view; namespace views { template - constexpr @\unspecnc@ adjacent_transform = @\unspecnc@; // freestanding - inline constexpr auto @\libmember{pairwise_transform}{views}@ = adjacent_transform<2>; // freestanding + constexpr @\unspecnc@ adjacent_transform = @\unspecnc@; + inline constexpr auto @\libmember{pairwise_transform}{views}@ = adjacent_transform<2>; } // \ref{range.chunk}, chunk view template<@\libconcept{view}@ V> requires @\libconcept{input_range}@ - class chunk_view; // freestanding + class chunk_view; template<@\libconcept{view}@ V> requires @\libconcept{forward_range}@ - class chunk_view; // freestanding + class chunk_view; template - constexpr bool @\libspec{enable_borrowed_range}{chunk_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{chunk_view}@> = @\libconcept{forward_range}@ && enable_borrowed_range; - namespace views { inline constexpr @\unspecnc@ chunk = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ chunk = @\unspecnc@; } // \ref{range.slide}, slide view template<@\libconcept{forward_range}@ V> requires @\libconcept{view}@ - class slide_view; // freestanding + class slide_view; template - constexpr bool @\libspec{enable_borrowed_range}{slide_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{slide_view}@> = enable_borrowed_range; - namespace views { inline constexpr @\unspecnc@ slide = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ slide = @\unspecnc@; } // \ref{range.chunk.by}, chunk by view template<@\libconcept{forward_range}@ V, @\libconcept{indirect_binary_predicate}@, iterator_t> Pred> requires @\libconcept{view}@ && is_object_v - class chunk_by_view; // freestanding + class chunk_by_view; - namespace views { inline constexpr @\unspecnc@ chunk_by = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ chunk_by = @\unspecnc@; } // \ref{range.stride}, stride view template<@\libconcept{input_range}@ V> requires @\libconcept{view}@ - class stride_view; // freestanding + class stride_view; template - constexpr bool @\libspec{enable_borrowed_range}{stride_view}@> = // freestanding + constexpr bool @\libspec{enable_borrowed_range}{stride_view}@> = enable_borrowed_range; - namespace views { inline constexpr @\unspecnc@ stride = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ stride = @\unspecnc@; } // \ref{range.cartesian}, cartesian product view template<@\libconcept{input_range}@ First, @\libconcept{forward_range}@... Vs> requires (@\libconcept{view}@ && ... && @\libconcept{view}@) - class cartesian_product_view; // freestanding + class cartesian_product_view; - namespace views { inline constexpr @\unspecnc@ cartesian_product = @\unspecnc@; } // freestanding + namespace views { inline constexpr @\unspecnc@ cartesian_product = @\unspecnc@; } // \ref{range.cache.latest}, cache latest view template<@\libconcept{input_range}@ V> @@ -551,33 +554,33 @@ } namespace std { - namespace views = ranges::views; // freestanding + namespace views = ranges::views; - template struct tuple_size; // freestanding - template struct tuple_element; // freestanding + template struct tuple_size; + template struct tuple_element; template - struct tuple_size> // freestanding + struct tuple_size> : integral_constant {}; template - struct tuple_element<0, ranges::subrange> { // freestanding + struct tuple_element<0, ranges::subrange> { using type = I; }; template - struct tuple_element<1, ranges::subrange> { // freestanding + struct tuple_element<1, ranges::subrange> { using type = S; }; template - struct tuple_element<0, const ranges::subrange> { // freestanding + struct tuple_element<0, const ranges::subrange> { using type = I; }; template - struct tuple_element<1, const ranges::subrange> { // freestanding + struct tuple_element<1, const ranges::subrange> { using type = S; }; - struct from_range_t { explicit from_range_t() = default; }; // freestanding - inline constexpr from_range_t from_range{}; // freestanding + struct from_range_t { explicit from_range_t() = default; }; + inline constexpr from_range_t from_range{}; } \end{codeblock} diff --git a/source/support.tex b/source/support.tex index 622b70c9f5..d1d6ebb6bd 100644 --- a/source/support.tex +++ b/source/support.tex @@ -748,7 +748,7 @@ // also in \libheader{algorithm}, \libheader{functional}, \libheader{iterator}, \libheader{memory}, \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_as_const}@ 202311L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_as_rvalue}@ 202207L // freestanding, also in \libheader{ranges} -#define @\defnlibxname{cpp_lib_ranges_cache_latest}@ 202411L // also in \libheader{ranges} +#define @\defnlibxname{cpp_lib_ranges_cache_latest}@ 202411L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_cartesian_product}@ 202207L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_chunk}@ 202202L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_chunk_by}@ 202202L // freestanding, also in \libheader{ranges} From c6fe6a847082038a5c875faa7f4451d2a6a13b8f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2025 20:47:51 -0800 Subject: [PATCH 8/9] LWG4191 P1467 changed the return type of pow(complex, int) --- source/numerics.tex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index f319cc1400..136f1d1b7b 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -1201,8 +1201,10 @@ Function template \tcode{pow} has additional constexpr overloads sufficient to ensure, for a call with one argument of type \tcode{complex} and the other argument of type \tcode{T2} or \tcode{complex}, -both arguments are effectively cast to \tcode{complex>}. -If \tcode{common_type_t} is not well-formed, +both arguments are effectively cast to \tcode{complex>}, +where \tcode{T3} is +\tcode{double} if \tcode{T2} is an integer type and \tcode{T2} otherwise. +If \tcode{common_type_t} is not well-formed, then the program is ill-formed. \rSec2[complex.literals]{Suffixes for complex number literals} From 3a472e9d70673e2654b7870771197c4a926cff01 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2025 20:49:58 -0800 Subject: [PATCH 9/9] LWG4196 Complexity of inplace_merge() is incorrect --- source/algorithms.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index be5be73333..2eeba1732e 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -8098,7 +8098,7 @@ \begin{itemize} \item For the overloads with no \tcode{ExecutionPolicy}, and - if enough additional memory is available, exactly $N - 1$ comparisons. + if enough additional memory is available, at most $N - 1$ comparisons. \item Otherwise, \bigoh{N \log N} comparisons. \end{itemize}