From 486ed417106a493a518268b4955d42a8b7c80186 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 18:36:13 -0800 Subject: [PATCH 01/22] LWG2392 "character type" is used but not defined --- source/future.tex | 6 ++++-- source/iostreams.tex | 9 +++++---- source/locales.tex | 4 ++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/source/future.tex b/source/future.tex index 40d4e2a814..60133e942f 100644 --- a/source/future.tex +++ b/source/future.tex @@ -2124,10 +2124,12 @@ \tcode{codecvt_utf16}, and \tcode{codecvt_utf8_utf16}: \begin{itemize} \item - \tcode{Elem} is the wide-character type, such as + \tcode{Elem} is one of \keyword{wchar_t}, \keyword{char16_t}, or \keyword{char32_t}. \item - \tcode{Maxcode} is the largest wide-character code that the facet + \tcode{Maxcode} is the largest value of \tcode{Elem} + converted to \tcode{\keyword{unsigned} \keyword{long}} + that the facet will read or write without reporting a conversion error. \item If \tcode{(Mode \& consume_header)}, the facet shall consume an diff --git a/source/iostreams.tex b/source/iostreams.tex index 155919c60f..7bedc3d0b2 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -128,8 +128,9 @@ \pnum In the classes of \ref{input.output}, a template parameter with name \tcode{charT} represents a member of the set of types containing \tcode{char}, \keyword{wchar_t}, -and any other \impldef{set of character types that iostreams templates can be instantiated for} -character types that meet the requirements for a character on which any of +and any other \impldef{set of character container types that iostreams templates can be instantiated for} +character container types\iref{defns.character.container} +that meet the requirements for a character on which any of the iostream components can be instantiated. \rSec2[iostreams.threadsafety]{Thread safety} @@ -6361,7 +6362,7 @@ If a formatted output function of a stream \tcode{os} determines padding, it does so as follows. Given a \tcode{charT} character sequence \tcode{seq} where -\tcode{charT} is the character type of the stream, if +\tcode{charT} is the character container type of the stream, if the length of \tcode{seq} is less than \tcode{os.width()}, then enough copies of \tcode{os.fill()} are added to this sequence as necessary to pad to a width of \tcode{os.width()} characters. If @@ -6705,7 +6706,7 @@ of \tcode{out}. Constructs a character sequence \tcode{seq}. If \tcode{c} has type \tcode{char} -and the character type of the stream is not +and the character container type of the stream is not \tcode{char}, then \tcode{seq} consists of \tcode{out.widen(c)}; diff --git a/source/locales.tex b/source/locales.tex index e36f215d68..962d0acb01 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -394,9 +394,9 @@ respectively\iref{iterator.requirements}. A template parameter with name \tcode{C} represents the set of types containing \keyword{char}, \keyword{wchar_t}, and any other -\impldef{set of character types +\impldef{set of character container types that iostreams templates can be instantiated for} -character types +character container types\iref{defns.character.container} that meet the requirements for a character on which any of the iostream components can be instantiated. A template parameter with name \tcode{International} From c9856cc87e2fe54c41c0d783f4356ea782ac6c2b Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 18:46:44 -0800 Subject: [PATCH 02/22] LWG3203 span element access invalidation --- source/containers.tex | 6 ++++++ source/strings.tex | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 69494898fa..240077b26b 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -18355,6 +18355,12 @@ \tcode{ElementType} is required to be a complete object type that is not an abstract class type. +\pnum +For a \tcode{span} \tcode{s}, +any operation that invalidates a pointer in +the range \range{s.data()}{s.data() + s.size()} +invalidates pointers, iterators, and references to elements of \tcode{s}. + \rSec4[span.cons]{Constructors, copy, and assignment} \indexlibraryctor{span}% diff --git a/source/strings.tex b/source/strings.tex index c0213a348a..ef157c9cd4 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -751,10 +751,10 @@ any operation that invalidates a pointer in the range \begin{codeblock} -@\range{str.data()}{\brk{}str.data() + str.size()}@ +@\range{str.data()}{str.data() + str.size()}@ \end{codeblock} invalidates pointers, iterators, and references -returned from \tcode{str}'s member functions. +to elements of \tcode{str}. \pnum The complexity of \tcode{basic_string_view} member functions is \bigoh{1} From b1039469860217a31c3dad4fe9bae632cf1d9c0d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 18:52:13 -0800 Subject: [PATCH 03/22] LWG3305 any_cast --- source/utilities.tex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index fd9453e2e3..f45b273a3a 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -6906,9 +6906,13 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\mandates +\tcode{is_void_v} is \tcode{false}. + \pnum \returns -If \tcode{operand != nullptr \&\& operand->type() == typeid(T)}, +If \tcode{operand != nullptr \&\& operand->type() == typeid(T)} is \tcode{true}, a pointer to the object contained by \tcode{operand}; otherwise, \keyword{nullptr}. From 2b36a7e449c25a976583dcfa92106700d43dcd53 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 18:55:19 -0800 Subject: [PATCH 04/22] LWG3431 <=> for containers should require three_way_comparable instead of <=> --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 240077b26b..8ccc34a45c 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -887,7 +887,7 @@ \pnum \expects -Either \tcode{<=>} is defined for values of type (possibly const) \tcode{T}, +Either \tcode{T} models \libconcept{three_way_comparable}, or \tcode{<} is defined for values of type (possibly const) \tcode{T} and \tcode{<} is a total ordering relationship. From 4ed5a13363e901ba683b7d2ab24b245f5d259487 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 19:18:56 -0800 Subject: [PATCH 05/22] LWG3749 common_iterator should handle integer-class difference types --- source/iterators.tex | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index b765432c95..4a84528e3c 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -5477,7 +5477,7 @@ template<@\libconcept{input_iterator}@ I, class S> struct iterator_traits> { using iterator_concept = @\seebelow@; - using iterator_category = @\seebelow@; + using iterator_category = @\seebelow@; // not always present using value_type = iter_value_t; using difference_type = iter_difference_t; using pointer = @\seebelow@; @@ -5489,22 +5489,25 @@ \rSec3[common.iter.types]{Associated types} \pnum -The nested \grammarterm{typedef-name}s of the specialization of -\tcode{iterator_traits} for \tcode{common_iterator} are defined as follows. +The nested \grammarterm{typedef-name} \tcode{iterator_category} of +the specialization of \tcode{iterator_traits} for \tcode{common_iterator} +is defined if and only if \tcode{iter_difference_t} is an integral type. +In that case, +\tcode{iterator_category} denotes \tcode{forward_iterator_tag} if +the \grammarterm{qualified-id} \tcode{iterator_traits::iterator_category} +is valid and denotes a type that +models \tcode{\libconcept{derived_from}}; +otherwise it denotes \tcode{input_iterator_tag}. + +\pnum +The remaining nested \grammarterm{typedef-name}s of the specialization of +\tcode{iterator_traits} for \tcode{common_iterator} are defined as follows: \begin{itemize} \item \tcode{iterator_concept} denotes \tcode{forward_iterator_tag} if \tcode{I} models \libconcept{forward_iterator}; otherwise it denotes \tcode{input_iterator_tag}. -\item -\tcode{iterator_category} denotes -\tcode{forward_iterator_tag} -if the \grammarterm{qualified-id} \tcode{iterator_traits::iter\-ator_category} -is valid and denotes a type that -models \tcode{\libconcept{derived_from}}; -otherwise it denotes \tcode{input_iterator_tag}. - \item Let \tcode{a} denote an lvalue of type \tcode{const common_iterator}. If the expression \tcode{a.operator->()} is well-formed, From bc8610094ba8923c117e3e39924b8ce668df7827 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 20:00:10 -0800 Subject: [PATCH 06/22] LWG3892 Incorrect formatting of nested ranges and tuples --- source/utilities.tex | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index f45b273a3a..cf6d2515b7 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -15735,7 +15735,7 @@ \begin{ncbnf} \fmtnontermdef{format-spec}\br - \textnormal{as specified by the \tcode{formatter} specialization for the argument type} + \textnormal{as specified by the \tcode{formatter} specialization for the argument type; cannot start with \terminal{\}} } \end{ncbnf} \pnum @@ -16784,7 +16784,7 @@ \fmtgrammarterm{format-spec}\iref{format.string} of the replacement field being formatted in the format string. -If \fmtgrammarterm{format-spec} is empty then either +If \fmtgrammarterm{format-spec} is not present or empty then either \tcode{pc.begin() == pc.end()} or \tcode{*pc.begin() == '\}'}. @@ -17758,8 +17758,11 @@ \begin{itemdescr} \pnum \effects -Parses the format specifier as a \fmtgrammarterm{range-format-spec} and +Parses the format specifiers as a \fmtgrammarterm{range-format-spec} and stores the parsed specifiers in \tcode{*this}. +Calls \tcode{\exposid{underlying_}.parse(ctx)} to parse +\fmtgrammarterm{format-spec} in \fmtgrammarterm{range-format-spec} or, +if the latter is not present, an empty \fmtgrammarterm{format-spec}. The values of \exposid{opening-bracket_}, \exposid{closing-bracket_}, and \exposid{separator_} are modified if and only if required by @@ -18602,7 +18605,7 @@ \begin{itemdescr} \pnum \effects -Parses the format specifier as a \fmtgrammarterm{tuple-format-spec} and +Parses the format specifiers as a \fmtgrammarterm{tuple-format-spec} and stores the parsed specifiers in \tcode{*this}. The values of \exposid{opening-bracket_}, @@ -18611,6 +18614,8 @@ are modified if and only if required by the \fmtgrammarterm{tuple-type}, if present. For each element \tcode{\placeholder{e}} in \exposid{underlying_}, +calls \tcode{\placeholder{e}.parse(ctx)} to parse +an empty \fmtgrammarterm{format-spec} and, if \tcode{\placeholder{e}.set_debug_format()} is a valid expression, calls \tcode{\placeholder{e}.set_debug_format()}. From 765a69297f6e1da0b0d31057cd8cbaa0539f3e92 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 20:04:30 -0800 Subject: [PATCH 07/22] LWG3897 inout_ptr will not update raw pointer to 0 --- source/memory.tex | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/memory.tex b/source/memory.tex index d3bc9c6071..8cb79385db 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -5451,10 +5451,8 @@ % pretend to \item that there is real text here, but undo the vertical spacing \mbox{}\vspace{-\baselineskip}\vspace{-\parskip} \begin{codeblock} -if (p) { - apply([&](auto&&... args) { - s = Smart( static_cast(p), std::forward(args)...); }, std::move(a)); -} +apply([&](auto&&... args) { + s = Smart(static_cast(p), std::forward(args)...); }, std::move(a)); \end{codeblock} if \tcode{is_pointer_v} is \tcode{true}; \item From 16c66ad6033178a51fd65fb7f48d5ab67d61d689 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 20:08:50 -0800 Subject: [PATCH 08/22] LWG3946 The definition of const_iterator_t should be reworked --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index e7f3c4946a..7c7a993ae3 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -65,9 +65,9 @@ template<@\libconcept{range}@ R> using sentinel_t = decltype(ranges::end(declval())); // freestanding template<@\libconcept{range}@ R> - using const_iterator_t = const_iterator>; // freestanding + using const_iterator_t = decltype(ranges::cbegin(declval())); // freestanding template<@\libconcept{range}@ R> - using const_sentinel_t = const_sentinel>; // freestanding + using const_sentinel_t = decltype(ranges::cend(declval())); // freestanding template<@\libconcept{range}@ R> using range_difference_t = iter_difference_t>; // freestanding template<@\libconcept{sized_range}@ R> From 3cee8a70deff9281fb5418a6fc002a29e6fb03b7 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 20:14:24 -0800 Subject: [PATCH 09/22] LWG3809 Is std::subtract_with_carry_engine supposed to work? --- source/numerics.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index 14308f349e..a8293f2c3a 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -2885,13 +2885,13 @@ static constexpr size_t long_lag = r; static constexpr result_type min() { return 0; } static constexpr result_type max() { return @$m - 1$@; } - static constexpr result_type default_seed = 19780503u; + static constexpr uint_least32_t default_seed = 19780503u; // constructors and seeding functions - subtract_with_carry_engine() : subtract_with_carry_engine(default_seed) {} + subtract_with_carry_engine() : subtract_with_carry_engine(0u) {} explicit subtract_with_carry_engine(result_type value); template explicit subtract_with_carry_engine(Sseq& q); - void seed(result_type value = default_seed); + void seed(result_type value = 0u); template void seed(Sseq& q); // equality operators @@ -2946,7 +2946,7 @@ first construct \tcode{e}, a \tcode{linear_congruential_engine} object, as if by the following definition: \begin{codeblock} -linear_congruential_engine e(value == 0u ? default_seed : value); \end{codeblock} Then, to set each $X_k$, From a4a9db9e66c21ef5c53521ad5995bc35dfa728be Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 20:17:17 -0800 Subject: [PATCH 10/22] LWG3947 Unexpected constraints on adjacent_transform_view::base() --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 7c7a993ae3..41c13b3edb 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -11884,7 +11884,7 @@ adjacent_transform_view() = default; constexpr explicit adjacent_transform_view(V base, F fun); - constexpr V base() const & requires @\libconcept{copy_constructible}@<@\exposid{InnerView}@> { return @\exposid{inner_}@.base(); } + constexpr V base() const & requires @\libconcept{copy_constructible}@ { return @\exposid{inner_}@.base(); } constexpr V base() && { return std::move(@\exposid{inner_}@).base(); } constexpr auto begin() { From a457442f5b6873013a8358e9ca86515fc06dcb7e Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 20:24:52 -0800 Subject: [PATCH 11/22] LWG3948 possibly-const-range and as-const-pointer should be noexcept --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 41c13b3edb..cb24ecea86 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -393,7 +393,7 @@ // \ref{range.as.const}, as const view template<@\libconcept{input_range}@ R> - constexpr auto& @\exposid{possibly-const-range}@(R& r) { // \expos + constexpr auto& @\exposid{possibly-const-range}@(R& r) noexcept { // \expos if constexpr (@\libconcept{constant_range}@ && !@\libconcept{constant_range}@) { return const_cast(r); } else { @@ -1184,7 +1184,7 @@ \begin{codeblock} template -constexpr auto @\exposid{as-const-pointer}@(const T* p) { return p; } // \expos +constexpr auto @\exposid{as-const-pointer}@(const T* p) noexcept { return p; } // \expos \end{codeblock} \pnum From 997bbeb5160182d2125d2b1485199a8cb1342671 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 20:26:42 -0800 Subject: [PATCH 12/22] LWG3949 std::atomic's trivial destructor dropped in C++17 spec wording --- source/threads.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/threads.tex b/source/threads.tex index ab471217c1..c906079668 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -3712,6 +3712,7 @@ \pnum The specialization \tcode{atomic} is a standard-layout struct. +It has a trivial destructor. \pnum \begin{note} From e879f0224a71b50e81eeb193c4efef0077c205a3 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 20:31:21 -0800 Subject: [PATCH 13/22] =?UTF-8?q?LWG3951=20=C2=A7[expected.object.swap]:?= =?UTF-8?q?=20Using=20value()=20instead=20of=20has=5Fvalue()?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/utilities.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index cf6d2515b7..95ece2a9f1 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -8101,7 +8101,7 @@ equivalent to: \tcode{using std::swap; swap(\exposid{unex}, rhs.\exposid{unex});} \\ \end{floattable} -For the case where \tcode{rhs.value()} is \tcode{false} and +For the case where \tcode{rhs.has_value()} is \tcode{false} and \tcode{this->has_value()} is \tcode{true}, equivalent to: \begin{codeblock} if constexpr (is_nothrow_move_constructible_v) { @@ -9184,7 +9184,7 @@ equivalent to: \tcode{using std::swap; swap(\exposid{unex}, rhs.\exposid{unex});} \\ \end{floattable} -For the case where \tcode{rhs.value()} is \tcode{false} and +For the case where \tcode{rhs.has_value()} is \tcode{false} and \tcode{this->has_value()} is \tcode{true}, equivalent to: \begin{codeblock} construct_at(addressof(@\exposid{unex}@), std::move(rhs.@\exposid{unex}@)); From 4c05272482e92c0ac7aaa225578abbd27a1b442a Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 20:38:27 -0800 Subject: [PATCH 14/22] LWG3953 iter_move for common_iterator and counted_iterator should return decltype(auto) --- source/iterators.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index 4a84528e3c..4711fcd11d 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -5458,7 +5458,7 @@ friend constexpr iter_difference_t operator-( const common_iterator& x, const common_iterator& y); - friend constexpr iter_rvalue_reference_t iter_move(const common_iterator& i) + friend constexpr decltype(auto) iter_move(const common_iterator& i) noexcept(noexcept(ranges::iter_move(declval()))) requires @\libconcept{input_iterator}@; template<@\libconcept{indirectly_swappable}@ I2, class S2> @@ -5800,7 +5800,7 @@ \indexlibrarymember{iter_move}{common_iterator}% \begin{itemdecl} -friend constexpr iter_rvalue_reference_t iter_move(const common_iterator& i) +friend constexpr decltype(auto) iter_move(const common_iterator& i) noexcept(noexcept(ranges::iter_move(declval()))) requires @\libconcept{input_iterator}@; \end{itemdecl} @@ -5959,7 +5959,7 @@ friend constexpr strong_ordering operator<=>( const counted_iterator& x, const counted_iterator& y); - friend constexpr iter_rvalue_reference_t iter_move(const counted_iterator& i) + friend constexpr decltype(auto) iter_move(const counted_iterator& i) noexcept(noexcept(ranges::iter_move(i.current))) requires @\libconcept{input_iterator}@; template<@\libconcept{indirectly_swappable}@ I2> @@ -6387,7 +6387,7 @@ \indexlibrarymember{iter_move}{counted_iterator}% \begin{itemdecl} -friend constexpr iter_rvalue_reference_t +friend constexpr decltype(auto) iter_move(const counted_iterator& i) noexcept(noexcept(ranges::iter_move(i.current))) requires @\libconcept{input_iterator}@; From f83e1378a98e3a13b303746eb8916ce65bf7b30e Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 20:44:37 -0800 Subject: [PATCH 15/22] =?UTF-8?q?LWG3957=20=C2=A7[container.alloc.reqmts]?= =?UTF-8?q?=20The=20value=20category=20of=20v=20should=20be=20claimed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/containers.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 8ccc34a45c..42c18ece80 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -919,7 +919,9 @@ and an \tcode{allocator_type} identical to \tcode{allocator_traits::rebind_alloc} and given an lvalue \tcode{m} of type \tcode{A}, a pointer \tcode{p} of type \tcode{T*}, -an expression \tcode{v} of type \tcode{T} or \tcode{const T}, +an expression \tcode{v} that denotes +an lvalue of type \tcode{T} or \tcode{const T} or +an rvalue of type \tcode{const T}, and an rvalue \tcode{rv} of type \tcode{T}, the following terms are defined. If \tcode{X} is not allocator-aware or is a specialization of \tcode{basic_string}, From 884f9d64442c143d31f19ff4f656798ea791b1f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 17 Dec 2023 02:49:16 +0000 Subject: [PATCH 16/22] LWG3965 Incorrect example in [format.string.escaped] p3 for formatting of combining characters --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index 95ece2a9f1..a30be40be6 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -17155,7 +17155,7 @@ string s4 = format("[{:?}]", string("\0 \n \t \x02 \x1b", 9)); // \tcode{s4} has value: \tcode{["\textbackslash u\{0\} \textbackslash n \textbackslash t \textbackslash u\{2\} \textbackslash u\{1b\}"]} string s5 = format("[{:?}]", "\xc3\x28"); // invalid UTF-8, \tcode{s5} has value: \tcode{["\textbackslash x\{c3\}("]} -string s6 = format("[{:?}]", "@\importexample{example_02}@"); @\kern0.75pt@// \tcode{s6} has value: \tcode{["\importexample{example_03}\textbackslash{u}\{200d\}\importexample{example_04}\textbackslash{u}\{fe0f\}"]} +string s6 = format("[{:?}]", "@\importexample{example_02}@"); @\kern0.75pt@// \tcode{s6} has value: \tcode{["\importexample{example_03}\textbackslash{u}\{200d\}\importexample{example_04}"]} string s7 = format("[{:?}]", "\u0301"); // \tcode{s7} has value: \tcode{["\textbackslash u\{301\}"]} string s8 = format("[{:?}]", "\\\u0301"); // \tcode{s8} has value: \tcode{["\textbackslash \textbackslash \textbackslash u\{301\}"]} string s9 = format("[{:?}]", "e\u0301\u0323"); // \tcode{s9} has value: \tcode{["\importexample[-2pt]{example_06}"]} From 4335e09f8100abe549174f4c8f69f40425af157d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 20:55:40 -0800 Subject: [PATCH 17/22] =?UTF-8?q?LWG3970=20=C2=A7[mdspan.syn]=20Missing=20?= =?UTF-8?q?definition=20of=20full=5Fextent=5Ft=20and=20full=5Fextent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/containers.tex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/containers.tex b/source/containers.tex index 42c18ece80..72d297b4c6 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -19026,6 +19026,9 @@ template struct submdspan_mapping_result; + struct full_extent_t { explicit full_extent_t() = default; }; + inline constexpr full_extent_t full_extent{}; + template constexpr auto submdspan_extents(const extents&, SliceSpecifiers...); From 199ed1891d13ea9418a3d352c8b7c678cd879533 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 21:42:31 -0800 Subject: [PATCH 18/22] LWG3973 Monadic operations should be ADL-proof --- source/utilities.tex | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index a30be40be6..4d448702fd 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -4153,7 +4153,7 @@ \begin{itemdescr} \pnum -Let \tcode{U} be \tcode{invoke_result_t}. +Let \tcode{U} be \tcode{invoke_result_t}. \pnum \mandates @@ -4164,7 +4164,7 @@ Equivalent to: \begin{codeblock} if (*this) { - return invoke(std::forward(f), value()); + return invoke(std::forward(f), *val); } else { return remove_cvref_t(); } @@ -4179,7 +4179,7 @@ \begin{itemdescr} \pnum -Let \tcode{U} be \tcode{invoke_result_t}. +Let \tcode{U} be \tcode{invoke_result_t}. \pnum \mandates @@ -4190,7 +4190,7 @@ Equivalent to: \begin{codeblock} if (*this) { - return invoke(std::forward(f), std::move(value())); + return invoke(std::forward(f), std::move(*val)); } else { return remove_cvref_t(); } @@ -4205,7 +4205,7 @@ \begin{itemdescr} \pnum -Let \tcode{U} be \tcode{remove_cv_t>}. +Let \tcode{U} be \tcode{remove_cv_t>}. \pnum \mandates @@ -4213,7 +4213,7 @@ other than \tcode{in_place_t} or \tcode{nullopt_t}. The declaration \begin{codeblock} -U u(invoke(std::forward(f), value())); +U u(invoke(std::forward(f), *val)); \end{codeblock} is well-formed for some invented variable \tcode{u}. \begin{note} @@ -4224,7 +4224,7 @@ \returns If \tcode{*this} contains a value, an \tcode{optional} object whose contained value is direct-non-list-initialized with -\tcode{invoke(std::forward(f), value())}; +\tcode{invoke(std::forward(f), *val)}; otherwise, \tcode{optional()}. \end{itemdescr} @@ -4237,7 +4237,7 @@ \begin{itemdescr} \pnum Let \tcode{U} be -\tcode{remove_cv_t>}. +\tcode{remove_cv_t>}. \pnum \mandates @@ -4245,7 +4245,7 @@ other than \tcode{in_place_t} or \tcode{nullopt_t}. The declaration \begin{codeblock} -U u(invoke(std::forward(f), std::move(value()))); +U u(invoke(std::forward(f), std::move(*val))); \end{codeblock} is well-formed for some invented variable \tcode{u}. \begin{note} @@ -4256,7 +4256,7 @@ \returns If \tcode{*this} contains a value, an \tcode{optional} object whose contained value is direct-non-list-initialized with -\tcode{invoke(std::forward(f), std::move(value()))}; +\tcode{invoke(std::forward(f), std::move(*val))}; otherwise, \tcode{optional()}. \end{itemdescr} @@ -8368,7 +8368,7 @@ \begin{itemdescr} \pnum -Let \tcode{U} be \tcode{remove_cvref_t>}. +Let \tcode{U} be \tcode{remove_cvref_t>}. \pnum \constraints @@ -8384,7 +8384,7 @@ Equivalent to: \begin{codeblock} if (has_value()) - return invoke(std::forward(f), **this); + return invoke(std::forward(f), @\exposid{val}@); else return U(unexpect, error()); \end{codeblock} @@ -8399,7 +8399,7 @@ \begin{itemdescr} \pnum Let \tcode{U} be -\tcode{remove_cvref_t>}. +\tcode{remove_cvref_t>}. \pnum \constraints @@ -8415,7 +8415,7 @@ Equivalent to: \begin{codeblock} if (has_value()) - return invoke(std::forward(f), std::move(**this)); + return invoke(std::forward(f), std::move(@\exposid{val}@)); else return U(unexpect, std::move(error())); \end{codeblock} @@ -8433,7 +8433,7 @@ \pnum \constraints -\tcode{is_constructible_v} is \tcode{true}. +\tcode{is_constructible_v} is \tcode{true}. \pnum \mandates @@ -8445,7 +8445,7 @@ Equivalent to: \begin{codeblock} if (has_value()) - return G(in_place, **this); + return G(in_place, @\exposid{val}@); else return invoke(std::forward(f), error()); \end{codeblock} @@ -8464,7 +8464,7 @@ \pnum \constraints -\tcode{is_constructible_v} is \tcode{true}. +\tcode{is_constructible_v} is \tcode{true}. \pnum \mandates @@ -8476,7 +8476,7 @@ Equivalent to: \begin{codeblock} if (has_value()) - return G(in_place, std::move(**this)); + return G(in_place, std::move(@\exposid{val}@)); else return invoke(std::forward(f), std::move(error())); \end{codeblock} @@ -8491,7 +8491,7 @@ \begin{itemdescr} \pnum Let \tcode{U} be -\tcode{remove_cv_t>}. +\tcode{remove_cv_t>}. \pnum \constraints @@ -8503,7 +8503,7 @@ If \tcode{is_void_v} is \tcode{false}, the declaration \begin{codeblock} -U u(invoke(std::forward(f), **this)); +U u(invoke(std::forward(f), @\exposid{val}@)); \end{codeblock} is well-formed. @@ -8517,9 +8517,9 @@ Otherwise, if \tcode{is_void_v} is \tcode{false}, returns an \tcode{expected} object whose \exposid{has_val} member is \tcode{true} and \exposid{val} member is direct-non-list-initialized with -\tcode{invoke(std::forward(f), **this)}. +\tcode{invoke(std::forward(f), \exposid{val})}. \item -Otherwise, evaluates \tcode{invoke(std::forward(f), **this)} and then +Otherwise, evaluates \tcode{invoke(std::forward(f), \exposid{val})} and then returns \tcode{expected()}. \end{itemize} \end{itemdescr} @@ -8533,7 +8533,7 @@ \begin{itemdescr} \pnum Let \tcode{U} be -\tcode{remove_cv_t>}. +\tcode{remove_cv_t>}. \pnum \constraints @@ -8544,7 +8544,7 @@ \tcode{U} is a valid value type for \tcode{expected}. If \tcode{is_void_v} is \tcode{false}, the declaration \begin{codeblock} -U u(invoke(std::forward(f), std::move(**this))); +U u(invoke(std::forward(f), std::move(@\exposid{val}@))); \end{codeblock} is well-formed. @@ -8558,9 +8558,9 @@ Otherwise, if \tcode{is_void_v} is \tcode{false}, returns an \tcode{expected} object whose \exposid{has_val} member is \tcode{true} and \exposid{val} member is direct-non-list-initialized with -\tcode{invoke(std::forward(f), std::move(**this))}. +\tcode{invoke(std::forward(f), std::move(\exposid{val}))}. \item -Otherwise, evaluates \tcode{invoke(std::forward(f), std::move(**this))} and +Otherwise, evaluates \tcode{invoke(std::forward(f), std::move(\exposid{val}))} and then returns \tcode{ex\-pected()}. \end{itemize} \end{itemdescr} @@ -8577,7 +8577,7 @@ \pnum \constraints -\tcode{is_constructible_v} is \tcode{true}. +\tcode{is_constructible_v} is \tcode{true}. \pnum \mandates @@ -8591,7 +8591,7 @@ \pnum \returns If \tcode{has_value()} is \tcode{true}, -\tcode{expected(in_place, **this)}; otherwise, an \tcode{expected} +\tcode{expected(in_place, \exposid{val})}; otherwise, an \tcode{expected} object whose \exposid{has_val} member is \tcode{false} and \exposid{unex} member is direct-non-list-initialized with \tcode{invoke(std::forward(f), error())}. \end{itemdescr} @@ -8609,7 +8609,7 @@ \pnum \constraints -\tcode{is_constructible_v} is \tcode{true}. +\tcode{is_constructible_v} is \tcode{true}. \pnum \mandates @@ -8623,7 +8623,7 @@ \pnum \returns If \tcode{has_value()} is \tcode{true}, -\tcode{expected(in_place, std::move(**this))}; otherwise, an +\tcode{expected(in_place, std::move(\exposid{val}))}; otherwise, an \tcode{expected} object whose \exposid{has_val} member is \tcode{false} and \exposid{unex} member is direct-non-list-initialized with \tcode{invoke(std::forward(f), std::move(error()))}. From 170e9fb5ece3b524adbfa759e4a99356542f4ec7 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 21:48:12 -0800 Subject: [PATCH 19/22] LWG3974 mdspan::operator[] should not copy OtherIndexTypes --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 72d297b4c6..7bf51f6327 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -21473,7 +21473,7 @@ is \tcode{true}. Equivalent to: \begin{codeblock} -return operator[](as_const(indices[P])...); +return operator[](extents_type::@\exposid{index-cast}@(as_const(indices[P]))...); \end{codeblock} \end{itemdescr} From 0d20465f629732ed199254476fd8dc2e3d111b7b Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 21:50:10 -0800 Subject: [PATCH 20/22] LWG3987 Including doesn't provide std::begin/end --- source/iterators.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/iterators.tex b/source/iterators.tex index 4711fcd11d..dba63f6775 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -7215,6 +7215,8 @@ headers are included: \libheaderref{array}, \libheaderref{deque}, +\libheaderrefx{flat_map}{flat.map.syn}, +\libheaderrefx{flat_set}{flat.set.syn}, \libheaderrefx{forward_list}{forward.list.syn}, \libheaderref{list}, \libheaderrefx{map}{associative.map.syn}, From 9620e6d2ff6dcc1ee355bfaff664efd82774af03 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 21:58:18 -0800 Subject: [PATCH 21/22] LWG3990 Program-defined specializations of std::tuple and std::variant can't be properly supported Editorial note: a new subclause [tuple.tuple.general] has been added to avoid hanging paragraphs. --- source/utilities.tex | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index 4d448702fd..686afd2774 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -1615,8 +1615,10 @@ \end{itemdescr} \rSec2[tuple.tuple]{Class template \tcode{tuple}} -\indexlibraryglobal{tuple}% +\rSec3[tuple.tuple.general]{General} + +\indexlibraryglobal{tuple}% \begin{codeblock} namespace std { template @@ -1742,6 +1744,10 @@ } \end{codeblock} +\pnum +If a program declares an explicit or partial specialization of \tcode{tuple}, +the program is ill-formed, no diagnostic required. + \rSec3[tuple.cnstr]{Construction} \pnum @@ -5051,6 +5057,10 @@ A program that instantiates the definition of \tcode{variant} with no template arguments is ill-formed. +\pnum +If a program declares an explicit or partial specialization of \tcode{variant}, +the program is ill-formed, no diagnostic required. + \rSec3[variant.ctor]{Constructors} \pnum From a3fdcf1d089b7cc084e91bd241521fa63b619e58 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 13 Nov 2023 22:06:56 -0800 Subject: [PATCH 22/22] LWG4001 iota_view should provide empty --- source/ranges.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/ranges.tex b/source/ranges.tex index cb24ecea86..ad29f97687 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -2685,6 +2685,7 @@ constexpr auto end() const; constexpr @\exposid{iterator}@ end() const requires @\libconcept{same_as}@; + constexpr bool empty() const; constexpr auto size() const requires @\seebelow@; }; @@ -2902,6 +2903,17 @@ Equivalent to: \tcode{return \exposid{iterator}\{\exposid{bound_}\};} \end{itemdescr} +\indexlibrarymember{empty}{iota_view}% +\begin{itemdecl} +constexpr bool empty() const; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: \tcode{return \exposid{value_} == \exposid{bound_};} +\end{itemdescr} + \indexlibrarymember{size}{iota_view}% \begin{itemdecl} constexpr auto size() const requires @\seebelow@;