From 2a43f62ca850c9581219d109c58595175b921500 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 27 Nov 2024 22:08:10 -0800 Subject: [PATCH 01/35] LWG3436 std::construct_at should support arrays --- source/algorithms.tex | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index d723b7e11a..411ce607d5 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -11741,14 +11741,22 @@ \begin{itemdescr} \pnum \constraints -The expression \tcode{::new (declval()) T(declval()...)} +\tcode{is_unbounded_array_v} is \tcode{false}. +The expression \tcode{::new (declval()) T(\linebreak{}declval()...)} is well-formed when treated as an unevaluated operand\iref{term.unevaluated.operand}. +\pnum +\mandates +If \tcode{is_array_v} is \tcode{true}, \tcode{sizeof...(Args)} is zero. + \pnum \effects Equivalent to: \begin{codeblock} -return ::new (@\placeholdernc{voidify}@(*location)) T(std::forward(args)...); +if constexpr (is_array_v) + return ::new (@\placeholdernc{voidify}@(*location)) T[1](); +else + return ::new (@\placeholdernc{voidify}@(*location)) T(std::forward(args)...); \end{codeblock} \end{itemdescr} From 1ef0eb39daa730954d3d6f3af0670a667195fb09 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 27 Nov 2024 22:14:36 -0800 Subject: [PATCH 02/35] LWG3899 co_yielding elements of an lvalue generator is unnecessarily inefficient --- source/ranges.tex | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 18fd5561d3..d3e4f092a4 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -16995,6 +16995,9 @@ template requires @\libconcept{same_as}@::yielded, yielded> auto yield_value(ranges::elements_of&&, Unused> g) noexcept; + template + requires same_as::yielded, yielded> + auto yield_value(ranges::elements_of&, Unused> g) noexcept; template requires @\libconcept{convertible_to}@, yielded> @@ -17122,6 +17125,9 @@ template requires @\libconcept{same_as}@::yielded, yielded> auto yield_value(ranges::elements_of&&, Unused> g) noexcept; +template + requires same_as::yielded, yielded> + auto yield_value(ranges::elements_of&, Unused> g) noexcept; \end{itemdecl} \begin{itemdescr} @@ -17154,7 +17160,7 @@ \pnum \remarks -A \grammarterm{yield-expression} that calls this function +A \grammarterm{yield-expression} that calls one of these functions has type \tcode{void}\iref{expr.yield}. \end{itemdescr} From a5f24f31478923415f9aff450c0c46981d611dbe Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 27 Nov 2024 22:23:21 -0800 Subject: [PATCH 03/35] LWG3900 The allocator_arg_t overloads of generator::promise_type::operator new should not be constrained --- source/ranges.tex | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index d3e4f092a4..4c348e16c0 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -17012,13 +17012,11 @@ requires @\libconcept{same_as}@ || @\libconcept{default_initializable}@; template - requires @\libconcept{same_as}@ || @\libconcept{convertible_to}@ - void* operator new(size_t size, allocator_arg_t, const Alloc& alloc, const Args&...); + void* operator new(size_t size, allocator_arg_t, const Alloc& alloc, const Args&...); template - requires @\libconcept{same_as}@ || @\libconcept{convertible_to}@ - void* operator new(size_t size, const This&, allocator_arg_t, const Alloc& alloc, - const Args&...); + void* operator new(size_t size, const This&, allocator_arg_t, const Alloc& alloc, + const Args&...); void operator delete(void* pointer, size_t size) noexcept; @@ -17220,11 +17218,9 @@ requires @\libconcept{same_as}@ || @\libconcept{default_initializable}@; template - requires @\libconcept{same_as}@ || @\libconcept{convertible_to}@ void* operator new(size_t size, allocator_arg_t, const Alloc& alloc, const Args&...); template - requires @\libconcept{same_as}@ || @\libconcept{convertible_to}@ void* operator new(size_t size, const This&, allocator_arg_t, const Alloc& alloc, const Args&...); \end{itemdecl} @@ -17247,6 +17243,9 @@ \pnum \mandates \tcode{allocator_traits::pointer} is a pointer type. +For the overloads with a template parameter \tcode{Alloc}, +\tcode{\libconcept{same_as} || \libconcept{convertible_to}} +is modeled. \pnum \effects From 8dc94df4068aedc84cd58e8d7f55d026f569b680 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 27 Nov 2024 22:39:40 -0800 Subject: [PATCH 04/35] LWG3918 std::uninitialized_move/_n and guaranteed copy elision [specialized.algorithms.general] Changed to "function templates" as per #6265. --- source/algorithms.tex | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 411ce607d5..638edd6289 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -11167,13 +11167,20 @@ \pnum Some algorithms specified in \ref{specialized.algorithms} -make use of the exposition-only function template -\tcode{\placeholdernc{voidify}}: +make use of the following exposition-only function templates: \begin{codeblock} template constexpr void* @\placeholdernc{voidify}@(T& obj) noexcept { return addressof(obj); } + +template + decltype(auto) @\exposid{deref-move}@(I& it) { + if constexpr (is_lvalue_reference_v) + return std::move(*it); + else + return *it; + } \end{codeblock} \rSec2[special.mem.concepts]{Special memory concepts} @@ -11550,7 +11557,7 @@ \begin{codeblock} for (; first != last; (void)++result, ++first) ::new (@\placeholdernc{voidify}@(*result)) - typename iterator_traits::value_type(std::move(*first)); + typename iterator_traits::value_type(@\exposid{deref-move}@(first)); return result; \end{codeblock} \end{itemdescr} @@ -11610,7 +11617,7 @@ \begin{codeblock} for (; n > 0; ++result, (void) ++first, --n) ::new (@\placeholdernc{voidify}@(*result)) - typename iterator_traits::value_type(std::move(*first)); + typename iterator_traits::value_type(@\exposid{deref-move}@(first)); return {first, result}; \end{codeblock} \end{itemdescr} From 562a3be5705f57b43a5e294daa09fd4eeb12ff1a Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 27 Nov 2024 22:52:59 -0800 Subject: [PATCH 05/35] LWG4014 LWG 3809 changes behavior of some existing std::subtract_with_carry_engine code --- source/numerics.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/numerics.tex b/source/numerics.tex index b5c31916ab..999576d5d8 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -3034,7 +3034,8 @@ as if by the following definition: \begin{codeblock} linear_congruential_engine e(value == 0u ? default_seed : value); + 40014u,0u,2147483563u> e(value == 0u ? default_seed : + static_cast(value % 2147483563u)); \end{codeblock} Then, to set each $X_k$, obtain new values $z_0, \dotsc, z_{n-1}$ From 63bf48b6455a8f63f8e778f8865f8f494eee552c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 27 Nov 2024 22:58:46 -0800 Subject: [PATCH 06/35] LWG4024 Underspecified destruction of objects created in std::make_shared_for_overwrite/std::allocate_shared_for_overwrite --- source/memory.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/memory.tex b/source/memory.tex index 1260365953..15bf2c4dc2 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -4012,7 +4012,9 @@ of their original construction. \item When a (sub)object of non-array type \tcode{U} - that was initialized by \tcode{make_shared} is to be destroyed, + that was initialized by \tcode{make_shared}, + \tcode{make_shared_for_overwrite}, or \tcode{allocate_shared_for_overwrite} + is to be destroyed, it is destroyed via the expression \tcode{pv->\~{}U()} where \tcode{pv} points to that object of type \tcode{U}. \item From 0cc6ae5db7c441241e18e7d5fd9cba774096f544 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 27 Nov 2024 23:12:51 -0800 Subject: [PATCH 07/35] LWG4027 possibly-const-range should prefer returning const R& --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 4c348e16c0..b69a9710d7 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -396,7 +396,7 @@ // \ref{range.as.const}, as const view template<@\libconcept{input_range}@ R> constexpr auto& @\exposid{possibly-const-range}@(R& r) noexcept { // \expos - if constexpr (@\libconcept{constant_range}@ && !@\libconcept{constant_range}@) { + if constexpr (@\libconcept{input_range}@) { return const_cast(r); } else { return r; From 60e8aa7a86ff505c1d39102d1886b24d5368a866 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 27 Nov 2024 23:58:16 -0800 Subject: [PATCH 08/35] LWG4044 Confusing requirements for std::print on POSIX platforms [ostream.formatted.print] New paragraphs not numbered as indicated since they are part of the \effects clause. --- source/iostreams.tex | 43 ++++++++++++++++++++++++------------------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 9aaee4e353..1179c82171 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -6854,25 +6854,31 @@ without regard to the value of \tcode{os.exceptions()} and without turning on \tcode{ios_base::badbit} in the error state of \tcode{os}. \end{itemize} + +\par % This paragraph is part of the \effects clause. After constructing a \tcode{sentry} object, the function initializes a variable with automatic storage duration via \begin{codeblock} string out = vformat(os.getloc(), fmt, args); \end{codeblock} +\begin{itemize} +\item If the function is \tcode{vprint_unicode} and -\tcode{os} is a stream that refers to a terminal capable of displaying Unicode +\tcode{os} is a stream that refers to a terminal that +is only capable of displaying Unicode via a native Unicode API, which is determined in an implementation-defined manner, +flushes \tcode{os} and then writes \tcode{out} to the terminal using the native Unicode API; if \tcode{out} contains invalid code units, \indextext{undefined}% -the behavior is undefined and -implementations are encouraged to diagnose it. -If the native Unicode API is used, -the function flushes \tcode{os} before writing \tcode{out}. -Otherwise (if \tcode{os} is not such a stream or -the function is \tcode{vprint_nonunicode}), +the behavior is undefined. +\item +Otherwise inserts the character sequence \range{out.begin()}{out.end()} into \tcode{os}. +\end{itemize} + +\par % This paragraph is part of the \effects clause. If writing to the terminal or inserting into \tcode{os} fails, calls \tcode{os.setstate(ios_base::badbit)} (which may throw \tcode{ios_base::failure}). @@ -7837,28 +7843,27 @@ Let \tcode{out} denote the character representation of formatting arguments provided by \tcode{args} formatted according to specifications given in \tcode{fmt}. -If \tcode{stream} refers to a terminal capable of displaying Unicode, +\begin{itemize} +\item +If \tcode{stream} refers to a terminal that +is only capable of displaying Unicode via a native Unicode API, +flushes \tcode{stream} and then writes \tcode{out} to the terminal using the native Unicode API; if \tcode{out} contains invalid code units, \indextext{undefined}% -the behavior is undefined and -implementations are encouraged to diagnose it. +the behavior is undefined. +\item Otherwise writes \tcode{out} to \tcode{stream} unchanged. -If the native Unicode API is used, -the function flushes \tcode{stream} before writing \tcode{out}. +\end{itemize} Unconditionally unlocks \tcode{stream} on function exit. \xrefc{7.21.2}. \begin{note} -On POSIX and Windows, \tcode{stream} referring to a terminal means that, -respectively, -\tcode{isatty(fileno(\linebreak{}stream))} and +On Windows the native Unicode API is \tcode{WriteConsoleW} and +\tcode{stream} referring to a terminal means that \tcode{GetConsoleMode(_get_osfhandle(_fileno(stream)), ...)} -return nonzero. -\end{note} -\begin{note} -On Windows, the native Unicode API is \tcode{WriteConsoleW}. +returns nonzero. \end{note} \pnum From a77c52dcb98b8fdcc099804eeab801c91f74e1fa Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 00:03:00 -0800 Subject: [PATCH 09/35] LWG4064 Clarify that std::launder is not needed when using the result of std::memcpy --- source/strings.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/strings.tex b/source/strings.tex index 1e075915ae..3303503ccd 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -5514,9 +5514,11 @@ \indextext{signal-safe!\idxcode{memcpy}}% \indextext{signal-safe!\idxcode{memmove}}% The functions \tcode{memcpy} and \tcode{memmove} are signal-safe\iref{support.signal}. -Both functions implicitly create objects\iref{intro.object} +Each of these functions implicitly creates objects\iref{intro.object} in the destination region of storage immediately prior to copying the sequence of characters to the destination. +Each of these functions returns a pointer to a suitable created object, if any, +otherwise the value of the first parameter. \pnum \begin{note} From 4ed7697e924d4a2bd63b51c7505885424ca77565 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 00:14:42 -0800 Subject: [PATCH 10/35] LWG4072 std::optional comparisons: constrain harder --- source/utilities.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/utilities.tex b/source/utilities.tex index 889bba8d99..ff097f3011 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -4659,6 +4659,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{U} is not a specialization of optional. The expression \tcode{*x == v} is well-formed and its result is convertible to \tcode{bool}. \begin{note} @@ -4678,6 +4679,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{T} is not a specialization of optional. The expression \tcode{v == *x} is well-formed and its result is convertible to \tcode{bool}. @@ -4694,6 +4696,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{U} is not a specialization of optional. The expression \tcode{*x != v} is well-formed and its result is convertible to \tcode{bool}. @@ -4710,6 +4713,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{T} is not a specialization of optional. The expression \tcode{v != *x} is well-formed and its result is convertible to \tcode{bool}. @@ -4726,6 +4730,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{U} is not a specialization of optional. The expression \tcode{*x < v} is well-formed and its result is convertible to \tcode{bool}. @@ -4742,6 +4747,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{T} is not a specialization of optional. The expression \tcode{v < *x} is well-formed and its result is convertible to \tcode{bool}. @@ -4758,6 +4764,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{U} is not a specialization of optional. The expression \tcode{*x > v} is well-formed and its result is convertible to \tcode{bool}. @@ -4774,6 +4781,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{T} is not a specialization of optional. The expression \tcode{v > *x} is well-formed and its result is convertible to \tcode{bool}. @@ -4790,6 +4798,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{U} is not a specialization of optional. The expression \tcode{*x <= v} is well-formed and its result is convertible to \tcode{bool}. @@ -4806,6 +4815,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{T} is not a specialization of optional. The expression \tcode{v <= *x} is well-formed and its result is convertible to \tcode{bool}. @@ -4822,6 +4832,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{U} is not a specialization of optional. The expression \tcode{*x >= v} is well-formed and its result is convertible to \tcode{bool}. @@ -4838,6 +4849,7 @@ \begin{itemdescr} \pnum \constraints +\tcode{T} is not a specialization of optional. The expression \tcode{v >= *x} is well-formed and its result is convertible to \tcode{bool}. From 8aa46dca11eda7c8d0b7eec0c9a30e3a481cafbb Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 00:25:11 -0800 Subject: [PATCH 11/35] LWG4085 ranges::generate_random's helper lambda should specify the return type --- source/algorithms.tex | 6 ++++-- source/numerics.tex | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 638edd6289..8a90e3acfa 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -11934,7 +11934,8 @@ \begin{itemdecl} template requires @\libconcept{output_range}@> && @\libconcept{invocable}@ && - @\libconcept{uniform_random_bit_generator}@> + @\libconcept{uniform_random_bit_generator}@> && + is_arithmetic_v> constexpr borrowed_iterator_t ranges::generate_random(R&& r, G&& g, D&& d); \end{itemdecl} @@ -11983,7 +11984,8 @@ \begin{itemdecl} template> O, @\libconcept{sentinel_for}@ S> - requires @\libconcept{invocable}@ && @\libconcept{uniform_random_bit_generator}@> + requires @\libconcept{invocable}@ && @\libconcept{uniform_random_bit_generator}@> && + is_arithmetic_v> constexpr O ranges::generate_random(O first, S last, G&& g, D&& d); \end{itemdecl} diff --git a/source/numerics.tex b/source/numerics.tex index 999576d5d8..55375a6256 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -1451,11 +1451,13 @@ template requires @\libconcept{output_range}@> && @\libconcept{invocable}@ && - @\libconcept{uniform_random_bit_generator}@> + @\libconcept{uniform_random_bit_generator}@> && + is_arithmetic_v> constexpr borrowed_iterator_t generate_random(R&& r, G&& g, D&& d); template> O, @\libconcept{sentinel_for}@ S> - requires @\libconcept{invocable}@ && @\libconcept{uniform_random_bit_generator}@> + requires @\libconcept{invocable}@ && @\libconcept{uniform_random_bit_generator}@> && + is_arithmetic_v> constexpr O generate_random(O first, S last, G&& g, D&& d); } From 136065fee2474d69c0068727b54d1bf6c2cb76e9 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 00:27:37 -0800 Subject: [PATCH 12/35] LWG4112 has-arrow should required operator->() to be const-qualified --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index b69a9710d7..b89ffa6052 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1634,7 +1634,7 @@ template concept @\defexposconceptnc{has-arrow}@ = // \expos - @\libconcept{input_iterator}@ && (is_pointer_v || requires(I i) { i.operator->(); }); + @\libconcept{input_iterator}@ && (is_pointer_v || requires(const I i) { i.operator->(); }); template concept @\defexposconceptnc{different-from}@ = // \expos From 4dc10a57913f7f3722ce4fd6de2110531ce25510 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 01:02:05 -0800 Subject: [PATCH 13/35] LWG4134 Issue with Philox algorithm specification --- source/numerics.tex | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index 55375a6256..d712fd6e23 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -3134,15 +3134,13 @@ $f_n(j)$ is defined in \tref{rand.eng.philox.f}. \begin{floattable}{Values for the word permutation $\bm{f}_{\bm{n}}\bm{(j)}$}{rand.eng.philox.f} -{l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l|l} +{l|l|l|l|l|l} \topline - \multicolumn{2}{|c|}{$\bm{f}_{\bm{n}}\bm{(j)}$} & \multicolumn{16}{c|}{$\bm{j}$} \\ \cline{3-18} + \multicolumn{2}{|c|}{$\bm{f}_{\bm{n}}\bm{(j)}$} & \multicolumn{4}{c|}{$\bm{j}$} \\ \cline{3-6} \multicolumn{2}{|c|}{} - & 0 & 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 & 9 & 10 & 11 & 12 & 13 & 14 & 15 \\ \hline - $\bm{n} $ & 2 & 0 & 1 & \multicolumn{14}{c|}{} \\ \cline{2-18} - & 4 & 0 & 3 & 2 & 1 & \multicolumn{12}{c|}{} \\ \cline{2-18} - & 8 & 2 & 1 & 4 & 7 & 6 & 5 & 0 & 3 & \multicolumn{8}{c|}{} \\ \cline{2-18} - & 16 & 0 & 9 & 2 & 13 & 6 & 11 & 4 & 15 & 10 & 7 & 12 & 3 & 14 & 5 & 8 & 1 \\ \cline{2-18} + & 0 & 1 & 2 & 3 \\ \hline + $\bm{n} $ & 2 & 0 & 1 & \multicolumn{2}{c|}{} \\ \cline{2-6} + & 4 & 2 & 1 & 0 & 3 \\ \cline{2-6} \end{floattable} \begin{note} For $n = 2$ the sequence is not permuted. @@ -3151,8 +3149,8 @@ \item The following computations are applied to the elements of the $V$ sequence: \begin{codeblock} -@$X_{2k + 0} = \mullo(V_{2k + 1}, M_{k}, w)$@ -@$X_{2k + 1} = \mulhi(V_{2k + 1}, M_{k}, w) \xor \mathit{key}^q_k \xor V_{2k}$@ +@$X_{2k + 0} = \mulhi(V_{2k}, M_{k}, w) \xor \mathit{key}^q_k \xor V_{2k + 1}$@ +@$X_{2k + 1} = \mullo(V_{2k}, M_{k}, w)$@ \end{codeblock} where: \begin{itemize} @@ -3243,7 +3241,7 @@ \mandates \begin{itemize} \item \tcode{sizeof...(consts) == n} is \tcode{true}, and -\item \tcode{n == 2 || n == 4 || n == 8 || n == 16} is \tcode{true}, and +\item \tcode{n == 2 || n == 4} is \tcode{true}, and \item \tcode{0 < r} is \tcode{true}, and \item \tcode{0 < w \&\& w <= numeric_limits::digits} is \tcode{true}. \end{itemize} @@ -3911,7 +3909,7 @@ \begin{itemdecl} using philox4x32 = philox_engine; + 0xCD9E8D57, 0x9E3779B9, 0xD2511F53, 0xBB67AE85>; \end{itemdecl} \begin{itemdescr} @@ -3926,7 +3924,7 @@ \begin{itemdecl} using philox4x64 = philox_engine; + 0xCA5A826395121157, 0x9E3779B97F4A7C15, 0xD2E7470EE14C6C93, 0xBB67AE8584CAA73B>; \end{itemdecl} \begin{itemdescr} From 2137507d55fc1c31ba65167463700674500b2de6 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 01:06:43 -0800 Subject: [PATCH 14/35] LWG4154 The Mandates for std::packaged_task's constructor from a callable entity should consider decaying --- source/threads.tex | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index ba8ddf5ea8..6ee565c5a3 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -11861,16 +11861,13 @@ \pnum \mandates -\tcode{is_invocable_r_v} is \tcode{true}. - -\pnum -\expects -Invoking a copy of \tcode{f} behaves the same as invoking \tcode{f}. +\tcode{is_invocable_r_v\&, ArgTypes...>} is \tcode{true}. \pnum \effects -Constructs a new \tcode{packaged_task} object with a shared state and -initializes the object's stored task with \tcode{std::forward(f)}. +Constructs a new \tcode{packaged_task} object with +a stored task of type \tcode{decay_t} and a shared state. +Initializes the object's stored task with \tcode{std::forward(f)}. \pnum \throws From 71b9526424178698a1a6a56c877e62c01e1409b9 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 01:23:07 -0800 Subject: [PATCH 15/35] LWG4164 Missing guarantees for forward_list modifiers --- source/containers.tex | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 09d642b600..59afa4f125 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -7200,10 +7200,15 @@ \rSec3[forward.list.modifiers]{Modifiers} \pnum -None of the overloads of \tcode{insert_after} shall affect the validity of iterators and -references, and \tcode{erase_after} shall invalidate only iterators and references to -the erased elements. If an exception is thrown during \tcode{insert_after} there shall -be no effect. Inserting \tcode{n} elements into a \tcode{forward_list} is linear in +The member functions in this subclause +do not affect the validity of iterators and references +when inserting elements, and +when erasing elements +%FIXME: This sentence hard to parse. Rewrite, or add a comma here and emply bullets. +invalidate iterators and references to the erased elements only. +If an exception is thrown by any of these member functions +there is no effect on the container. +Inserting \tcode{n} elements into a \tcode{forward_list} is linear in \tcode{n}, and the number of calls to the copy or move constructor of \tcode{T} is exactly equal to \tcode{n}. Erasing \tcode{n} elements from a \tcode{forward_list} is linear in \tcode{n} and the number of calls to the destructor of type \tcode{T} is From de8097488fd3b03c00b0513709cb34db4f9b98ec Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 01:42:50 -0800 Subject: [PATCH 16/35] LWG3216 Rebinding the allocator before calling construct/destroy in allocate_shared --- source/memory.tex | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/source/memory.tex b/source/memory.tex index 15bf2c4dc2..578530d3c0 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -3970,15 +3970,15 @@ \tcode{allocate_shared} shall initialize this (sub)object via the expression \begin{itemize} - \item \tcode{allocator_traits::construct(a2, pv, v)} or - \item \tcode{allocator_traits::construct(a2, pv, l...)} + \item \tcode{allocator_traits::construct(a2, pu, v)} or + \item \tcode{allocator_traits::construct(a2, pu, l...)} \end{itemize} respectively, - where \tcode{pv} points to storage - suitable to hold an object of type \tcode{U} and - \tcode{a2} of type \tcode{A2} is a rebound copy of - the allocator \tcode{a} passed to \tcode{allocate_shared} - such that its \tcode{value_type} is \tcode{remove_cv_t}. + where \tcode{pu} is a pointer of type \tcode{remove_cv_t*} + pointing to storage + suitable to hold an object of type \tcode{remove_cv_t} and + \tcode{a2} of type \tcode{A2} is a potentially rebound copy of + the allocator \tcode{a} passed to \tcode{allocate_shared}. \item When a (sub)object of non-array type \tcode{U} is specified to have a default initial value, @@ -3989,13 +3989,13 @@ \item When a (sub)object of non-array type \tcode{U} is specified to have a default initial value, - \tcode{allocate_shared} shall initialize this (sub)object - via the expression \tcode{allocator_traits::construct(a2, pv)}, - where \tcode{pv} points to storage - suitable to hold an object of type \tcode{U} and - \tcode{a2} of type \tcode{A2} is a rebound copy of - the allocator \tcode{a} passed to \tcode{allocate_shared} - such that its \tcode{value_type} is \tcode{remove_cv_t}. + \tcode{allocate_shared} initializes this (sub)object + via the expression \tcode{allocator_traits::construct(a2, pu)}, + where \tcode{pu} is a pointer of type \tcode{remove_cv_t*} + pointing to storage + suitable to hold an object of type \tcode{remove_cv_t} and + \tcode{a2} of type \tcode{A2} is a potentially rebound copy of + the allocator \tcode{a} passed to \tcode{allocate_shared}. \item When a (sub)object of non-array type \tcode{U} is initialized by \tcode{make_shared_for_overwrite} or\linebreak % avoid Overfull @@ -4015,17 +4015,17 @@ that was initialized by \tcode{make_shared}, \tcode{make_shared_for_overwrite}, or \tcode{allocate_shared_for_overwrite} is to be destroyed, - it is destroyed via the expression \tcode{pv->\~{}U()} where - \tcode{pv} points to that object of type \tcode{U}. + it is destroyed via the expression \tcode{pu->\~{}U()} where + \tcode{pu} points to that object of type \tcode{U}. \item When a (sub)object of non-array type \tcode{U} that was initialized by \tcode{allocate_shared} is to be destroyed, it is destroyed via the expression - \tcode{allocator_traits::destroy(a2, pv)} where - \tcode{pv} points to that object of type \tcode{remove_cv_t} and - \tcode{a2} of type \tcode{A2} is a rebound copy of - the allocator \tcode{a} passed to \tcode{allocate_shared} - such that its \tcode{value_type} is \tcode{remove_cv_t}. + \tcode{allocator_traits::destroy(a2, pu)} where + \tcode{pu} is a pointer of type \tcode{remove_cv_t*} + pointing to that object of type \tcode{remove_cv_t} and + \tcode{a2} of type \tcode{A2} is a potentially rebound copy of + the allocator \tcode{a} passed to \tcode{allocate_shared}. \end{itemize} \begin{note} These functions will typically allocate more memory than \tcode{sizeof(T)} to From 3edfff72c8c2928c423efcfe3e63096fbb0a2188 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 02:12:38 -0800 Subject: [PATCH 17/35] LWG3886 Monad mo' problems [optional.assign] Removed "" from declaration to match that in synopsis. --- source/utilities.tex | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index ff097f3011..6d7a94e15b 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -3269,7 +3269,7 @@ constexpr explicit optional(in_place_t, Args&&...); template constexpr explicit optional(in_place_t, initializer_list, Args&&...); - template + template> constexpr explicit(@\seebelow@) optional(U&&); template constexpr explicit(@\seebelow@) optional(const optional&); @@ -3283,7 +3283,7 @@ constexpr optional& operator=(nullopt_t) noexcept; constexpr optional& operator=(const optional&); constexpr optional& operator=(optional&&) noexcept(@\seebelow@); - template constexpr optional& operator=(U&&); + template> constexpr optional& operator=(U&&); template constexpr optional& operator=(const optional&); template constexpr optional& operator=(optional&&); template constexpr T& emplace(Args&&...); @@ -3311,8 +3311,8 @@ constexpr T& value() &; // freestanding-deleted constexpr T&& value() &&; // freestanding-deleted constexpr const T&& value() const &&; // freestanding-deleted - template constexpr T value_or(U&&) const &; - template constexpr T value_or(U&&) &&; + template> constexpr T value_or(U&&) const &; + template> constexpr T value_or(U&&) &&; // \ref{optional.monadic}, monadic operations template constexpr auto and_then(F&& f) &; @@ -3504,7 +3504,7 @@ \indexlibraryctor{optional}% \begin{itemdecl} -template constexpr explicit(@\seebelow@) optional(U&& v); +template> constexpr explicit(@\seebelow@) optional(U&& v); \end{itemdecl} \begin{itemdescr} @@ -3756,7 +3756,7 @@ \indexlibrarymember{operator=}{optional}% \begin{itemdecl} -template constexpr optional& operator=(U&& v); +template> constexpr optional& operator=(U&& v); \end{itemdecl} \begin{itemdescr} @@ -4193,7 +4193,7 @@ \indexlibrarymember{value_or}{optional}% \begin{itemdecl} -template constexpr T value_or(U&& v) const &; +template> constexpr T value_or(U&& v) const &; \end{itemdecl} \begin{itemdescr} @@ -4211,7 +4211,7 @@ \indexlibrarymember{value_or}{optional}% \begin{itemdecl} -template constexpr T value_or(U&& v) &&; +template> constexpr T value_or(U&& v) &&; \end{itemdecl} \begin{itemdescr} @@ -7440,7 +7440,7 @@ template constexpr explicit(@\seebelow@) expected(expected&&); - template + template> constexpr explicit(@\seebelow@) expected(U&& v); template @@ -7463,7 +7463,7 @@ // \ref{expected.object.assign}, assignment constexpr expected& operator=(const expected&); constexpr expected& operator=(expected&&) noexcept(@\seebelow@); - template constexpr expected& operator=(U&&); + template> constexpr expected& operator=(U&&); template constexpr expected& operator=(const unexpected&); template @@ -7495,8 +7495,8 @@ constexpr E& error() & noexcept; constexpr const E&& error() const && noexcept; constexpr E&& error() && noexcept; - template constexpr T value_or(U&&) const &; - template constexpr T value_or(U&&) &&; + template> constexpr T value_or(U&&) const &; + template> constexpr T value_or(U&&) &&; template constexpr E error_or(G&&) const &; template constexpr E error_or(G&&) &&; @@ -7747,7 +7747,7 @@ \indexlibraryctor{expected}% \begin{itemdecl} -template +template> constexpr explicit(!is_convertible_v) expected(U&& v); \end{itemdecl} @@ -8066,7 +8066,7 @@ \indexlibrarymember{operator=}{expected}% \begin{itemdecl} -template +template> constexpr expected& operator=(U&& v); \end{itemdecl} @@ -8434,7 +8434,7 @@ \indexlibrarymember{value_or}{expected}% \begin{itemdecl} -template constexpr T value_or(U&& v) const &; +template> constexpr T value_or(U&& v) const &; \end{itemdecl} \begin{itemdescr} @@ -8450,7 +8450,7 @@ \indexlibrarymember{value_or}{expected}% \begin{itemdecl} -template constexpr T value_or(U&& v) &&; +template> constexpr T value_or(U&& v) &&; \end{itemdecl} \begin{itemdescr} From 30068ea020acf09634d6cac46fb3ca9d87efeb64 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 02:16:54 -0800 Subject: [PATCH 18/35] LWG4084 std::fixed ignores std::uppercase --- source/text.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/text.tex b/source/text.tex index 7ff99a463e..4b54cd2e54 100644 --- a/source/text.tex +++ b/source/text.tex @@ -2965,7 +2965,8 @@ {lc} \topline \lhdr{State} & \rhdr{\tcode{stdio} equivalent} \\ \capsep -\tcode{floatfield == ios_base::fixed} & \tcode{\%f} \\ \rowsep +\tcode{floatfield == ios_base::fixed \&\& !uppercase} & \tcode{\%f} \\ \rowsep +\tcode{floatfield == ios_base::fixed} & \tcode{\%F} \\ \rowsep \tcode{floatfield == ios_base::scientific \&\& !uppercase} & \tcode{\%e} \\ \rowsep \tcode{floatfield == ios_base::scientific} & \tcode{\%E} \\ \rowsep \tcode{floatfield == (ios_base::fixed | ios_base::scientific) \&\& !uppercase} & \tcode{\%a} \\ \rowsep From 0ec58e82146004f54912394fde62e863fb8f6b60 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 02:18:26 -0800 Subject: [PATCH 19/35] LWG4088 println ignores the locale imbued in std::ostream --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 1179c82171..a5c35c27ee 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -6816,7 +6816,7 @@ \effects Equivalent to: \begin{codeblock} -print(os, "{}\n", format(fmt, std::forward(args)...)); +print(os, "{}\n", format(os.getloc(), fmt, std::forward(args)...)); \end{codeblock} \end{itemdescr} From d44cfffcdea8aae2ee4eb968ffc54a432335f7c2 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 02:25:30 -0800 Subject: [PATCH 20/35] LWG4113 Disallow has_unique_object_representations --- source/meta.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/meta.tex b/source/meta.tex index ec59b440b8..fc10432934 100644 --- a/source/meta.tex +++ b/source/meta.tex @@ -1227,8 +1227,8 @@ For an array type \tcode{T}, the same result as \tcode{has_unique_object_representations_v>}, otherwise \seebelow. & - \tcode{T} shall be a complete type, \cv{}~\keyword{void}, or - an array of unknown bound. \\ \rowsep + \tcode{remove_all_extents_t} shall be a complete type or + \cv{}~\keyword{void}. \\ \rowsep \indexlibraryglobal{reference_constructs_from_temporary}% \tcode{template}\br From 21f988b7bec830d92410f19cfda5ab0ae47a4b5d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 02:28:12 -0800 Subject: [PATCH 21/35] LWG4119 generator::promise_type::yield_value(ranges::elements_of)'s nested generator may be ill-formed --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index b89ffa6052..b4d64f2eee 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -17175,7 +17175,7 @@ Equivalent to: \begin{codeblock} auto nested = [](allocator_arg_t, Alloc, ranges::iterator_t i, ranges::sentinel_t s) - -> generator, Alloc> { + -> generator { for (; i != s; ++i) { co_yield static_cast(*i); } From c1445bc4dafd8c3613ecc4598b9b02740d30ad20 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 02:35:53 -0800 Subject: [PATCH 22/35] LWG4124 Cannot format zoned_time with resolution coarser than seconds --- source/time.tex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/time.tex b/source/time.tex index dfa1601013..f74e3a87fd 100644 --- a/source/time.tex +++ b/source/time.tex @@ -10994,6 +10994,9 @@ \pnum \remarks +If the \fmtgrammarterm{chrono-specs} is omitted, +the result is equivalent to using \tcode{\%F \%T \%Z} as +the \fmtgrammarterm{chrono-specs}. If \tcode{\%Z} is used, it is replaced with \tcode{*f.abbrev} if \tcode{f.abbrev} is not a null pointer value. @@ -11012,7 +11015,7 @@ \begin{codeblock} template struct formatter, charT> - : formatter, charT> { + : formatter>, charT> { template typename FormatContext::iterator format(const chrono::zoned_time& tp, FormatContext& ctx) const; @@ -11032,7 +11035,7 @@ Equivalent to: \begin{codeblock} sys_info info = tp.get_info(); -return formatter, charT>:: +return formatter>, charT>:: format({tp.get_local_time(), &info.abbrev, &info.offset}, ctx); \end{codeblock} \end{itemdescr} From 3ed48ae0486f06f5b8a069b7b24e41bba24dbf17 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 02:42:26 -0800 Subject: [PATCH 23/35] LWG4126 Some feature-test macros for fully freestanding features are not yet marked freestanding --- source/support.tex | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/support.tex b/source/support.tex index 28c15ac913..9a82308b25 100644 --- a/source/support.tex +++ b/source/support.tex @@ -596,14 +596,14 @@ #define @\defnlibxname{cpp_lib_chrono}@ 202306L // also in \libheader{chrono} #define @\defnlibxname{cpp_lib_chrono_udls}@ 201304L // also in \libheader{chrono} #define @\defnlibxname{cpp_lib_clamp}@ 201603L // also in \libheader{algorithm} -#define @\defnlibxname{cpp_lib_common_reference}@ 202302L // also in \libheader{type_traits} -#define @\defnlibxname{cpp_lib_common_reference_wrapper}@ 202302L // also in \libheader{functional} +#define @\defnlibxname{cpp_lib_common_reference}@ 202302L // freestanding, also in \libheader{type_traits} +#define @\defnlibxname{cpp_lib_common_reference_wrapper}@ 202302L // freestanding, also in \libheader{functional} #define @\defnlibxname{cpp_lib_complex_udls}@ 201309L // also in \libheader{complex} #define @\defnlibxname{cpp_lib_concepts}@ 202207L // freestanding, also in \libheader{concepts}, \libheader{compare} #define @\defnlibxname{cpp_lib_constexpr_algorithms}@ 202306L // also in \libheader{algorithm}, \libheader{utility} #define @\defnlibxname{cpp_lib_constexpr_bitset}@ 202207L // also in \libheader{bitset} -#define @\defnlibxname{cpp_lib_constexpr_charconv}@ 202207L // also in \libheader{charconv} +#define @\defnlibxname{cpp_lib_constexpr_charconv}@ 202207L // freestanding, also in \libheader{charconv} #define @\defnlibxname{cpp_lib_constexpr_cmath}@ 202306L // also in \libheader{cmath}, \libheader{cstdlib} #define @\defnlibxname{cpp_lib_constexpr_complex}@ 202306L // also in \libheader{complex} #define @\defnlibxname{cpp_lib_constexpr_dynamic_alloc}@ 201907L // also in \libheader{memory} @@ -624,7 +624,7 @@ // also in \libheader{vector}, \libheader{list}, \libheader{forward_list}, \libheader{map}, \libheader{set}, \libheader{unordered_map}, \libheader{unordered_set}, // \libheader{deque}, \libheader{queue}, \libheader{stack}, \libheader{string} #define @\defnlibxname{cpp_lib_copyable_function}@ 202306L // also in \libheader{functional} -#define @\defnlibxname{cpp_lib_coroutine}@ 201902L // also in \libheader{coroutine} +#define @\defnlibxname{cpp_lib_coroutine}@ 201902L // freestanding, also in \libheader{coroutine} #define @\defnlibxname{cpp_lib_debugging}@ 202403L // freestanding, also in \libheader{debugging} #define @\defnlibxname{cpp_lib_destroying_delete}@ 201806L // freestanding, also in \libheader{new} #define @\defnlibxname{cpp_lib_enable_shared_from_this}@ 201603L // also in \libheader{memory} @@ -693,7 +693,7 @@ #define @\defnlibxname{cpp_lib_is_aggregate}@ 201703L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_constant_evaluated}@ 201811L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_final}@ 201402L // freestanding, also in \libheader{type_traits} -#define @\defnlibxname{cpp_lib_is_implicit_lifetime}@ 202302L // also in \libheader{type_traits} +#define @\defnlibxname{cpp_lib_is_implicit_lifetime}@ 202302L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_invocable}@ 201703L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_layout_compatible}@ 201907L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_nothrow_convertible}@ 201806L // freestanding, also in \libheader{type_traits} @@ -701,8 +701,8 @@ #define @\defnlibxname{cpp_lib_is_pointer_interconvertible}@ 201907L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_scoped_enum}@ 202011L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_swappable}@ 201603L // freestanding, also in \libheader{type_traits} -#define @\defnlibxname{cpp_lib_is_virtual_base_of}@ 202406L // also in \libheader{type_traits} -#define @\defnlibxname{cpp_lib_is_within_lifetime}@ 202306L // also in \libheader{type_traits} +#define @\defnlibxname{cpp_lib_is_virtual_base_of}@ 202406L // freestanding, also in \libheader{type_traits} +#define @\defnlibxname{cpp_lib_is_within_lifetime}@ 202306L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_jthread}@ 201911L // also in \libheader{stop_token}, \libheader{thread} #define @\defnlibxname{cpp_lib_latch}@ 201907L // also in \libheader{latch} #define @\defnlibxname{cpp_lib_launder}@ 201606L // freestanding, also in \libheader{new} @@ -715,7 +715,7 @@ #define @\defnlibxname{cpp_lib_map_try_emplace}@ 201411L // also in \libheader{map} #define @\defnlibxname{cpp_lib_math_constants}@ 201907L // also in \libheader{numbers} #define @\defnlibxname{cpp_lib_math_special_functions}@ 201603L // also in \libheader{cmath} -#define @\defnlibxname{cpp_lib_mdspan}@ 202406L // also in \libheader{mdspan} +#define @\defnlibxname{cpp_lib_mdspan}@ 202406L // freestanding, also in \libheader{mdspan} #define @\defnlibxname{cpp_lib_memory_resource}@ 201603L // also in \libheader{memory_resource} #define @\defnlibxname{cpp_lib_modules}@ 202207L // freestanding #define @\defnlibxname{cpp_lib_move_iterator_concept}@ 202207L // freestanding, also in \libheader{iterator} @@ -757,7 +757,7 @@ #define @\defnlibxname{cpp_lib_ranges_to_container}@ 202202L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_zip}@ 202110L // freestanding, also in \libheader{ranges}, \libheader{tuple}, \libheader{utility} -#define @\defnlibxname{cpp_lib_ratio}@ 202306L // also in \libheader{ratio} +#define @\defnlibxname{cpp_lib_ratio}@ 202306L // freestanding, also in \libheader{ratio} #define @\defnlibxname{cpp_lib_raw_memory_algorithms}@ 201606L // also in \libheader{memory} #define @\defnlibxname{cpp_lib_rcu}@ 202306L // also in \libheader{rcu} #define @\defnlibxname{cpp_lib_reference_from_temporary}@ 202202L // freestanding, also in \libheader{type_traits} @@ -780,7 +780,7 @@ #define @\defnlibxname{cpp_lib_smart_ptr_owner_equality}@ 202306L // also in \libheader{memory} #define @\defnlibxname{cpp_lib_source_location}@ 201907L // freestanding, also in \libheader{source_location} #define @\defnlibxname{cpp_lib_span}@ 202311L // freestanding, also in \libheader{span} -#define @\defnlibxname{cpp_lib_span_initializer_list}@ 202311L // also in \libheader{span} +#define @\defnlibxname{cpp_lib_span_initializer_list}@ 202311L // freestanding, also in \libheader{span} #define @\defnlibxname{cpp_lib_spanstream}@ 202106L // also in \libheader{spanstream} #define @\defnlibxname{cpp_lib_ssize}@ 201902L // freestanding, also in \libheader{iterator} #define @\defnlibxname{cpp_lib_sstream_from_string_view}@ 202306L // also in \libheader{sstream} @@ -792,12 +792,12 @@ #define @\defnlibxname{cpp_lib_string_resize_and_overwrite}@ 202110L // also in \libheader{string} #define @\defnlibxname{cpp_lib_string_udls}@ 201304L // also in \libheader{string} #define @\defnlibxname{cpp_lib_string_view}@ 202403L // also in \libheader{string}, \libheader{string_view} -#define @\defnlibxname{cpp_lib_submdspan}@ 202403L // also in \libheader{mdspan} +#define @\defnlibxname{cpp_lib_submdspan}@ 202403L // freestanding, also in \libheader{mdspan} #define @\defnlibxname{cpp_lib_syncbuf}@ 201803L // also in \libheader{syncstream} #define @\defnlibxname{cpp_lib_text_encoding}@ 202306L // also in \libheader{text_encoding} #define @\defnlibxname{cpp_lib_three_way_comparison}@ 201907L // freestanding, also in \libheader{compare} #define @\defnlibxname{cpp_lib_to_address}@ 201711L // freestanding, also in \libheader{memory} -#define @\defnlibxname{cpp_lib_to_array}@ 201907L // also in \libheader{array} +#define @\defnlibxname{cpp_lib_to_array}@ 201907L // freestanding, also in \libheader{array} #define @\defnlibxname{cpp_lib_to_chars}@ 202306L // also in \libheader{charconv} #define @\defnlibxname{cpp_lib_to_string}@ 202306L // also in \libheader{string} #define @\defnlibxname{cpp_lib_to_underlying}@ 202102L // freestanding, also in \libheader{utility} From ba5e36f544965b33dba08abad44fd95bfe0e71c6 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 02:45:42 -0800 Subject: [PATCH 24/35] LWG4135 The helper lambda of std::erase for list 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 59afa4f125..5f824da77d 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -7785,7 +7785,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return erase_if(c, [\&](auto\& elem) \{ return elem == value; \});} +Equivalent to: \tcode{return erase_if(c, [\&](const auto\& elem) -> bool \{ return elem == value; \});} \end{itemdescr} \indexlibrarymember{erase_if}{forward_list}% @@ -8570,7 +8570,7 @@ \begin{itemdescr} \pnum \effects -Equivalent to: \tcode{return erase_if(c, [\&](auto\& elem) \{ return elem == value; \});} +Equivalent to: \tcode{return erase_if(c, [\&](const auto\& elem) -> bool \{ return elem == value; \});} \end{itemdescr} \indexlibrarymember{erase_if}{list}% From 0116785b157673eb5f9ea27df119ed9355b8b8db Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 02:49:46 -0800 Subject: [PATCH 25/35] LWG4140 Useless default constructors for bit reference types [template.bitset.general] [vector.bool.pspc] bitset already removed. --- source/containers.tex | 2 -- source/utilities.tex | 2 -- 2 files changed, 4 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 5f824da77d..0a7667695a 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -9261,8 +9261,6 @@ // bit reference class @\libmember{reference}{vector}@ { - constexpr reference() noexcept; - public: constexpr reference(const reference&) = default; constexpr ~reference(); diff --git a/source/utilities.tex b/source/utilities.tex index 6d7a94e15b..1264a49db8 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -9808,8 +9808,6 @@ public: // bit reference class reference { - constexpr reference() noexcept; - public: constexpr reference(const reference&) = default; constexpr ~reference(); From 5437db05c72ef69f9da3533d1c64803e017a0163 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 03:01:03 -0800 Subject: [PATCH 26/35] LWG4141 Improve prohibitions on "additional storage" --- source/utilities.tex | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 1264a49db8..530a2cf957 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -3342,8 +3342,7 @@ Any instance of \tcode{optional} at any given time either contains a value or does not contain a value. When an instance of \tcode{optional} \defnx{contains a value}{contains a value!\idxcode{optional}}, it means that an object of type \tcode{T}, referred to as the optional object's \defnx{contained value}{contained value!\idxcode{optional}}, -is allocated within the storage of the optional object. -Implementations are not permitted to use additional storage, such as dynamic memory, to allocate its contained value. +is nested within\iref{intro.object} the optional object. When an object of type \tcode{optional} is contextually converted to \tcode{bool}, the conversion returns \tcode{true} if the object contains a value; otherwise the conversion returns \tcode{false}. @@ -5144,10 +5143,9 @@ of one of its alternative types or holds no value. When an instance of \tcode{variant} holds a value of alternative type \tcode{T}, it means that a value of type \tcode{T}, referred to as the \tcode{variant} -object's \defnx{contained value}{contained value!\idxcode{variant}}, is allocated within the storage of the +object's \defnx{contained value}{contained value!\idxcode{variant}}, +is nested within\iref{intro.object} the \tcode{variant} object. -Implementations are not permitted to use additional storage, such as dynamic -memory, to allocate the contained value. \pnum All types in \tcode{Types} shall meet @@ -7539,10 +7537,8 @@ \pnum Any object of type \tcode{expected} either contains a value of type \tcode{T} or -a value of type \tcode{E} within its own storage. -Implementations are not permitted to use additional storage, -such as dynamic memory, -to allocate the object of type \tcode{T} or the object of type \tcode{E}. +a value of type \tcode{E} +nested within\iref{intro.object} it. Member \exposid{has_val} indicates whether the \tcode{expected} object contains an object of type \tcode{T}. @@ -8925,9 +8921,8 @@ \pnum Any object of type \tcode{expected} either represents a value of type \tcode{T}, or -contains a value of type \tcode{E} within its own storage. -Implementations are not permitted to use additional storage, -such as dynamic memory, to allocate the object of type \tcode{E}. +contains a value of type \tcode{E} +nested within\iref{intro.object} it. Member \exposid{has_val} indicates whether the \tcode{expected} object represents a value of type \tcode{T}. From 49fc5238b39c87155f19649b5462fcabac31d909 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 03:05:01 -0800 Subject: [PATCH 27/35] LWG4142 format_parse_context::check_dynamic_spec should require at least one type --- source/text.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/text.tex b/source/text.tex index 4b54cd2e54..8d13e2e6e4 100644 --- a/source/text.tex +++ b/source/text.tex @@ -7627,6 +7627,7 @@ \begin{itemdescr} \pnum \mandates +$\tcode{sizeof...(Ts)} \ge 1$. The types in \tcode{Ts...} are unique. Each type in \tcode{Ts...} is one of \keyword{bool}, From 8c53febd423a59e779556224c21c2378d5597814 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 03:09:45 -0800 Subject: [PATCH 28/35] LWG4144 Disallow unique_ptr --- source/memory.tex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/memory.tex b/source/memory.tex index 578530d3c0..9b3944853e 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -2084,6 +2084,14 @@ } \end{codeblock} +\pnum +A program that instantiates the definition of \tcode{unique_ptr} +is ill-formed if \tcode{T*} is an invalid type. +\begin{note} +This prevents the intantiation of specializations such as +\tcode{unique_ptr} and \tcode{unique_ptr}. +\end{note} + \pnum The default type for the template parameter \tcode{D} is \tcode{default_delete}. A client-supplied template argument From 0f752fb7d290bc04ea9619aa5103ed58e539e99c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 03:11:55 -0800 Subject: [PATCH 29/35] LWG4147 Precondition on inplace_vector::emplace --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 0a7667695a..9d14767e63 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -1463,7 +1463,7 @@ \pnum \expects \tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}. -For \tcode{vector} and \tcode{deque}, +For \tcode{vector}, \tcode{inplace_vector}, and \tcode{deque}, \tcode{T} is also \oldconcept{MoveInsertable} into \tcode{X} and \oldconcept{MoveAssignable}. From 72ba8da06a89b221713f3c35abf7956c51c3ab7d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 03:16:07 -0800 Subject: [PATCH 30/35] LWG4148 unique_ptr::operator* should not allow dangling references --- source/memory.tex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/memory.tex b/source/memory.tex index 9b3944853e..5c3fbbb90a 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -2442,9 +2442,13 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\mandates +\tcode{reference_converts_from_temporary_v, decltype(\linebreak{}*declval())>} is \tcode{false}. + \pnum \expects -\tcode{get() != nullptr}. +\tcode{get() != nullptr} is \tcode{true}. \pnum \returns From d6a709604464a6d1ad10963dc9a287461cb48f33 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 03:19:31 -0800 Subject: [PATCH 31/35] LWG4153 Fix extra "-1" for philox_engine::max() --- source/numerics.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index d712fd6e23..c9d1e327e4 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -3080,8 +3080,8 @@ \pnum A \tcode{philox_engine} random number engine produces -unsigned integer random numbers in the closed interval \crange{0}{$m$}, -where $m = 2^w - 1$ and +unsigned integer random numbers in the interval \range{0}{$m$}, +where $m = 2^w$ and the template parameter $w$ defines the range of the produced numbers. The state of a \tcode{philox_engine} object consists of a sequence $X$ of $n$ unsigned integer values of width $w$, From aa454e00b3c94d15f02de0475203ded3ee27e836 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 03:29:14 -0800 Subject: [PATCH 32/35] LWG4157 The resolution of LWG3465 was damaged by P2167R3 --- source/support.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/support.tex b/source/support.tex index 9a82308b25..b31d501daa 100644 --- a/source/support.tex +++ b/source/support.tex @@ -5295,7 +5295,8 @@ Otherwise, if the expressions \tcode{E == F}, \tcode{E < F}, and \tcode{F < E} are all well-formed and - each of \tcode{decltype(E == F)} and \tcode{decltype(E < F)} models + each of \tcode{decltype(E == F)}, \tcode{decltype(E < F)}, and + \tcode{decltype(F < E)} models \exposconcept{boolean-testable}, \begin{codeblock} E == F ? partial_ordering::equivalent : From c70aad0ff5fd6e1906a0bd7d409d7bf3e0f37128 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 03:30:59 -0800 Subject: [PATCH 33/35] LWG4169 std::atomic's default constructor should be constrained --- source/threads.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/threads.tex b/source/threads.tex index 6ee565c5a3..7dfd5eafce 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -4087,7 +4087,7 @@ \begin{itemdescr} \pnum -\mandates +\constraints \tcode{is_default_constructible_v} is \tcode{true}. \pnum From b3e60b83688139c51d71563551406ec7c2e291a6 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 28 Nov 2024 03:33:35 -0800 Subject: [PATCH 34/35] LWG4170 contiguous_iterator should require to_address(I{}) --- source/iterators.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/iterators.tex b/source/iterators.tex index 5d46f37e64..d73bc32859 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1969,6 +1969,7 @@ \item \tcode{to_address(a) == addressof(*a)}, \item \tcode{to_address(b) == to_address(a) + D(b - a)}, \item \tcode{to_address(c) == to_address(a) + D(c - a)}, +\item \tcode{address(I\{\})} is well-defined, \item \tcode{ranges::iter_move(a)} has the same type, value category, and effects as \tcode{std::move(*a)}, and \item if \tcode{ranges::iter_swap(a, b)} is well-formed, From 7820989e02ff441eb1c63ed18ce598bb671f3a5f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 12 Dec 2024 17:13:40 -0800 Subject: [PATCH 35/35] [ostream.formatted.print] Remove "only" in wording for LWG4044 as per LWG discussion --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index a5c35c27ee..2e14d9e476 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -6865,7 +6865,7 @@ \item If the function is \tcode{vprint_unicode} and \tcode{os} is a stream that refers to a terminal that -is only capable of displaying Unicode via a native Unicode API, +is capable of displaying Unicode only via a native Unicode API, which is determined in an implementation-defined manner, flushes \tcode{os} and then writes \tcode{out} to the terminal using the native Unicode API;