From 95df15d780368f1739cd63d3c2969708601a448f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 13 Feb 2020 21:03:26 -0800 Subject: [PATCH 01/44] LWG3194 ConvertibleTo prose does not match code --- source/concepts.tex | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index 814db1e127..0982bf23d1 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -314,29 +314,33 @@ \rSec2[concept.convertible]{Concept \cname{convertible_to}} \pnum -The \libconcept{convertible_to} concept requires an expression of a particular -type and value category to be both implicitly and explicitly convertible to some -other type. The implicit and explicit conversions are required to produce equal +Given types \tcode{From} and \tcode{To} and +an expression \tcode{E} such that +\tcode{decltype((E))} is \tcode{add_rvalue_reference_t}, +\tcode{\libconcept{convertible_to}} requires \tcode{E} +to be both implicitly and explicitly convertible to type \tcode{To}. +The implicit and explicit conversions are required to produce equal results. \begin{itemdecl} template concept @\deflibconcept{convertible_to}@ = is_convertible_v && - requires(From (&f)()) { + requires(add_rvalue_reference_t (&f)()) { static_cast(f()); }; \end{itemdecl} \begin{itemdescr} \pnum -Let \tcode{test} be the invented function: +Let \tcode{FromR} be \tcode{add_rvalue_reference_t} and +\tcode{test} be the invented function: \begin{codeblock} -To test(From (&f)()) { +To test(FromR (&f)()) { return f(); } \end{codeblock} -and let \tcode{f} be a function with no arguments and return type \tcode{From} +and let \tcode{f} be a function with no arguments and return type \tcode{FromR} such that \tcode{f()} is equality-preserving. Types \tcode{From} and \tcode{To} model \tcode{\libconcept{convertible_to}} only if: @@ -347,11 +351,11 @@ \tcode{static_cast(f())} is equal to \tcode{test(f)}. \item -\tcode{From} is not a reference-to-object type, or +\tcode{FromR} is not a reference-to-object type, or \begin{itemize} \item -If \tcode{From} is an rvalue reference to a non const-qualified type, the +If \tcode{FromR} is an rvalue reference to a non const-qualified type, the resulting state of the object referenced by \tcode{f()} after either above expression is valid but unspecified\iref{lib.types.movedfrom}. From 707c2d5cba7993b5ffc8f019ccfa8a6b2fd8f9bd Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 13 Feb 2020 21:57:25 -0800 Subject: [PATCH 02/44] LWG3233 Broken requirements for shared_ptr converting constructors --- source/utilities.tex | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index cdff0e39f0..116f2aacee 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -10302,7 +10302,24 @@ \begin{itemdescr} \pnum -\requires Construction of \tcode{d} and a deleter of type \tcode{D} +\constraints +\tcode{is_move_constructible_v} is \tcode{true}, and +\tcode{d(p)} is a well-formed expression. +For the first two overloads: + +\begin{itemize} +\item +If \tcode{T} is an array type, then either +\tcode{T} is \tcode{U[N]} and \tcode{Y(*)[N]} is convertible to \tcode{T*}, or +\tcode{T} is \tcode{U[]} and \tcode{Y(*)[]} is convertible to \tcode{T*}. + +\item +If \tcode{T} is not an array type, then \tcode{Y*} is convertible to \tcode{T*}. +\end{itemize} + +\pnum +\expects +Construction of \tcode{d} and a deleter of type \tcode{D} initialized with \tcode{std::move(d)} shall not throw exceptions. The expression \tcode{d(p)} shall have well-defined behavior and shall not throw exceptions. @@ -10328,20 +10345,6 @@ \tcode{bad_alloc}, or an \impldef{exception type when \tcode{shared_ptr} constructor fails} exception when a resource other than memory could not be obtained. - -\pnum -\remarks -When \tcode{T} is an array type, -this constructor shall not participate in overload resolution unless -\tcode{is_move_constructible_v} is \tcode{true}, -the expression \tcode{d(p)} is well-formed, and either -\tcode{T} is \tcode{U[N]} and \tcode{Y(*)[N]} is convertible to \tcode{T*}, or -\tcode{T} is \tcode{U[]} and \tcode{Y(*)[]} is convertible to \tcode{T*}. -When \tcode{T} is not an array type, -this constructor shall not participate in overload resolution unless -\tcode{is_move_constructible_v} is \tcode{true}, -the expression \tcode{d(p)} is well-formed, and -\tcode{Y*} is convertible to \tcode{T*}. \end{itemdescr} \indexlibraryctor{shared_ptr}% From a7f2dd697b3ab771fb253dbeb0cb1e667d33b670 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 13 Feb 2020 22:13:07 -0800 Subject: [PATCH 03/44] LWG3254 Strike stop_token's operator!= --- source/threads.tex | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index a85a18aea1..57a7991999 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -406,7 +406,6 @@ [[nodiscard]] bool stop_possible() const noexcept; [[nodiscard]] friend bool operator==(const stop_token& lhs, const stop_token& rhs) noexcept; - [[nodiscard]] friend bool operator!=(const stop_token& lhs, const stop_token& rhs) noexcept; friend void swap(stop_token& lhs, stop_token& rhs) noexcept; }; } @@ -542,7 +541,7 @@ otherwise, \tcode{true}. \end{itemdescr} -\rSec3[stoptoken.cmp]{Comparisons} +\rSec3[stoptoken.nonmembers]{Non-member functions} \indexlibrarymember{operator==}{stop_token}% \begin{itemdecl} @@ -557,19 +556,6 @@ otherwise \tcode{false}. \end{itemdescr} -\indexlibrarymember{operator!=}{stop_token}% -\begin{itemdecl} -[[nodiscard]] bool operator!=(const stop_token& lhs, const stop_token& rhs) noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\returns -\tcode{!(lhs==rhs)}. -\end{itemdescr} - -\rSec3[stoptoken.special]{Specialized algorithms} - \indexlibrarymember{swap}{stop_token}% \begin{itemdecl} friend void swap(stop_token& x, stop_token& y) noexcept; From c99a77681e6e1df4fbdbe1353b44204fc70113ce Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 13 Feb 2020 22:14:22 -0800 Subject: [PATCH 04/44] LWG3264 sized_range and ranges::size redundantly use disable_sized_range --- source/ranges.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index e33004d33d..f0323e2e2d 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -899,7 +899,6 @@ template concept @\deflibconcept{sized_range}@ = range && - !disable_sized_range> && requires(T& t) { ranges::size(t); }; \end{itemdecl} From a28b300db5c3a0c3b8c0f46a3bef7a4f4a2e2719 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 13 Feb 2020 22:23:55 -0800 Subject: [PATCH 05/44] LWG3280 View converting constructors can cause constraint recursion and are unneeded Also fixes NB US 302 (C++20 CD). --- source/ranges.tex | 105 ---------------------------------------------- 1 file changed, 105 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index f0323e2e2d..6a15e94ee9 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -3014,9 +3014,6 @@ public: filter_view() = default; constexpr filter_view(V base, Pred pred); - template - requires viewable_range && constructible_from> - constexpr filter_view(R&& r, Pred pred); constexpr V base() const& requires copy_constructible { return @\exposid{base_}@; } constexpr V base() && { return std::move(@\exposid{base_}@); } @@ -3047,20 +3044,6 @@ \exposid{pred_} with \tcode{std::move(pred)}. \end{itemdescr} -\indexlibraryctor{filter_view}% -\begin{itemdecl} -template - requires viewable_range && constructible_from> -constexpr filter_view(R&& r, Pred pred); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Initializes \exposid{base_} with \tcode{views::all(std::forward(r))} -and initializes \exposid{pred_} with \tcode{std::\brk{}move(pred)}. -\end{itemdescr} - \indexlibrarymember{begin}{filter_view}% \begin{itemdecl} constexpr @\exposid{iterator}@ begin(); @@ -3436,9 +3419,6 @@ public: transform_view() = default; constexpr transform_view(V base, F fun); - template - requires viewable_range && constructible_from> - constexpr transform_view(R&& r, F fun); constexpr V base() const& requires copy_constructible { return @\exposid{base_}@; } constexpr V base() && { return std::move(@\exposid{base_}@); } @@ -3479,20 +3459,6 @@ \exposid{fun_} with \tcode{std::move(fun)}. \end{itemdescr} -\indexlibraryctor{transform_view}% -\begin{itemdecl} -template - requires viewable_range && constructible_from> -constexpr transform_view(R&& r, F fun); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Initializes \exposid{base_} with \tcode{views::all(std::forward(r))} -and \exposid{fun_} with \tcode{std::move(fun)}. -\end{itemdescr} - \indexlibrarymember{begin}{transform_view}% \begin{itemdecl} constexpr @\exposid{iterator}@ begin(); @@ -4123,9 +4089,6 @@ public: take_view() = default; constexpr take_view(V base, range_difference_t count); - template - requires constructible_from> - constexpr take_view(R&& r, range_difference_t count); constexpr V base() const& requires copy_constructible { return @\exposid{base_}@; } constexpr V base() && { return std::move(@\exposid{base_}@); } @@ -4199,20 +4162,6 @@ \exposid{count_} with \tcode{count}. \end{itemdescr} -\indexlibraryctor{take_view}% -\begin{itemdecl} -template - requires constructible_from> -constexpr take_view(R&& r, range_difference_t count); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Initializes \exposid{base_} with \tcode{views::all(std::forward(r))} -and \exposid{count_} with \tcode{count}. -\end{itemdescr} - \rSec3[range.take.sentinel]{Class template \tcode{take_view::\exposid{sentinel}}} \indexlibraryglobal{take_view::sentinel}% @@ -4735,10 +4684,6 @@ join_view() = default; constexpr explicit join_view(V base); - template - requires viewable_range && constructible_from> - constexpr explicit join_view(R&& r); - constexpr V base() const& requires copy_constructible { return @\exposid{base_}@; } constexpr V base() && { return std::move(@\exposid{base_}@); } @@ -4791,19 +4736,6 @@ Initializes \exposid{base_} with \tcode{std::move(base)}. \end{itemdescr} -\indexlibraryctor{join_view}% -\begin{itemdecl} -template - requires viewable_range && constructible_from> -constexpr explicit join_view(R&& r); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Initializes \exposid{base_} with \tcode{views::all(std::forward(r))}. -\end{itemdescr} - \rSec3[range.join.iterator]{Class template \tcode{join_view::\exposid{iterator}}} \indexlibraryglobal{join_view::iterator}% @@ -5232,11 +5164,6 @@ split_view() = default; constexpr split_view(V base, Pattern pattern); - template - requires constructible_from> && - constructible_from> - constexpr split_view(R&& r, P&& p); - template requires constructible_from> && constructible_from>> @@ -5291,21 +5218,6 @@ \exposid{pattern_} with \tcode{std::move(pattern)}. \end{itemdescr} -\indexlibraryctor{split_view}% -\begin{itemdecl} -template - requires constructible_from> && - constructible_from> -constexpr split_view(R&& r, P&& p); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Initializes \exposid{base_} with \tcode{views::all(std::forward(r))}, and -\exposid{pattern_} with \tcode{views::all(\brk{}std::forward

(p))}. -\end{itemdescr} - \indexlibraryctor{split_view}% \begin{itemdecl} template @@ -5927,10 +5839,6 @@ constexpr explicit reverse_view(V r); - template - requires bidirectional_range && constructible_from> - constexpr explicit reverse_view(R&& r); - constexpr V base() const& requires copy_constructible { return @\exposid{base_}@; } constexpr V base() && { return std::move(@\exposid{base_}@); } @@ -5967,19 +5875,6 @@ Initializes \exposid{base_} with \tcode{std::move(base)}. \end{itemdescr} -\indexlibraryctor{reverse_view}% -\begin{itemdecl} -template - requires bidirectional_range && constructible_from> -constexpr explicit reverse_view(R&& r); -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Initializes \exposid{base_} with \tcode{views::all(std::forward(r))}. -\end{itemdescr} - \indexlibrarymember{begin}{reverse_view}% \begin{itemdecl} constexpr reverse_iterator> begin(); From 94a94e3c38502efa9775bf1d06f5b7dfb6fc878c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 13 Feb 2020 22:44:31 -0800 Subject: [PATCH 06/44] LWG3284 random_access_iterator semantic constraints accidentally promote difference type using unary negate Also fixes NB US 262 (C++20 CD). --- source/iterators.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iterators.tex b/source/iterators.tex index 7544e12f2d..cfdf569830 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1791,7 +1791,7 @@ \item \tcode{(a + D(0))} is equal to \tcode{a}. \item If \tcode{(a + D(n - 1))} is valid, then \tcode{(a + n)} is equal to \tcode{[](I c)\{ return ++c; \}(a + D(n - 1))}. -\item \tcode{(b += -n)} is equal to \tcode{a}. +\item \tcode{(b += D(-n))} is equal to \tcode{a}. \item \tcode{(b -= n)} is equal to \tcode{a}. \item \tcode{addressof(b -= n)} is equal to \tcode{addressof(b)}. \item \tcode{(b - n)} is equal to \tcode{(b -= n)}. From 7b2e123dde37e45ae977a152a5846749262baab9 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 13 Feb 2020 23:04:00 -0800 Subject: [PATCH 07/44] LWG3285 The type of a customization point object shall satisfy semiregular Also fixes NB US 156 (C++20 CD). --- source/lib-intro.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 5d82395496..df62386460 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1026,7 +1026,7 @@ enforcing semantic requirements on that interaction. \pnum -The type of a customization point object shall model +The type of a customization point object, ignoring cv-qualifiers, shall model \libconcept{semiregular}\iref{concepts.object}. \pnum From 095a7646b6370e9f6882f7b03f1869a1dcf58b67 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Thu, 13 Feb 2020 23:39:33 -0800 Subject: [PATCH 08/44] LWG3286 ranges::size is not required to be valid after a call to ranges::begin on an input range Also fixes NB US 304 (C++20 CD). --- source/ranges.tex | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 6a15e94ee9..4a6b8d4070 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1464,7 +1464,7 @@ Equivalent to: \begin{itemize} \item If \exposid{StoreSize} is \tcode{true}, -\tcode{subrange\{ranges::begin(r), ranges::end(r), ranges::size(r)\}}. +\tcode{subrange\{r, ranges::size(r)\}}. \item Otherwise, \tcode{subrange\{ranges::begin(r), ranges::end(r)\}}. \end{itemize} \end{itemdescr} @@ -4097,8 +4097,10 @@ if constexpr (sized_range) { if constexpr (random_access_range) return ranges::begin(@\exposid{base_}@); - else - return counted_iterator{ranges::begin(@\exposid{base_}@), size()}; + else { + auto sz = size(); + return counted_iterator{ranges::begin(@\exposid{base_}@), sz}; + } } else return counted_iterator{ranges::begin(@\exposid{base_}@), @\exposid{count_}@}; } @@ -4107,8 +4109,10 @@ if constexpr (sized_range) { if constexpr (random_access_range) return ranges::begin(@\exposid{base_}@); - else - return counted_iterator{ranges::begin(@\exposid{base_}@), size()}; + else { + auto sz = size(); + return counted_iterator{ranges::begin(@\exposid{base_}@), sz}; + } } else return counted_iterator{ranges::begin(@\exposid{base_}@), @\exposid{count_}@}; } From 5bd6da1d85a6b5f6738db6676edb062aef2f1ad5 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 01:39:55 -0800 Subject: [PATCH 09/44] LWG3291 iota_view::iterator has the wrong iterator_category Also fixes NB US 287 (C++20 CD). --- source/ranges.tex | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 4a6b8d4070..a7c921f9f6 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -2139,7 +2139,8 @@ private: W @\exposid{value_}@ = W(); // \expos public: - using iterator_category = @\seebelow@; + using iterator_concept = @\seebelow@; + using iterator_category = input_iterator_tag; using value_type = W; using difference_type = @\placeholdernc{IOTA-DIFF-T}@(W); @@ -2191,15 +2192,15 @@ \end{codeblock} \pnum -\tcode{iterator::iterator_category} is defined as follows: +\tcode{\exposid{iterator}::iterator_concept} is defined as follows: \begin{itemize} \item If \tcode{W} models \tcode{\placeholder{advanceable}}, then -\tcode{iterator_category} is \tcode{random_access_iterator_tag}. +\tcode{iterator_concept} is \tcode{random_access_iterator_tag}. \item Otherwise, if \tcode{W} models \exposconcept{decrementable}, then -\tcode{iterator_category} is \tcode{bidirectional_iterator_tag}. +\tcode{iterator_concept} is \tcode{bidirectional_iterator_tag}. \item Otherwise, if \tcode{W} models \libconcept{incrementable}, then -\tcode{iterator_category} is \tcode{forward_iterator_tag}. -\item Otherwise, \tcode{iterator_category} is \tcode{input_iterator_tag}. +\tcode{iterator_concept} is \tcode{forward_iterator_tag}. +\item Otherwise, \tcode{iterator_concept} is \tcode{input_iterator_tag}. \end{itemize} \pnum From ae15dd1b9116975f9f6d71955802536551d95d59 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 01:47:36 -0800 Subject: [PATCH 10/44] LWG3292 iota_view is under-constrained Also fixes NB US 286 (C++20 CD). --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index a7c921f9f6..7cab177ef6 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1900,7 +1900,7 @@ @\seebelow@; template - requires @\exposconcept{weakly-equality-comparable-with}@ + requires @\exposconcept{weakly-equality-comparable-with}@ && semiregular class iota_view : public view_interface> { private: // \ref{range.iota.iterator}, class \tcode{iota_view::\exposid{iterator}} From 09c20d939b5499616c2ef366a76e418d5a021f06 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 02:27:12 -0800 Subject: [PATCH 11/44] LWG3294 zoned_time deduction guides misinterprets string/char* [time.zone.zonedtime.overview] Replace undeclared TimeZonePtr with intended TimeZonePtrOrName in new deduction guide. --- source/time.tex | 57 +++++++++++++++++++++++++++---------------------- 1 file changed, 32 insertions(+), 25 deletions(-) diff --git a/source/time.tex b/source/time.tex index 8b76208498..cb71734cf9 100644 --- a/source/time.tex +++ b/source/time.tex @@ -9372,31 +9372,32 @@ zoned_time(sys_time) -> zoned_time>; - template - zoned_time(TimeZonePtr, sys_time) - -> zoned_time, TimeZonePtr>; - - template - zoned_time(TimeZonePtr, local_time, choose = choose::earliest) - -> zoned_time, TimeZonePtr>; - - template - zoned_time(TimeZonePtr, zoned_time, choose = choose::earliest) - -> zoned_time, TimeZonePtr>; - - zoned_time(string_view) -> zoned_time; - - template - zoned_time(string_view, sys_time) - -> zoned_time>; - - template - zoned_time(string_view, local_time, choose = choose::earliest) - -> zoned_time>; - - template - zoned_time(TimeZonePtr, zoned_time, choose = choose::earliest) - -> zoned_time, TimeZonePtr>; + template + using @\exposid{time-zone-representation}@ = // \expos + conditional_t, + const time_zone*, + remove_cv_ref>; + + template + zoned_time(TimeZonePtrOrName&&) + -> zoned_time>; + + template + zoned_time(TimeZonePtrOrName&&, sys_time) + -> zoned_time, + @\exposid{time-zone-representation}@>; + + template + zoned_time(TimeZonePtrOrName&&, local_time, + choose = choose::earliest) + -> zoned_time, + @\exposid{time-zone-representation}@>; + + template + zoned_time(TimeZonePtrOrName&&, zoned_time, + choose = choose::earliest) + -> zoned_time, + @\exposid{time-zone-representation}@>; } \end{codeblock} @@ -9412,6 +9413,12 @@ If \tcode{Duration} is not a specialization of \tcode{chrono::duration}, the program is ill-formed. +\pnum +Every constructor of \tcode{zoned_time} that +accepts a \tcode{string_view} as its first parameter +does not participate in +class template argument deduction\iref{over.match.class.deduct}. + \rSec3[time.zone.zonedtime.ctor]{Constructors} \indexlibrary{\idxcode{zoned_time}!constructor|(}% From a9d4809cca911d94009aa56147aab3a123b2b46d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 02:33:10 -0800 Subject: [PATCH 12/44] LWG3296 Inconsistent default argument for basic_regex<>::assign --- source/regex.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/regex.tex b/source/regex.tex index 97ef35bb0e..947e54b680 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -1296,7 +1296,7 @@ basic_regex& assign(const basic_regex& e); basic_regex& assign(basic_regex&& e) noexcept; basic_regex& assign(const charT* p, flag_type f = regex_constants::ECMAScript); - basic_regex& assign(const charT* p, size_t len, flag_type f); + basic_regex& assign(const charT* p, size_t len, flag_type f = regex_constants::ECMAScript); template basic_regex& assign(const basic_string& s, flag_type f = regex_constants::ECMAScript); From fdd34db806c4a99c64f73ae9f20d6e84243e4e89 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 02:41:49 -0800 Subject: [PATCH 13/44] LWG3299 Pointers don't need customized iterator behavior --- source/iterators.tex | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index cfdf569830..18360d3e02 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1055,7 +1055,9 @@ expression-equivalent to: \begin{itemize} -\item \tcode{iter_move(E)}, if that expression is valid, with overload +\item \tcode{iter_move(E)}, if +\tcode{E} has class or enumeration type and +\tcode{iter_move(E)} is a well-formed expression with overload resolution performed in a context that does not include a declaration of \tcode{ranges::iter_move}. @@ -1110,7 +1112,9 @@ The expression \tcode{ranges::iter_swap(E1, E2)} for subexpressions \tcode{E1} and \tcode{E2} is expression-equivalent to: \begin{itemize} -\item \tcode{(void)iter_swap(E1, E2)}, if that expression is valid, +\item \tcode{(void)iter_swap(E1, E2)}, if either +\tcode{E1} or \tcode{E2} has class or enumeration type and +\tcode{iter_swap(E1, E2)} is a well-formed expression with overload resolution performed in a context that includes the declaration \begin{codeblock} template From b7f07b3316a85f89324758bff9896f4c4c8b55d4 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 02:52:03 -0800 Subject: [PATCH 14/44] LWG3300 Non-array ssize overload is underconstrained --- source/iterators.tex | 5 +++-- source/utilities.tex | 10 ++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index 18360d3e02..c6cee72ac0 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -6614,9 +6614,10 @@ \end{itemdecl} \begin{itemdescr} \pnum -\returns +\effects +Equivalent to: \begin{codeblock} -static_cast>>(c.size()) +return static_cast>>(c.size()); \end{codeblock} \end{itemdescr} diff --git a/source/utilities.tex b/source/utilities.tex index 116f2aacee..eb7105aa31 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -17828,9 +17828,8 @@ rank\iref{conv.rank} for which \tcode{sizeof(T) == sizeof(type)}, with the same cv-qualifiers as \tcode{T}.\br - \requires{} \tcode{T} shall be a (possibly cv-qualified) - integral type or enumeration - but not a \tcode{bool} type.\\ \rowsep + \mandates{} \tcode{T} is an integral or enumeration type + other than \cv~\tcode{bool}.\\ \rowsep \indexlibraryglobal{make_unsigned}% \tcode{template}\br @@ -17845,9 +17844,8 @@ rank\iref{conv.rank} for which \tcode{sizeof(T) == sizeof(type)}, with the same cv-qualifiers as \tcode{T}.\br - \requires{} \tcode{T} shall be a (possibly cv-qualified) - integral type or enumeration - but not a \tcode{bool} type.\\ + \mandates{} \tcode{T} is an integral or enumeration type + other than \cv~\tcode{bool}.\\ \rowsep \end{libreqtab2a} \rSec3[meta.trans.arr]{Array modifications} From 5a66090a609310de00b9dd91579a5c19989962eb Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 02:54:43 -0800 Subject: [PATCH 15/44] LWG3302 Range adaptor objects keys and values are unspecified --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 7cab177ef6..b8891c2acf 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -278,8 +278,8 @@ namespace views { template inline constexpr @\unspec@ elements = @\unspec@ ; - inline constexpr @\unspec@ keys = @\unspec@ ; - inline constexpr @\unspec@ values = @\unspec@ ; + inline constexpr auto keys = elements<0>; + inline constexpr auto values = elements<1>; } } From d3ce1fcb67084ced8ec378f9ab107a61c3c958d7 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 02:57:42 -0800 Subject: [PATCH 16/44] LWG3303 Bad "constexpr" marker for destroy/destroy_n --- source/utilities.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index eb7105aa31..641293ad5a 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -6747,13 +6747,13 @@ template constexpr void destroy(ForwardIterator first, ForwardIterator last); template - constexpr void destroy(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads} - ForwardIterator first, ForwardIterator last); + void destroy(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads} + ForwardIterator first, ForwardIterator last); template constexpr ForwardIterator destroy_n(ForwardIterator first, Size n); template - constexpr ForwardIterator destroy_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads} - ForwardIterator first, Size n); + ForwardIterator destroy_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads} + ForwardIterator first, Size n); namespace ranges { template From 1cec86727bb0ee351de24dff996a485561c86a04 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 03:02:13 -0800 Subject: [PATCH 17/44] LWG3304 Allocate functions of std::polymorphic_allocator should require [[nodiscard]] Also fixes NB US 217 (C++20 CD). --- source/utilities.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 641293ad5a..6680fc50aa 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -12090,11 +12090,11 @@ [[nodiscard]] Tp* allocate(size_t n); void deallocate(Tp* p, size_t n); - void* allocate_bytes(size_t nbytes, size_t alignment = alignof(max_align_t)); + [[nodiscard]] void* allocate_bytes(size_t nbytes, size_t alignment = alignof(max_align_t)); void deallocate_bytes(void* p, size_t nbytes, size_t alignment = alignof(max_align_t)); - template T* allocate_object(size_t n = 1); + template [[nodiscard]] T* allocate_object(size_t n = 1); template void deallocate_object(T* p, size_t n = 1); - template T* new_object(CtorArgs&&... ctor_args); + template [[nodiscard]] T* new_object(CtorArgs&&... ctor_args); template void delete_object(T* p); template @@ -12199,7 +12199,7 @@ \indexlibrarymember{allocate_bytes}{polymorphic_allocator}% \begin{itemdecl} -void* allocate_bytes(size_t nbytes, size_t alignment = alignof(max_align_t)); +[[nodiscard]] void* allocate_bytes(size_t nbytes, size_t alignment = alignof(max_align_t)); \end{itemdecl} \begin{itemdescr} @@ -12230,7 +12230,7 @@ \indexlibrarymember{allocate_object}{polymorphic_allocator}% \begin{itemdecl} template - T* allocate_object(size_t n = 1); + [[nodiscard]] T* allocate_object(size_t n = 1); \end{itemdecl} \begin{itemdescr} @@ -12269,7 +12269,7 @@ \indexlibrarymember{new_object}{polymorphic_allocator}% \begin{itemdecl} template - T* new_object(CtorArgs&&... ctor_args); + [[nodiscard]] T* new_object(CtorArgs&&... ctor_args); \end{itemdecl} \begin{itemdescr} From b3d809a0b73009a6953acb2cd67dd53c234c4588 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 03:05:25 -0800 Subject: [PATCH 18/44] LWG3307 std::allocator().allocate(n) --- source/utilities.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/utilities.tex b/source/utilities.tex index 6680fc50aa..3c73b37503 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -7951,6 +7951,10 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\mandates +\tcode{T} is not an incomplete type\iref{basic.types}. + \pnum \returns A pointer to the initial element of an array of \tcode{n} \tcode{T}. From 31e9bb01741a76ec48b84cf49a638a4dde349afe Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 03:17:08 -0800 Subject: [PATCH 19/44] LWG3310 Replace SIZE_MAX with numeric_limits::max() Also fixes NB JP 218, JP 219 (C++20 CD). --- source/utilities.tex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 3c73b37503..c4ea04c821 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -12173,7 +12173,8 @@ \begin{itemdescr} \pnum \effects -If \tcode{SIZE_MAX / sizeof(Tp) < n}, throws \tcode{length_error}. +If \tcode{numeric_limits::max() / sizeof(Tp) < n}, +throws \tcode{length_error}. Otherwise equivalent to: \begin{codeblock} return static_cast(memory_rsrc->allocate(n * sizeof(Tp), alignof(Tp))); @@ -12244,7 +12245,8 @@ an array of \tcode{n} objects of type \tcode{T}, as follows: \begin{itemize} \item - if \tcode{SIZE_MAX / sizeof(T) < n}, throws \tcode{length_error}, + if \tcode{numeric_limits::max() / sizeof(T) < n}, + throws \tcode{length_error}, \item otherwise equivalent to: \begin{codeblock} From b561e61cc3f005773522b224637258d4e9b2a110 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 03:25:11 -0800 Subject: [PATCH 20/44] LWG3313 join_view::iterator::operator-- is incorrectly constrained Also fixes NB US 294 (C++20 CD). --- source/ranges.tex | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index b8891c2acf..5152e5092a 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -4790,11 +4790,13 @@ constexpr @\exposid{iterator}@& operator--() requires @\exposid{ref-is-glvalue}@ && bidirectional_range<@\exposid{Base}@> && - bidirectional_range>; + bidirectional_range> && + common_range>; constexpr @\exposid{iterator}@ operator--(int) requires @\exposid{ref-is-glvalue}@ && bidirectional_range<@\exposid{Base}@> && - bidirectional_range>; + bidirectional_range> && + common_range>; friend constexpr bool operator==(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) requires @\exposid{ref-is-glvalue}@ && equality_comparable> && @@ -4985,7 +4987,8 @@ \begin{itemdecl} constexpr @\exposid{iterator}@& operator--() requires @\exposid{ref-is-glvalue}@ && bidirectional_range<@\exposid{Base}@> && - bidirectional_range>; + bidirectional_range> && + common_range>; \end{itemdecl} \begin{itemdescr} @@ -5006,7 +5009,8 @@ \begin{itemdecl} constexpr @\exposid{iterator}@ operator--(int) requires @\exposid{ref-is-glvalue}@ && bidirectional_range<@\exposid{Base}@> && - bidirectional_range>; + bidirectional_range> && + common_range>; \end{itemdecl} \begin{itemdescr} From ebd893b65beb4561252e19640a84d53933b17a62 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 03:49:18 -0800 Subject: [PATCH 21/44] LWG3315 Correct Allocator Default Behavior Also fixes NB US 162, US 163 (C++20 CD). --- source/lib-intro.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index df62386460..c802b2b1fb 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -2200,12 +2200,12 @@ (not used) & \effects Constructs an object of type \tcode{C} at \tcode{c} & - \tcode{::new ((void*)c) C(forward<\brk{}Args>\brk(args)...)} \\ \rowsep + \tcode{construct_at(c,~std::\brk{}forward\brk{}(args)...)} \\ \rowsep \tcode{a.destroy(c)} & (not used) & \effects Destroys the object at \tcode{c} & - \tcode{c->\~{}C()} \\ \rowsep + \tcode{destroy_at(c)} \\ \rowsep \tcode{a.select_on_container_copy_construction()} & \tcode{X} & From 5518e72bc16a28d250486761c1be53f91e2e00fd Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 04:08:07 -0800 Subject: [PATCH 22/44] LWG3316 Correctly define epoch for utc_clock / utc_timepoint Also fixes NB GB 333 (C++20 CD). --- source/time.tex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/time.tex b/source/time.tex index cb71734cf9..cb13b445ff 100644 --- a/source/time.tex +++ b/source/time.tex @@ -2736,6 +2736,12 @@ which does not take leap seconds into account, \tcode{utc_clock} and its associated \tcode{time_point}, \tcode{utc_time}, count time, including leap seconds, since 1970-01-01 00:00:00 UTC. +\begin{note} +The UTC time standard began on 1972-01-01 00:00:10 TAI. +To measure time since this epoch instead, one can add/subtract the constant +\tcode{sys_days\{1972y/1/1\} - sys_days\{1970y/1/1\}} (\tcode{63'072'000s}) +from the \tcode{utc_time}. +\end{note} \begin{example} \\ \tcode{clock_cast(sys_seconds\{sys_days\{1970y/January/1\}\}).time_since_epoch()} is \tcode{0s}. \\ From 8662855f756b57f4dca3a2b62e7688f6d0df79ce Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 05:19:05 -0800 Subject: [PATCH 23/44] LWG3317 Incorrect operator<< for floating-point durations [time.duration.io] Combined paragraphs 3 and 4 with 2 (now 1) to provide a complete definition for the placeholder "units_suffix" introduced in the code in paragraph 2, and added punctuation. Also fixes NB US 334 (C++20 CD). --- source/time.tex | 154 +++++++++++++++++++++++++++++++++--------------- 1 file changed, 106 insertions(+), 48 deletions(-) diff --git a/source/time.tex b/source/time.tex index cb13b445ff..9723ad2798 100644 --- a/source/time.tex +++ b/source/time.tex @@ -2013,62 +2013,120 @@ \end{itemdecl} \begin{itemdescr} -\pnum -\mandates -\tcode{Rep} is an integral type -whose integer conversion rank\iref{conv.rank} -is greater than or equal to that of \tcode{short}, -or a floating-point type. -\tcode{charT} is \tcode{char} or \tcode{wchar_t}. - \pnum \effects -Forms a \tcode{basic_string} from \tcode{d.count()} -using \tcode{to_string} if \tcode{charT} is \tcode{char}, -or \tcode{to_wstring} if \tcode{charT} is \tcode{wchar_t}. -Appends the units suffix described below to the \tcode{basic_string}. -Inserts the resulting \tcode{basic_string} into \tcode{os}. -\begin{note} -This specification ensures that the result of this streaming operation -will obey the width and alignment properties of the stream. -\end{note} +Inserts the duration \tcode{d} onto the stream \tcode{os} +as if it were implemented as follows: +\begin{codeblock} +basic_ostringstream s; +s.flags(os.flags()); +s.imbue(os.getloc()); +s.precision(os.precision()); +s << d.count() << @\placeholder{units-suffix}@; +return os << s.str(); +\end{codeblock} +where \tcode{\placeholder{units-suffix}} +depends on the type \tcode{Period::type} as follows: -\pnum -The units suffix depends on the type \tcode{Period::type} as follows: \begin{itemize} -\item If \tcode{Period::type} is \tcode{atto}, the suffix is \tcode{"as"}. -\item Otherwise, if \tcode{Period::type} is \tcode{femto}, the suffix is \tcode{"fs"}. -\item Otherwise, if \tcode{Period::type} is \tcode{pico}, the suffix is \tcode{"ps"}. -\item Otherwise, if \tcode{Period::type} is \tcode{nano}, the suffix is \tcode{"ns"}. -\item Otherwise, if \tcode{Period::type} is \tcode{micro}, the suffix is \tcode{"\textmu{}s"} (\tcode{"\textbackslash{}u00b5\textbackslash{}u0073"}). -\item Otherwise, if \tcode{Period::type} is \tcode{milli}, the suffix is \tcode{"ms"}. -\item Otherwise, if \tcode{Period::type} is \tcode{centi}, the suffix is \tcode{"cs"}. -\item Otherwise, if \tcode{Period::type} is \tcode{deci}, the suffix is \tcode{"ds"}. -\item Otherwise, if \tcode{Period::type} is \tcode{ratio<1>}, the suffix is \tcode{"s"}. -\item Otherwise, if \tcode{Period::type} is \tcode{deca}, the suffix is \tcode{"das"}. -\item Otherwise, if \tcode{Period::type} is \tcode{hecto}, the suffix is \tcode{"hs"}. -\item Otherwise, if \tcode{Period::type} is \tcode{kilo}, the suffix is \tcode{"ks"}. -\item Otherwise, if \tcode{Period::type} is \tcode{mega}, the suffix is \tcode{"Ms"}. -\item Otherwise, if \tcode{Period::type} is \tcode{giga}, the suffix is \tcode{"Gs"}. -\item Otherwise, if \tcode{Period::type} is \tcode{tera}, the suffix is \tcode{"Ts"}. -\item Otherwise, if \tcode{Period::type} is \tcode{peta}, the suffix is \tcode{"Ps"}. -\item Otherwise, if \tcode{Period::type} is \tcode{exa}, the suffix is \tcode{"Es"}. -\item Otherwise, if \tcode{Period::type} is \tcode{ratio<60>}, the suffix is \tcode{"min"}. -\item Otherwise, if \tcode{Period::type} is \tcode{ratio<3600>}, the suffix is \tcode{"h"}. -\item Otherwise, if \tcode{Period::type} is \tcode{ratio<86400>}, the suffix is \tcode{"d"}. -\item Otherwise, if \tcode{Period::type::den == 1}, the suffix is \tcode{"[\placeholder{num}]s"}. -\item Otherwise, the suffix is \tcode{"[\placeholder{num}/\placeholder{den}]s"}. +\item +If \tcode{Period::type} is \tcode{atto}, +\tcode{\placeholder{units-suffix}} is \tcode{"as"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{femto}, +\tcode{\placeholder{units-suffix}} is \tcode{"fs"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{pico}, +\tcode{\placeholder{units-suffix}} is \tcode{"ps"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{nano}, +\tcode{\placeholder{units-suffix}} is \tcode{"ns"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{micro}, +\tcode{\placeholder{units-suffix}} is: +\begin{itemize} +\item \tcode{"\textmu{}s"} (\tcode{"\textbackslash{}u00b5\textbackslash{}u0073"}) if the character U+00B5 can be represented in the encoding used for \tcode{charT}; +\item \tcode{"us"} otherwise. +\end{itemize} + +\item +Otherwise, if \tcode{Period::type} is \tcode{milli}, +\tcode{\placeholder{units-suffix}} is \tcode{"ms"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{centi}, +\tcode{\placeholder{units-suffix}} is \tcode{"cs"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{deci}, +\tcode{\placeholder{units-suffix}} is \tcode{"ds"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{ratio<1>}, +\tcode{\placeholder{units-suffix}} is \tcode{"s"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{deca}, +\tcode{\placeholder{units-suffix}} is \tcode{"das"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{hecto}, +\tcode{\placeholder{units-suffix}} is \tcode{"hs"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{kilo}, +\tcode{\placeholder{units-suffix}} is \tcode{"ks"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{mega}, +\tcode{\placeholder{units-suffix}} is \tcode{"Ms"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{giga}, +\tcode{\placeholder{units-suffix}} is \tcode{"Gs"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{tera}, +\tcode{\placeholder{units-suffix}} is \tcode{"Ts"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{peta}, +\tcode{\placeholder{units-suffix}} is \tcode{"Ps"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{exa}, +\tcode{\placeholder{units-suffix}} is \tcode{"Es"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{ratio<60>}, +\tcode{\placeholder{units-suffix}} is \tcode{"min"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{ratio<3600>}, +\tcode{\placeholder{units-suffix}} is \tcode{"h"}. + +\item +Otherwise, if \tcode{Period::type} is \tcode{ratio<86400>}, +\tcode{\placeholder{units-suffix}} is \tcode{"d"}. + +\item +Otherwise, if \tcode{Period::type::den == 1}, +\tcode{\placeholder{units-suffix}} is \tcode{"[\placeholder{num}]s"}. + +\item +Otherwise, \tcode{\placeholder{units-suffix}} is +\tcode{"[\placeholder{num}/\placeholder{den}]s"}. \end{itemize} -In the list above the use of \tcode{\placeholder{num}} and \tcode{\placeholder{den}} + +In the list above, +the use of \tcode{\placeholder{num}} and \tcode{\placeholder{den}} refer to the static data members of \tcode{Period::type}, which are converted to arrays of \tcode{charT} using a decimal conversion with no leading zeroes. -\pnum -If \tcode{Period::type} is \tcode{micro}, -but the character U+00B5 cannot be represented in -the encoding used for \tcode{charT}, -the unit suffix \tcode{"us"} is used instead of \tcode{"\textmu{}s"}. - \pnum \returns \tcode{os}. From bd57d9c9f3531984c4b96075b34b14d9254bc2a2 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 05:21:58 -0800 Subject: [PATCH 24/44] LWG3318 Clarify whether clocks can represent time before their epoch Also fixes NB GB 335 (C++20 CD). --- source/time.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/time.tex b/source/time.tex index 9723ad2798..ea6fc72be8 100644 --- a/source/time.tex +++ b/source/time.tex @@ -2619,7 +2619,7 @@ \pnum Objects of type \tcode{system_clock} represent wall clock time from the system-wide realtime clock. -Objects of type \tcode{sys_time} measure time since (and before) +Objects of type \tcode{sys_time} measure time since 1970-01-01 00:00:00 UTC excluding leap seconds. This measure is commonly referred to as \defn{Unix time}. This measure facilitates an efficient mapping between From 41e73c4b9ca94c4e263d751e9780f548c4c9067b Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 05:41:02 -0800 Subject: [PATCH 25/44] LWG3319 Properly reference specification of IANA time zone database Also fixes NB DE 344 (C++20 CD). [Bibliography] Changed punctuation to be consistent with existing entries. --- source/back.tex | 3 +++ source/intro.tex | 8 ++------ source/time.tex | 2 +- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/source/back.tex b/source/back.tex index 511d3f9a26..33c925ab46 100644 --- a/source/back.tex +++ b/source/back.tex @@ -6,6 +6,9 @@ \chapter{Bibliography} \begin{itemize} \renewcommand{\labelitemi}{---} +\item + IANA Time Zone Database, + available at \url{https://www.iana.org/time-zones} \item ISO/IEC 10967-1:2012, \doccite{Information technology --- Language independent arithmetic --- diff --git a/source/intro.tex b/source/intro.tex index b0bdd7f467..ab5ff09bd4 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -35,14 +35,10 @@ \begin{itemize} \item Ecma International, \doccite{ECMAScript Language Specification}, Standard Ecma-262, third edition, 1999. +% FIXME: Is the following comment refering to the entry above or +% the entry removed in LWG3319? I.e. is it still valid? %%% Format for this entry is based on that specified at %%% http://www.iec.ch/standardsdev/resources/draftingpublications/directives/principles/referencing.htm -\item INTERNET ENGINEERING TASK FORCE (IETF). RFC 6557: -Procedures for Maintaining the Time Zone Database [online]. -Edited by E. Lear, P. Eggert. -February 2012 [viewed 2018-03-26]. -Available at -\url{https://www.ietf.org/rfc/rfc6557.txt} \item ISO/IEC 2382 (all parts), \doccite{Information technology --- Vocabulary} \item ISO 8601:2004, \doccite{Data elements and interchange formats --- diff --git a/source/time.tex b/source/time.tex index ea6fc72be8..13cb032096 100644 --- a/source/time.tex +++ b/source/time.tex @@ -8492,7 +8492,7 @@ \pnum \ref{time.zone} describes an interface for accessing -the IANA Time Zone database described in RFC 6557, +the IANA Time Zone Database that interoperates with \tcode{sys_time} and \tcode{local_time}. This interface provides time zone support to both the civil calendar types\iref{time.cal} From 6faa9cf651ecb6e02456c951238cae50246a36de Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 05:48:26 -0800 Subject: [PATCH 26/44] LWG3320 span::cbegin/cend methods produce different results than std::[ranges::]cbegin/cend Also fixes NB PL 247 (C++20 CD). --- source/containers.tex | 64 ++++--------------------------------------- 1 file changed, 5 insertions(+), 59 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 6289fbd4cb..1ccc6f65d7 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -10568,9 +10568,7 @@ using reference = element_type&; using const_reference = const element_type&; using iterator = @\impdefx{type of \tcode{span::iterator}}@; // see \ref{span.iterators} - using const_iterator = @\impdefx{type of \tcode{span::const_iterator}}@; using reverse_iterator = std::reverse_iterator; - using const_reverse_iterator = std::reverse_iterator; static constexpr size_type extent = Extent; // \ref{span.cons}, constructors, copy, and assignment @@ -10622,12 +10620,8 @@ // \ref{span.iterators}, iterator support constexpr iterator begin() const noexcept; constexpr iterator end() const noexcept; - constexpr const_iterator cbegin() const noexcept; - constexpr const_iterator cend() const noexcept; constexpr reverse_iterator rbegin() const noexcept; constexpr reverse_iterator rend() const noexcept; - constexpr const_reverse_iterator crbegin() const noexcept; - constexpr const_reverse_iterator crend() const noexcept; private: pointer data_; // \expos @@ -11119,23 +11113,21 @@ \rSec3[span.iterators]{Iterator support} \indexlibrarymember{iterator}{span}% -\indexlibrarymember{const_iterator}{span}% \begin{itemdecl} using iterator = @\impdefx{type of \tcode{span::iterator}}@; -using const_iterator = @\impdefx{type of \tcode{span::const_iterator}}@; \end{itemdecl} \begin{itemdescr} \pnum -The types -model \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}, -meet the \oldconcept{RandomAccessIterator} +The type +models \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}, +meets the \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators}, and -meet the requirements for +meets the requirements for constexpr iterators\iref{iterator.requirements.general}. All requirements on container iterators\iref{container.requirements} apply to -\tcode{span::iterator} and \tcode{span::const_iterator} as well. +\tcode{span::iterator} as well. \end{itemdescr} \indexlibrarymember{span}{begin}% @@ -11184,52 +11176,6 @@ Equivalent to: \tcode{return reverse_iterator(begin());} \end{itemdescr} -\indexlibrarymember{span}{cbegin}% -\begin{itemdecl} -constexpr const_iterator cbegin() const noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\returns -A constant iterator referring to the first element in the span. -If \tcode{empty()} is \tcode{true}, then it returns the same value -as \tcode{cend()}. -\end{itemdescr} - -\indexlibrarymember{span}{cend}% -\begin{itemdecl} -constexpr const_iterator cend() const noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\returns -A constant iterator which is the past-the-end value. -\end{itemdescr} - -\indexlibrarymember{span}{crbegin}% -\begin{itemdecl} -constexpr const_reverse_iterator crbegin() const noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Equivalent to: \tcode{return const_reverse_iterator(cend());} -\end{itemdescr} - -\indexlibrarymember{span}{crend}% -\begin{itemdecl} -constexpr const_reverse_iterator crend() const noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Equivalent to: \tcode{return const_reverse_iterator(cbegin());} -\end{itemdescr} - \rSec3[span.objectrep]{Views of object representation} From f3199a9ddea525a19f521807c34db91fe482f770 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 05:53:18 -0800 Subject: [PATCH 27/44] LWG3321 uninitialized_construct_using_allocator should use construct_at Also fixes NB US 213 (C++20 CD). --- source/utilities.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index c4ea04c821..44e340e6eb 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -7605,8 +7605,9 @@ \effects Equivalent to: \begin{codeblock} -return ::new(static_cast(p)) - T(make_obj_using_allocator(alloc, std::forward(args)...)); +return apply([&](auto&&...xs) { + return construct_at(p, std::forward(xs)...); + }, uses_allocator_construction_args(alloc, std::forward(args)...)); \end{codeblock} \end{itemdescr} From 74487d32b52ea64f5e6fb63908b584d2a8568c30 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 05:55:00 -0800 Subject: [PATCH 28/44] LWG3323 has-tuple-element helper concept needs convertible_to Also fixes NB GB 299 (C++20 CD). --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 5152e5092a..57953ca351 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -6006,7 +6006,7 @@ typename tuple_size::type; requires N < tuple_size_v; typename tuple_element_t; - { get(t) } -> const tuple_element_t&; + { get(t) } -> convertible_to&>; }; From 099d5506bb5ad50bb054efaf49011dde1e0e8df3 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 05:59:01 -0800 Subject: [PATCH 29/44] LWG3324 Special-case std::strong/weak/partial_order for pointers Also fixes NB CA 178 (C++20 CD). --- source/support.tex | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/support.tex b/source/support.tex index 3915f9acec..165cc779c2 100644 --- a/source/support.tex +++ b/source/support.tex @@ -4693,7 +4693,8 @@ is additionally consistent with the \tcode{totalOrder} operation as specified in ISO/IEC/IEEE 60559. \item - Otherwise, \tcode{strong_ordering(E <=> F)} if it is a well-formed expression. + Otherwise, \tcode{strong_ordering(compare_three_way()(E, F))} + if it is a well-formed expression. \item Otherwise, \tcode{strong_order(E, F)} is ill-formed. \begin{note} @@ -4740,7 +4741,8 @@ \item together, all positive NaN values. \end{itemize} \item - Otherwise, \tcode{weak_ordering(E <=> F)} if it is a well-formed expression. + Otherwise, \tcode{weak_ordering(compare_three_way()(E, F))} + if it is a well-formed expression. \item Otherwise, \tcode{weak_ordering(strong_order(E, F))} if it is a well-formed expression. @@ -4770,7 +4772,7 @@ with overload resolution performed in a context that does not include a declaration of \tcode{std::partial_order}. \item - Otherwise, \tcode{partial_ordering(E <=> F)} + Otherwise, \tcode{partial_ordering(compare_three_way()(E, F))} if it is a well-formed expression. \item Otherwise, \tcode{partial_ordering(weak_order(E, F))} From a72b9006c74ea8eda5629700f19ea89ab6cab8bb Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 06:09:36 -0800 Subject: [PATCH 30/44] LWG3325 Constrain return type of transformation function for transform_view Also fixes NB US 303 (C++20 CD). --- source/ranges.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 57953ca351..fc4aa1f5f8 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -3406,7 +3406,8 @@ namespace std::ranges { template requires view && is_object_v && - regular_invocable> + regular_invocable> && + @\exposconcept{can-reference}@>> class transform_view : public view_interface> { private: // \ref{range.transform.iterator}, class template \tcode{transform_view::\exposid{iterator}} From 3777012ee8136c909b9d2ce2e75fa2e42ef4d073 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 06:43:54 -0800 Subject: [PATCH 31/44] LWG3326 enable_view has false positives [range.split.outer.value] The change to split_view was applied in LWG3276. Also fixes NB DE 282 (C++20 CD). --- source/containers.tex | 3 +++ source/ranges.tex | 25 +------------------------ source/strings.tex | 2 ++ 3 files changed, 6 insertions(+), 24 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 1ccc6f65d7..cabd9b7bcc 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -10514,6 +10514,9 @@ template class span; + template + inline constexpr bool ranges::enable_view> = + Extent == 0 || Extent == dynamic_extent; template inline constexpr bool ranges::enable_safe_range> = true; diff --git a/source/ranges.tex b/source/ranges.tex index fc4aa1f5f8..4c0b5f6c49 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1015,35 +1015,12 @@ \indexlibraryglobal{enable_view}% \begin{itemdecl} template - inline constexpr bool enable_view = @\seebelow@; + inline constexpr bool enable_view = derived_from; \end{itemdecl} \begin{itemdescr} \pnum \remarks -For a type \tcode{T}, the default value of \tcode{enable_view} is: -\begin{itemize} - -\item If \tcode{derived_from} is \tcode{true}, \tcode{true}. -\item Otherwise, if \tcode{T} is a specialization of class template - \tcode{initializer_list}\iref{support.initlist}, - \tcode{set}\iref{set}, - \tcode{multiset}\iref{multiset}, - \tcode{unordered_set}\iref{unord.set}, - \tcode{unordered_multiset}\iref{unord.multiset}, or - \tcode{match_results}\iref{re.results}, \tcode{false}. -\item Otherwise, if both \tcode{T} and \tcode{const T} model \libconcept{range} - and \tcode{range_reference_t} is not the same type as - \tcode{range_reference_t}, - \tcode{false}. - \begin{note} - Deep \tcode{const}-ness implies element ownership, - whereas shallow \tcode{const}-ness implies reference semantics. - \end{note} -\item Otherwise, \tcode{true}. -\end{itemize} - -\pnum Pursuant to \ref{namespace.std}, users may specialize \tcode{enable_view} to \tcode{true} for cv-unqualified program-defined types which model \libconcept{view}, diff --git a/source/strings.tex b/source/strings.tex index d5f1f22094..ec6f3c2d2c 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -3932,6 +3932,8 @@ template> class basic_string_view; + template + inline constexpr bool ranges::enable_view> = true; template inline constexpr bool ranges::enable_safe_range> = true; From 862d4465b071d6820fff2cdd523a5191eb994ced Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 06:47:39 -0800 Subject: [PATCH 32/44] LWG3327 Format alignment specifiers vs. text direction Also fixes NB GB 225 (C++20 CD). --- source/utilities.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 44e340e6eb..fc8a6da1ff 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -19830,14 +19830,14 @@ \topline \lhdr{Option} & \rhdr{Meaning} \\ \rowsep \tcode{<} & -Forces the field to be left-aligned within the available space. +Forces the field to be aligned to the start of the available space. This is the default for non-arithmetic types, \tcode{charT}, and \tcode{bool}, unless an integer presentation type is specified. \\ \rowsep % \tcode{>} & -Forces the field to be right-aligned within the available space. +Forces the field to be aligned to the end of the available space. This is the default for arithmetic types other than \tcode{charT} and \tcode{bool} or when an integer presentation type is specified. From 43e9566671e3db689bd3f81f538484965a6a56e9 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 06:51:30 -0800 Subject: [PATCH 33/44] LWG3329 totally_ordered_with both directly and indirectly requires common_reference_with Also fixes NB US 201 (C++20 CD). --- source/concepts.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index 0982bf23d1..52d09dc92a 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -993,12 +993,11 @@ template concept @\deflibconcept{totally_ordered_with}@ = totally_ordered && totally_ordered && - common_reference_with&, const remove_reference_t&> && + equality_comparable_with && totally_ordered< common_reference_t< const remove_reference_t&, const remove_reference_t&>> && - equality_comparable_with && requires(const remove_reference_t& t, const remove_reference_t& u) { { t < u } -> boolean; From abaa67fbeba0043aaad6ba22b87a39e8bd92929f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 07:38:30 -0800 Subject: [PATCH 34/44] LWG3330 Include from most library headers Added references to header synopsis on #includes. Also fixes NB US 181 (C++20 CD). --- source/containers.tex | 33 ++++++++++++++++++++++----------- source/diagnostics.tex | 2 ++ source/iostreams.tex | 2 ++ source/iterators.tex | 3 ++- source/ranges.tex | 5 +++-- source/regex.tex | 3 ++- source/strings.tex | 5 ++++- source/support.tex | 2 ++ source/threads.tex | 3 +++ source/time.tex | 2 ++ source/utilities.tex | 11 +++++++++++ 11 files changed, 55 insertions(+), 16 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index cabd9b7bcc..f19d29aaff 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -3114,7 +3114,8 @@ \indexheader{array}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{array}, class template \tcode{array} @@ -3151,7 +3152,8 @@ \indexheader{deque}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{deque}, class template \tcode{deque} @@ -3183,7 +3185,8 @@ \indexheader{forward_list}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{forwardlist}, class template \tcode{forward_list} @@ -3215,7 +3218,8 @@ \indexheader{list}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{list}, class template \tcode{list} @@ -3247,7 +3251,8 @@ \indexheader{vector}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{vector}, class template \tcode{vector} @@ -6249,7 +6254,8 @@ \indexheader{map}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{map}, class template \tcode{map} @@ -6310,7 +6316,8 @@ \indexheader{set}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{set}, class template \tcode{set} @@ -7805,7 +7812,8 @@ \indexlibraryglobal{unordered_map}% \indexlibraryglobal{unordered_multimap}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{unord.map}, class template \tcode{unordered_map} @@ -7874,7 +7882,8 @@ \indexlibraryglobal{unordered_set}% \indexlibraryglobal{unordered_multiset}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{unord.set}, class template \tcode{unordered_set} @@ -9587,7 +9596,8 @@ \indexheader{queue} \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { template> class queue; @@ -9629,7 +9639,8 @@ \indexheader{stack}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { template> class stack; diff --git a/source/diagnostics.tex b/source/diagnostics.tex index d7267f9e48..e32db0f167 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -680,6 +680,8 @@ \indexlibraryglobal{is_error_condition_enum}% \indexlibraryglobal{errc}% \begin{codeblock} +#include // see \ref{compare.syn} + namespace std { class error_category; const error_category& generic_category() noexcept; diff --git a/source/iostreams.tex b/source/iostreams.tex index e1c601e6b5..131afb7c7b 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -11438,6 +11438,8 @@ \indexheader{filesystem}% \begin{codeblock} +#include // see \ref{compare.syn} + namespace std::filesystem { // \ref{fs.class.path}, paths class path; diff --git a/source/iterators.tex b/source/iterators.tex index c6cee72ac0..b0f55f5cc4 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -33,7 +33,8 @@ \indexlibraryglobal{default_sentinel}% \indexlibraryglobal{unreachable_sentinel}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{concepts.syn} namespace std { template using @\placeholder{with-reference}@ = T&; // \expos diff --git a/source/ranges.tex b/source/ranges.tex index 4c0b5f6c49..91726ca067 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -25,8 +25,9 @@ \indexheader{ranges}% \begin{codeblock} -#include -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} +#include // see \ref{iterator.synopsis} namespace std::ranges { inline namespace @\unspec@ { diff --git a/source/regex.tex b/source/regex.tex index 947e54b680..007e8bc69f 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -265,7 +265,8 @@ \indexlibraryglobal{regex}% \indexlibraryglobal{wregex}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{re.const}, regex constants diff --git a/source/strings.tex b/source/strings.tex index ec6f3c2d2c..d2f212c5d2 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -528,7 +528,8 @@ \indexheader{string}% \begin{codeblock} -#include +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} namespace std { // \ref{char.traits}, character traits @@ -3927,6 +3928,8 @@ \indexheader{string_view}% \begin{codeblock} +#include // see \ref{compare.syn} + namespace std { // \ref{string.view.template}, class template \tcode{basic_string_view} template> diff --git a/source/support.tex b/source/support.tex index 165cc779c2..0946499f59 100644 --- a/source/support.tex +++ b/source/support.tex @@ -4878,6 +4878,8 @@ \indexheader{coroutine}% \indexlibraryglobal{noop_coroutine_handle}% \begin{codeblock} +#include // see \ref{compare.syn} + namespace std { // \ref{coroutine.traits}, coroutine traits template diff --git a/source/threads.tex b/source/threads.tex index 57a7991999..4dac305996 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -979,6 +979,9 @@ \indexheader{thread}% \begin{codeblock} +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} + namespace std { class thread; diff --git a/source/time.tex b/source/time.tex index 13cb032096..2f1800a071 100644 --- a/source/time.tex +++ b/source/time.tex @@ -63,6 +63,8 @@ \indexlibrarymember{earliest}{choose}% \indexlibrarymember{latest}{choose}% \begin{codeblock} +#include // see \ref{compare.syn} + namespace std { namespace chrono { // \ref{time.duration}, class template \tcode{duration} diff --git a/source/utilities.tex b/source/utilities.tex index fc8a6da1ff..0659d31782 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -41,6 +41,7 @@ throughout the rest of the library. \begin{codeblock} +#include // see \ref{compare.syn} #include // see \ref{initializer.list.syn} namespace std { @@ -971,6 +972,8 @@ \indexheader{tuple}% \begin{codeblock} +#include // see \ref{compare.syn} + namespace std { // \ref{tuple.tuple}, class template \tcode{tuple} template @@ -2136,6 +2139,8 @@ \indexheader{optional}% \begin{codeblock} +#include // see \ref{compare.syn} + namespace std { // \ref{optional.optional}, class template \tcode{optional} template @@ -3648,6 +3653,8 @@ \indexheader{variant}% \begin{codeblock} +#include // see \ref{compare.syn} + namespace std { // \ref{variant.variant}, class template \tcode{variant} template @@ -6501,6 +6508,8 @@ templates that operate on objects of these types\iref{smartptr}. \begin{codeblock} +#include // see \ref{compare.syn} + namespace std { // \ref{pointer.traits}, pointer traits template struct pointer_traits; @@ -18774,6 +18783,8 @@ \indexheader{typeindex}% \begin{codeblock} +#include // see \ref{compare.syn} + namespace std { class type_index; template struct hash; From 6f9fcd3413657fbb2a2cdf6d01649ade0d1ea7fb Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 07:58:15 -0800 Subject: [PATCH 35/44] LWG3331 Define totally_ordered/_with in terms of partially-ordered-with Also fixes NB GB 202 (C++20 CD). --- source/concepts.tex | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index 52d09dc92a..09ebc7b2c3 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -961,14 +961,7 @@ \begin{itemdecl} template concept @\deflibconcept{totally_ordered}@ = - equality_comparable && - requires(const remove_reference_t& a, - const remove_reference_t& b) { - { a < b } -> boolean; - { a > b } -> boolean; - { a <= b } -> boolean; - { a >= b } -> boolean; - }; + equality_comparable && @\exposconcept{partially-ordered-with}@; \end{itemdecl} \begin{itemdescr} @@ -982,7 +975,6 @@ \tcode{bool(a == b)} is \tcode{true}. \item If \tcode{bool(a < b)} and \tcode{bool(b < c)}, then \tcode{bool(a < c)}. -\item \tcode{bool(a > b) == bool(b < a)}. \item \tcode{bool(a <= b) == !bool(b < a)}. \item \tcode{bool(a >= b) == !bool(a < b)}. \end{itemize} @@ -998,17 +990,7 @@ common_reference_t< const remove_reference_t&, const remove_reference_t&>> && - requires(const remove_reference_t& t, - const remove_reference_t& u) { - { t < u } -> boolean; - { t > u } -> boolean; - { t <= u } -> boolean; - { t >= u } -> boolean; - { u < t } -> boolean; - { u > t } -> boolean; - { u <= t } -> boolean; - { u >= t } -> boolean; - }; + @\exposconcept{partially-ordered-with}@; \end{itemdecl} \begin{itemdescr} From 68a6fd2b94a419054aa87a886d88861c3cc4c263 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 08:00:49 -0800 Subject: [PATCH 36/44] LWG3332 Issue in [time.format] --- source/time.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/time.tex b/source/time.tex index 2f1800a071..bbf398acf6 100644 --- a/source/time.tex +++ b/source/time.tex @@ -10226,7 +10226,7 @@ \begin{ncbnf} \fmtnontermdef{type} \textnormal{one of}\br \terminal{a A b B c C d D e F g G h H I j m M n}\br - \terminal{p r R S t T u U V w W x X y Y z Z \%} + \terminal{p q Q r R S t T u U V w W x X y Y z Z \%} \end{ncbnf} The productions From f426a147315929cccb340f6cfd7320291977ffdb Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 08:09:12 -0800 Subject: [PATCH 37/44] LWG3338 Rename default_constructible to default_initializable --- source/concepts.tex | 10 +++++----- source/iterators.tex | 2 +- source/ranges.tex | 6 +++--- source/utilities.tex | 24 ++++++++++++------------ 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index 09ebc7b2c3..8ec984eb9d 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -200,9 +200,9 @@ template concept constructible_from = @\seebelow@; - // \ref{concept.defaultconstructible}, concept \libconcept{default_constructible} + // \ref{concept.default.init}, concept \libconcept{default_initializable} template - concept default_constructible = @\seebelow@; + concept default_initializable = @\seebelow@; // \ref{concept.moveconstructible}, concept \libconcept{move_constructible} template @@ -739,14 +739,14 @@ concept @\deflibconcept{constructible_from}@ = destructible && is_constructible_v; \end{itemdecl} -\rSec2[concept.defaultconstructible]{Concept \cname{default_constructible}} +\rSec2[concept.default.init]{Concept \cname{default_initializable}} \begin{itemdecl} template inline constexpr bool @\defexposconcept{is-default-initializable}@ = @\seebelow@; // \expos template - concept @\deflibconcept{default_constructible}@ = constructible_from && + concept @\deflibconcept{default_initializable}@ = constructible_from && requires { T{}; } && @\exposconcept{is-default-initializable}@; \end{itemdecl} @@ -1030,7 +1030,7 @@ template concept @\deflibconcept{copyable}@ = copy_constructible && movable && assignable_from; template - concept @\deflibconcept{semiregular}@ = copyable && default_constructible; + concept @\deflibconcept{semiregular}@ = copyable && default_initializable; template concept @\deflibconcept{regular}@ = semiregular && equality_comparable; \end{itemdecl} diff --git a/source/iterators.tex b/source/iterators.tex index b0f55f5cc4..d2739af41e 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1299,7 +1299,7 @@ template concept @\deflibconcept{weakly_incrementable}@ = - default_constructible && movable && + default_initializable && movable && requires(I i) { typename iter_difference_t; requires @\placeholdernc{is-signed-integer-like}@>; diff --git a/source/ranges.tex b/source/ranges.tex index 91726ca067..3a8c53c262 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -966,7 +966,7 @@ \begin{itemdecl} template concept @\deflibconcept{view}@ = - range && movable && default_constructible && enable_view; + range && movable && default_initializable && enable_view; \end{itemdecl} \begin{itemdescr} @@ -2576,7 +2576,7 @@ }; template - requires default_constructible && + requires default_initializable && @\exposconcept{stream-extractable}@ class basic_istream_view : public view_interface> { public: @@ -2827,7 +2827,7 @@ its type parameter \tcode{T} with \tcode{\libconcept{copy_constructible} \&\& is_object_v}. -\item If \tcode{T} models \libconcept{default_constructible}, the default +\item If \tcode{T} models \libconcept{default_initializable}, the default constructor of \tcode{\placeholder{semiregular-box}} is equivalent to: \begin{codeblock} constexpr @\placeholder{semiregular-box}@() noexcept(is_nothrow_default_constructible_v) diff --git a/source/utilities.tex b/source/utilities.tex index 0659d31782..08970b1d6e 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -6609,14 +6609,14 @@ namespace ranges { template<@\exposconcept{no-throw-forward-iterator}@ I, @\exposconcept{no-throw-sentinel}@ S> - requires default_constructible> + requires default_initializable> I uninitialized_default_construct(I first, S last); template<@\exposconcept{no-throw-forward-range}@ R> - requires default_constructible> + requires default_initializable> safe_iterator_t uninitialized_default_construct(R&& r); template<@\exposconcept{no-throw-forward-iterator}@ I> - requires default_constructible> + requires default_initializable> I uninitialized_default_construct_n(I first, iter_difference_t n); } @@ -6633,14 +6633,14 @@ namespace ranges { template<@\exposconcept{no-throw-forward-iterator}@ I, @\exposconcept{no-throw-sentinel}@ S> - requires default_constructible> + requires default_initializable> I uninitialized_value_construct(I first, S last); template<@\exposconcept{no-throw-forward-range}@ R> - requires default_constructible> + requires default_initializable> safe_iterator_t uninitialized_value_construct(R&& r); template<@\exposconcept{no-throw-forward-iterator}@ I> - requires default_constructible> + requires default_initializable> I uninitialized_value_construct_n(I first, iter_difference_t n); } @@ -8225,10 +8225,10 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I, @\placeholdernc{no-throw-sentinel}@ S> - requires default_constructible> + requires default_initializable> I uninitialized_default_construct(I first, S last); template<@\placeholdernc{no-throw-forward-range}@ R> - requires default_constructible> + requires default_initializable> safe_iterator_t uninitialized_default_construct(R&& r); } \end{itemdecl} @@ -8266,7 +8266,7 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I> - requires default_constructible> + requires default_initializable> I uninitialized_default_construct_n(I first, iter_difference_t n); } \end{itemdecl} @@ -8304,10 +8304,10 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I, @\placeholdernc{no-throw-sentinel}@ S> - requires default_constructible> + requires default_initializable> I uninitialized_value_construct(I first, S last); template<@\placeholdernc{no-throw-forward-range}@ R> - requires default_constructible> + requires default_initializable> safe_iterator_t uninitialized_value_construct(R&& r); } \end{itemdecl} @@ -8345,7 +8345,7 @@ \begin{itemdecl} namespace ranges { template<@\placeholdernc{no-throw-forward-iterator}@ I> - requires default_constructible> + requires default_initializable> I uninitialized_value_construct_n(I first, iter_difference_t n); } \end{itemdecl} From 84c829b1857a7c3915c4c8a815817f88f335b196 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 08:16:38 -0800 Subject: [PATCH 38/44] LWG3346 pair and tuple copy and move constructor have backwards specification --- source/utilities.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 08970b1d6e..736fc6765d 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -520,7 +520,7 @@ \pnum The defaulted move and copy constructor, respectively, of \tcode{pair} is a constexpr function if and only if all required element-wise -initializations for copy and move, respectively, would satisfy the +initializations for move and copy, respectively, would satisfy the requirements for a constexpr function. \pnum @@ -1160,7 +1160,7 @@ \pnum The defaulted move and copy constructor, respectively, of \tcode{tuple} is a constexpr function if and only if all -required element-wise initializations for copy and move, respectively, +required element-wise initializations for move and copy, respectively, would satisfy the requirements for a constexpr function. The defaulted move and copy constructor of \tcode{tuple<>} are constexpr functions. From 1fca6b1cbe43ce5c50d57d61283a1e4ef02d0081 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 08:18:49 -0800 Subject: [PATCH 39/44] LWG3349 Missing __cpp_lib_constexpr_complex for P0415R1 --- source/support.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/support.tex b/source/support.tex index 0946499f59..632306ac7f 100644 --- a/source/support.tex +++ b/source/support.tex @@ -586,6 +586,7 @@ #define @\defnlibxname{cpp_lib_complex_udls}@ 201309L // also in \libheader{complex} #define @\defnlibxname{cpp_lib_concepts}@ 201907L // also in \libheader{concepts} #define @\defnlibxname{cpp_lib_constexpr_algorithms}@ 201806L // also in \libheader{algorithm} +#define @\defnlibxname{cpp_lib_constexpr_complex}@ 201711L // also in \libheader{complex} #define @\defnlibxname{cpp_lib_constexpr_dynamic_alloc}@ 201907L // also in \libheader{memory} #define @\defnlibxname{cpp_lib_constexpr_functional}@ 201907L // also in \libheader{functional} #define @\defnlibxname{cpp_lib_constexpr_iterator}@ 201811L // also in \libheader{iterator} From 4199b0542ceaa2cf553e6631707a94d2aeb88fb4 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 08:22:17 -0800 Subject: [PATCH 40/44] LWG3350 Simplify return type of lexicographical_compare_three_way --- source/algorithms.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 986afa033f..950f542ffa 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -2846,7 +2846,7 @@ lexicographical_compare_three_way(InputIterator1 b1, InputIterator1 e1, InputIterator2 b2, InputIterator2 e2, Cmp comp) - -> common_comparison_category_t; + -> decltype(comp(*b1, *b2)); template constexpr auto lexicographical_compare_three_way(InputIterator1 b1, InputIterator1 e1, @@ -8444,7 +8444,7 @@ lexicographical_compare_three_way(InputIterator1 b1, InputIterator1 e1, InputIterator2 b2, InputIterator2 e2, Cmp comp) - -> common_comparison_category_t; + -> decltype(comp(*b1, *b2)); \end{itemdecl} \begin{itemdescr} From 61395891e2cb9050cd4e394491bda5afca47f841 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 08:24:05 -0800 Subject: [PATCH 41/44] LWG3351 ranges::enable_safe_range should not be constrained --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 3a8c53c262..3d34a50710 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -51,7 +51,7 @@ template concept range = @\seebelow@; - template + template inline constexpr bool enable_safe_range = false; template From 901833b2149e1d62a06faaeb68aa9b2a32832e84 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 08:26:33 -0800 Subject: [PATCH 42/44] LWG3356 __cpp_lib_nothrow_convertible should be __cpp_lib_is_nothrow_convertible --- source/support.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/support.tex b/source/support.tex index 632306ac7f..20fc249233 100644 --- a/source/support.tex +++ b/source/support.tex @@ -626,6 +626,7 @@ #define @\defnlibxname{cpp_lib_is_final}@ 201402L // also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_invocable}@ 201703L // also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_layout_compatible}@ 201907L // also in \libheader{type_traits} +#define @\defnlibxname{cpp_lib_is_nothrow_convertible}@ 201806L // also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_null_pointer}@ 201309L // also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_pointer_interconvertible}@ 201907L // also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_swappable}@ 201603L // also in \libheader{type_traits} @@ -647,7 +648,6 @@ // also in \libheader{array}, \libheader{deque}, \libheader{forward_list}, \libheader{iterator}, \libheader{list}, \libheader{map}, \libheader{regex}, \libheader{set}, \libheader{string}, // \libheader{unordered_map}, \libheader{unordered_set}, \libheader{vector} #define @\defnlibxname{cpp_lib_not_fn}@ 201603L // also in \libheader{functional} -#define @\defnlibxname{cpp_lib_nothrow_convertible}@ 201806L // also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_null_iterators}@ 201304L // also in \libheader{iterator} #define @\defnlibxname{cpp_lib_optional}@ 201606L // also in \libheader{optional} #define @\defnlibxname{cpp_lib_parallel_algorithm}@ 201603L // also in \libheader{algorithm}, \libheader{numeric} From de58af86bd4b248dd3aeb65aff88af068a2d9436 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 14 Feb 2020 08:29:07 -0800 Subject: [PATCH 43/44] LWG3360 three_way_comparable_with is inconsistent with similar concepts --- source/support.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/support.tex b/source/support.tex index 20fc249233..e482f0078f 100644 --- a/source/support.tex +++ b/source/support.tex @@ -4601,13 +4601,13 @@ \begin{codeblock} template concept @\deflibconcept{three_way_comparable_with}@ = - @\exposconcept{weakly-equality-comparable-with}@ && - @\exposconcept{partially-ordered-with}@ && three_way_comparable && three_way_comparable && common_reference_with&, const remove_reference_t&> && three_way_comparable< common_reference_t&, const remove_reference_t&>, Cat> && + @\exposconcept{weakly-equality-comparable-with}@ && + @\exposconcept{partially-ordered-with}@ && requires(const remove_reference_t& t, const remove_reference_t& u) { { t <=> u } -> @\exposconcept{compares-as}@; { u <=> t } -> @\exposconcept{compares-as}@; From 090d7d8c96ec5e6371e087fd3f1d4455a6dbb7bd Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 21 Feb 2020 13:39:40 -0800 Subject: [PATCH 44/44] [allocator.uses.construction] Give a name to generic lambda type parameter to allow idiomatic use of std::forward. --- source/utilities.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 736fc6765d..0a787e896d 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -7614,8 +7614,8 @@ \effects Equivalent to: \begin{codeblock} -return apply([&](auto&&...xs) { - return construct_at(p, std::forward(xs)...); +return apply([&](U&&... xs) { + return construct_at(p, std::forward(xs)...); }, uses_allocator_construction_args(alloc, std::forward(args)...)); \end{codeblock} \end{itemdescr}