From 4f5b94796ac402afb03102ff0bad307322834eb6 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 09:47:17 -0800 Subject: [PATCH 01/44] LWG3118 fpos equality comparison unspecified --- source/iostreams.tex | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index fc56636633..0e5ccd6d64 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -1700,7 +1700,7 @@ of type \tcode{P} or \tcode{const P}, \item \tcode{pl} and \tcode{ql} refer to modifiable lvalues of type \tcode{P}, \item \tcode{O} refers to type \tcode{streamoff}, and -\item \tcode{o} refers to a value +\item \tcode{o} and \tcode{o2} refer to values of type \tcode{streamoff} or \tcode{const streamoff}. \end{itemize} @@ -1725,7 +1725,7 @@ & & \effects Value-initializes the state object. \br - \ensures \tcode{p == P(o)} \\ \rowsep + \ensures \tcode{p == P(o)} is \tcode{true}. \\ \rowsep \tcode{P()} & \tcode{P} & \tcode{P(0)} & @@ -1738,8 +1738,20 @@ \tcode{streamoff} & converts to \tcode{offset} & \tcode{P(O(p)) == p} \\ \rowsep +\tcode{p == q} & + \tcode{bool} & + & + \remarks For any two values \tcode{o} and \tcode{o2}, + if \tcode{p} is obtained + from \tcode{o} converted to \tcode{P} or + from a copy of such \tcode{P} value and + if \tcode{q} is obtained + from \tcode{o2} converted to \tcode{P} or + from a copy of such \tcode{P} value, + then \tcode{p == q} is \tcode{true} + only if \tcode{o == o2} is \tcode{true}. \\ \rowsep \tcode{p != q} & - convertible to \tcode{bool} & + \tcode{bool} & \tcode{!(p == q)} & \\ \rowsep \tcode{p + o} & \tcode{P} & From 308b5ef5219d903a504f13dac0d1c960e17c28a7 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 09:52:15 -0800 Subject: [PATCH 02/44] =?UTF-8?q?LWG3594=20inout=5Fptr=20=E2=80=94=20incon?= =?UTF-8?q?sistent=20release()=20in=20destructor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/memory.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/memory.tex b/source/memory.tex index 9dc24f3078..6ada84d1dd 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -5193,9 +5193,9 @@ \item otherwise, \begin{codeblock} +@\exposid{release-statement}@; if (p) { apply([&](auto&&... args) { - @\exposid{release-statement}@; s.reset(static_cast(p), std::forward(args)...); }, std::move(a)); } \end{codeblock} @@ -5205,9 +5205,9 @@ \item otherwise, \begin{codeblock} +@\exposid{release-statement}@; if (p) { apply([&](auto&&... args) { - @\exposid{release-statement}@; s = Smart(static_cast(p), std::forward(args)...); }, std::move(a)); } \end{codeblock} From 51f4ba9d007cfb4d0d11b1ec9836f7d6ab0c1dec Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 10:06:37 -0800 Subject: [PATCH 03/44] LWG3636 formatter::format should be const-qualified --- source/time.tex | 4 ++-- source/utilities.tex | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/time.tex b/source/time.tex index 1f97197252..f45b163df2 100644 --- a/source/time.tex +++ b/source/time.tex @@ -10963,7 +10963,7 @@ : formatter, charT> { template typename FormatContext::iterator - format(const chrono::zoned_time& tp, FormatContext& ctx); + format(const chrono::zoned_time& tp, FormatContext& ctx) const; }; \end{codeblock} @@ -10971,7 +10971,7 @@ \begin{itemdecl} template typename FormatContext::iterator - format(const chrono::zoned_time& tp, FormatContext& ctx); + format(const chrono::zoned_time& tp, FormatContext& ctx) const; \end{itemdecl} \begin{itemdescr} diff --git a/source/utilities.tex b/source/utilities.tex index 30f814b68d..479d4de54c 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -15034,7 +15034,8 @@ \tcode{Out}, and formatting argument type \tcode{T}, in \tref{formatter.basic} and \tref{formatter}: \begin{itemize} -\item \tcode{f} is a value of type \tcode{F}, +\item \tcode{f} is a value of type (possibly \tcode{const}) \tcode{F}, +\item \tcode{g} is an lvalue of type \tcode{F}, \item \tcode{u} is an lvalue of type \tcode{T}, \item \tcode{t} is a value of a type convertible to (possibly const) \tcode{T}, \item \tcode{PC} is \tcode{basic_format_parse_context}, @@ -15054,7 +15055,7 @@ {p{1.2in}p{1in}p{2.9in}} \topline \hdstyle{Expression} & \hdstyle{Return type} & \hdstyle{Requirement} \\ \capsep -\tcode{f.parse(pc)} & +\tcode{g.parse(pc)} & \tcode{PC::iterator} & Parses \fmtgrammarterm{format-spec}\iref{format.string} for type \tcode{T} @@ -15252,7 +15253,7 @@ const char* color_names[] = { "red", "green", "blue" }; template<> struct std::formatter : std::formatter { - auto format(color c, format_context& ctx) { + auto format(color c, format_context& ctx) const { return formatter::format(color_names[c], ctx); } }; @@ -15685,7 +15686,7 @@ } // Formats an \tcode{S} with width given by the argument \tcode{width_arg_id}. - auto format(S s, format_context& ctx) { + auto format(S s, format_context& ctx) const { int width = visit_format_arg([](auto value) -> int { if constexpr (!is_integral_v) throw format_error("width is not integral"); From f3840cd62094226ba6f0a8290ad3b023b9852eea Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 10:11:41 -0800 Subject: [PATCH 04/44] LWG3754 Class template expected synopsis contains declarations that do not match the detailed description --- source/utilities.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 479d4de54c..e5b0f8b081 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -7237,9 +7237,9 @@ constexpr explicit(@\seebelow@) expected(U&& v); template - constexpr expected(const unexpected&); + constexpr explicit(@\seebelow@) expected(const unexpected&); template - constexpr expected(unexpected&&); + constexpr explicit(@\seebelow@) expected(unexpected&&); template constexpr explicit expected(in_place_t, Args&&...); @@ -8312,9 +8312,9 @@ constexpr explicit(@\seebelow@) expected(expected&&); template - constexpr expected(const unexpected&); + constexpr explicit(@\seebelow@) expected(const unexpected&); template - constexpr expected(unexpected&&); + constexpr explicit(@\seebelow@) expected(unexpected&&); constexpr explicit expected(in_place_t) noexcept; template From 47fb595b396d7a0820f6e933800420c3d10bd238 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 12:56:53 -0800 Subject: [PATCH 05/44] LWG3028 Container requirements tables should distinguish const and non-const variables --- source/containers.tex | 111 ++++++++++++++++++++++-------------------- 1 file changed, 58 insertions(+), 53 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 474f7ecae1..7b67e5bd7d 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -79,13 +79,18 @@ \item \tcode{X} denotes a container class containing objects of type \tcode{T}, \item -\tcode{a} and \tcode{b} denote values of type \tcode{X}, +\tcode{a} denotes a value of type \tcode{X}, +\item +\tcode{b} and \tcode{c} denote values of type (possibly const) \tcode{X}, \item \tcode{i} and \tcode{j} denote values of type (possibly const) \tcode{X::iterator}, \item \tcode{u} denotes an identifier, \item -\tcode{r} denotes a non-const value of type \tcode{X}, and +\tcode{v} denotes an lvalue of type (possibly const) \tcode{X} or +an rvalue of type \tcode{const X}, +\item +\tcode{s} and \tcode{t} denote non-const lvalues of type \tcode{X}, and \item \tcode{rv} denotes a non-const rvalue of type \tcode{X}. \end{itemize} @@ -219,8 +224,8 @@ \end{itemdescr} \begin{itemdecl} -X u(a); -X u = a; +X u(v); +X u = v; \end{itemdecl} \begin{itemdescr} @@ -230,7 +235,7 @@ \pnum \ensures -\tcode{u == a} +\tcode{u == v}. \pnum \complexity @@ -252,8 +257,27 @@ Linear for \tcode{array} and constant for all other standard containers. \end{itemdescr} +\indexcont{operator=}% \begin{itemdecl} -a = rv +t = v; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\result +\tcode{X\&}. + +\pnum +\ensures +\tcode{t == v}. + +\pnum +\complexity +Linear. +\end{itemdescr} + +\begin{itemdecl} +t = rv \end{itemdecl} \begin{itemdescr} @@ -263,12 +287,12 @@ \pnum \effects -All existing elements of \tcode{a} are either move assigned to or destroyed. +All existing elements of \tcode{t} are either move assigned to or destroyed. \pnum \ensures -If \tcode{a} and \tcode{rv} do not refer to the same object, -\tcode{a} is equal to the value that \tcode{rv} had before this assignment. +If \tcode{t} and \tcode{rv} do not refer to the same object, +\tcode{t} is equal to the value that \tcode{rv} had before this assignment. \pnum \complexity @@ -282,7 +306,7 @@ \begin{itemdescr} \pnum \result -\keyword{void} +\keyword{void}. \pnum \effects @@ -295,14 +319,14 @@ \indexcont{begin}% \begin{itemdecl} -a.begin() +b.begin() \end{itemdecl} \begin{itemdescr} \pnum \result \tcode{iterator}; -\tcode{const_iterator} for constant \tcode{a}. +\tcode{const_iterator} for constant \tcode{b}. \pnum \returns @@ -315,14 +339,14 @@ \indexcont{end}% \begin{itemdecl} -a.end() +b.end() \end{itemdecl} \begin{itemdescr} \pnum \result \tcode{iterator}; -\tcode{const_iterator} for constant \tcode{a}. +\tcode{const_iterator} for constant \tcode{b}. \pnum \returns @@ -335,7 +359,7 @@ \indexcont{cbegin}% \begin{itemdecl} -a.cbegin() +b.cbegin() \end{itemdecl} \begin{itemdescr} @@ -345,7 +369,7 @@ \pnum \returns -\tcode{const_cast(a).begin()} +\tcode{const_cast(b).begin()} \pnum \complexity @@ -354,7 +378,7 @@ \indexcont{cend}% \begin{itemdecl} -a.cend() +b.cend() \end{itemdecl} \begin{itemdescr} @@ -364,7 +388,7 @@ \pnum \returns -\tcode{const_cast(a).end()} +\tcode{const_cast(b).end()} \pnum \complexity @@ -391,7 +415,7 @@ \indexcont{operator==}% \begin{itemdecl} -a == b +c == b \end{itemdecl} \begin{itemdescr} @@ -405,7 +429,7 @@ \pnum \returns -\tcode{equal(a.begin(), a.end(), b.begin(), b.end())} +\tcode{equal(c.begin(), c.end(), b.begin(), b.end())} \begin{note} The algorithm \tcode{equal} is defined in \ref{alg.equal}. @@ -413,7 +437,7 @@ \pnum \complexity -Constant if \tcode{a.size() != b.size()}, linear otherwise. +Constant if \tcode{c.size() != b.size()}, linear otherwise. \pnum \remarks @@ -422,28 +446,28 @@ \indexcont{operator"!=}% \begin{itemdecl} -a != b +c != b \end{itemdecl} \begin{itemdescr} \pnum \effects -Equivalent to \tcode{!(a == b)}. +Equivalent to \tcode{!(c == b)}. \end{itemdescr} \indexcont{swap}% \begin{itemdecl} -a.swap(b) +t.swap(s) \end{itemdecl} \begin{itemdescr} \pnum \result -\keyword{void} +\keyword{void}. \pnum \effects -Exchanges the contents of \tcode{a} and \tcode{b}. +Exchanges the contents of \tcode{t} and \tcode{s}. \pnum \complexity @@ -451,37 +475,18 @@ \end{itemdescr} \begin{itemdecl} -swap(a, b) +swap(t, s) \end{itemdecl} \begin{itemdescr} \pnum \effects -Equivalent to \tcode{a.swap(b)}. -\end{itemdescr} - -\indexcont{operator=}% -\begin{itemdecl} -r = a -\end{itemdecl} - -\begin{itemdescr} -\pnum -\result -\tcode{X\&}. - -\pnum -\ensures -\tcode{r == a}. - -\pnum -\complexity -Linear. +Equivalent to \tcode{t.swap(s)}. \end{itemdescr} \indexcont{size}% \begin{itemdecl} -a.size() +c.size() \end{itemdecl} \begin{itemdescr} @@ -491,7 +496,7 @@ \pnum \returns -\tcode{distance(a.begin(), a.end())}, +\tcode{distance(c.begin(), c.end())}, i.e. the number of elements in the container. \pnum @@ -506,7 +511,7 @@ \indexcont{max_size}% \begin{itemdecl} -a.max_size() +c.max_size() \end{itemdecl} \begin{itemdescr} @@ -525,7 +530,7 @@ \indexcont{empty}% \begin{itemdecl} -a.empty() +c.empty() \end{itemdecl} \begin{itemdescr} @@ -535,7 +540,7 @@ \pnum \returns -\tcode{a.begin() == a.end()} +\tcode{c.begin() == c.end()} \pnum \complexity @@ -543,7 +548,7 @@ \pnum \remarks -If the container is empty, then \tcode{a.empty()} is true. +If the container is empty, then \tcode{c.empty()} is \tcode{true}. \end{itemdescr} \pnum From a15360a143227abc385294df5357e7e4bf5ac55b Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 13:02:46 -0800 Subject: [PATCH 06/44] LWG3177 Limit permission to specialize variable templates to program-defined types --- source/lib-intro.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index f8f7ee7823..f560613bdd 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -2818,6 +2818,10 @@ if it declares an explicit or partial specialization of any standard library variable template, except where explicitly permitted by the specification of that variable template. +\begin{note} +The requirements on an explicit or partial specialization +are stated by each variable template that grants such permission. +\end{note} \pnum The behavior of a \Cpp{} program is undefined if it declares From 350b3d9a0a626cbcfd8ede51c6aae3173701c576 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 13:53:44 -0800 Subject: [PATCH 07/44] LWG3545 std::pointer_traits should be SFINAE-friendly --- source/memory.tex | 57 ++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 13 deletions(-) diff --git a/source/memory.tex b/source/memory.tex index 6ada84d1dd..5e86fb6b3d 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -594,13 +594,7 @@ \begin{codeblock} namespace std { template struct pointer_traits { - using pointer = Ptr; - using element_type = @\seebelow@; - using difference_type = @\seebelow@; - - template using rebind = @\seebelow@; - - static pointer pointer_to(@\seebelow@ r); + @\seebelow@; }; template struct pointer_traits { @@ -617,6 +611,46 @@ \rSec3[pointer.traits.types]{Member types} +\pnum +The definitions in this subclause make use of +the following exposition-only class template and concept: +\begin{codeblock} +template +struct @\exposid{ptr-traits-elem}@ // \expos +{ }; + +template requires requires { typename T::element_type; } +struct @\exposid{ptr-traits-elem}@ +{ using type = typename T::element_type; }; + +template class SomePointer, class T, class... Args> + requires (!requires { typename SomePointer::element_type; }) +struct @\exposid{ptr-traits-elem}@> +{ using type = T; }; + +template + concept @\defexposconcept{has-elem-type}@ = // \expos + requires { typename @\exposid{ptr-traits-elem}@::type; } +\end{codeblock} + +\pnum +If \tcode{Ptr} satisfies \exposconcept{has-elem-type}, +a specialization \tcode{pointer_traits} +generated from the \tcode{pointer_traits} primary template +has the following members +as well as those described in~\ref{pointer.traits.functions}; +otherwise, such a specialization has no members by any of those names. + +\indexlibrarymember{pointer}{pointer_traits}% +\begin{itemdecl} +using pointer = @\seebelow@; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\ctype \tcode{Ptr}. +\end{itemdescr} + \indexlibrarymember{element_type}{pointer_traits}% \begin{itemdecl} using element_type = @\seebelow@; @@ -624,12 +658,7 @@ \begin{itemdescr} \pnum -\ctype \tcode{Ptr::element_type} if -the \grammarterm{qualified-id} \tcode{Ptr::element_type} is valid and denotes a -type\iref{temp.deduct}; otherwise, \tcode{T} if -\tcode{Ptr} is a class template instantiation of the form \tcode{SomePointer}, -where \tcode{Args} is zero or more type arguments; otherwise, the specialization is -ill-formed. +\ctype \tcode{typename \exposid{ptr-traits-elem}::type}. \end{itemdescr} \indexlibrarymember{difference_type}{pointer_traits}% @@ -697,6 +726,8 @@ \pnum Specializations of \tcode{pointer_traits} may define the member declared in this subclause to customize the behavior of the standard library. +A specialization generated from the \tcode{pointer_traits} primary template +has no member by this name. \indexlibrarymember{to_address}{pointer_traits}% \begin{itemdecl} From 43ee8790d7f18128adcea54b948cc6db3588648d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 13:57:22 -0800 Subject: [PATCH 08/44] LWG3597 Unsigned integer types don't model advanceable --- source/ranges.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/ranges.tex b/source/ranges.tex index f676751720..31ec7a4d5a 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -2800,6 +2800,8 @@ \expects \tcode{Bound} denotes \tcode{unreachable_sentinel_t} or \tcode{Bound()} is reachable from \tcode{value}. +When \tcode{W} and \tcode{Bound} model \libconcept{totally_ordered_with}, +then \tcode{bool(value <= Bound())} is \tcode{true}. \pnum \effects From cfa1614d47dfede8d9fc0d4d81b93a5602a95ca2 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 14:08:03 -0800 Subject: [PATCH 09/44] LWG3600 Making istream_iterator copy constructor trivial is an ABI break --- source/iterators.tex | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index cf6b9b8374..52f9c9544e 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -6466,7 +6466,7 @@ constexpr istream_iterator(); constexpr istream_iterator(default_sentinel_t); istream_iterator(istream_type& s); - istream_iterator(const istream_iterator& x) = default; + constexpr istream_iterator(const istream_iterator& x) noexcept(@\seebelow@); ~istream_iterator() = default; istream_iterator& operator=(const istream_iterator&) = default; @@ -6529,18 +6529,22 @@ \indexlibraryctor{istream_iterator}% \begin{itemdecl} -istream_iterator(const istream_iterator& x) = default; +constexpr istream_iterator(const istream_iterator& x) noexcept(@\seebelow@); \end{itemdecl} \begin{itemdescr} \pnum -\ensures -\tcode{in_stream == x.in_stream} is \tcode{true}. +\effects +Initializes \tcode{in_stream} with \tcode{x.in_stream} and +initializes \tcode{value} with \tcode{x.value}. \pnum \remarks -If \tcode{is_trivially_copy_constructible_v} is \tcode{true}, -then this constructor is trivial. +An invocation of this constructor may be used in a core constant expression +if and only if the initialization of \tcode{value} from \tcode{x.value} +is a constant subexpression\iref{defns.const.subexpr}. +The exception specification is equivalent to +\tcode{is_nothrow_copy_constructible_v}. \end{itemdescr} \indexlibrarydtor{istream_iterator}% From 72afe68b91f35ab08b8474ea258cfd9d045f42d0 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 14:32:18 -0800 Subject: [PATCH 10/44] LWG3629 make_error_code and make_error_condition are customization points --- source/diagnostics.tex | 52 +++++++++++++++++++++++++++++------------- source/lib-intro.tex | 9 ++++++-- 2 files changed, 43 insertions(+), 18 deletions(-) diff --git a/source/diagnostics.tex b/source/diagnostics.tex index b75be934c1..b9398520d0 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -1122,8 +1122,9 @@ \begin{itemdescr} \pnum -\ensures -\tcode{val_ == 0} and \tcode{cat_ == \&system_category()}. +\effects +Initializes \tcode{val_} with \tcode{0} +and \tcode{cat_} with \tcode{\&system_category()}. \end{itemdescr} \indexlibraryctor{error_code}% @@ -1133,8 +1134,9 @@ \begin{itemdescr} \pnum -\ensures -\tcode{val_ == val} and \tcode{cat_ == \&cat}. +\effects +Initializes \tcode{val_} with \tcode{val} +and \tcode{cat_} with \tcode{\&cat}. \end{itemdescr} \indexlibraryctor{error_code}% @@ -1149,8 +1151,12 @@ \tcode{is_error_code_enum_v} is \tcode{true}. \pnum -\ensures -\tcode{*this == make_error_code(e)}. +\effects +Equivalent to: +\begin{codeblock} +error_code ec = make_error_code(e); +assign(ec.value(), ec.category()); +\end{codeblock} \end{itemdescr} \rSec3[syserr.errcode.modifiers]{Modifiers} @@ -1178,8 +1184,12 @@ \tcode{is_error_code_enum_v} is \tcode{true}. \pnum -\ensures -\tcode{*this == make_error_code(e)}. +\effects +Equivalent to: +\begin{codeblock} +error_code ec = make_error_code(e); +assign(ec.value(), ec.category()); +\end{codeblock} \pnum \returns @@ -1332,8 +1342,9 @@ \begin{itemdescr} \pnum -\ensures -\tcode{val_ == 0} and \tcode{cat_ == \&generic_category()}. +\effects +Initializes \tcode{val_} with \tcode{0} +and \tcode{cat_} with \tcode{\&generic_category()}. \end{itemdescr} \indexlibraryctor{error_condition}% @@ -1343,8 +1354,9 @@ \begin{itemdescr} \pnum -\ensures -\tcode{val_ == val} and \tcode{cat_ == \&cat}. +\effects +Initializes \tcode{val_} with \tcode{val} +and \tcode{cat_} with \tcode{\&cat}. \end{itemdescr} \indexlibraryctor{error_condition}% @@ -1359,8 +1371,12 @@ \tcode{is_error_condition_enum_v} is \tcode{true}. \pnum -\ensures -\tcode{*this == make_error_condition(e)}. +\effects +Equivalent to: +\begin{codeblock} +error_condition ec = make_error_condition(e); +assign(ec.value(), ec.category()); +\end{codeblock} \end{itemdescr} @@ -1389,8 +1405,12 @@ \tcode{is_error_condition_enum_v} is \tcode{true}. \pnum -\ensures -\tcode{*this == make_error_condition(e)}. +\effects +Equivalent to: +\begin{codeblock} +error_condition ec = make_error_condition(e); +assign(ec.value(), ec.category()); +\end{codeblock} \pnum \returns diff --git a/source/lib-intro.tex b/source/lib-intro.tex index f560613bdd..5fc5814457 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1024,8 +1024,9 @@ \end{footnote} \pnum -Whenever an unqualified name other than \tcode{swap} is used -in the specification of a declaration \tcode{D} +Whenever an unqualified name other than +\tcode{swap}, \tcode{make_error_code}, or \tcode{make_error_condition} +is used in the specification of a declaration \tcode{D} in \ref{\firstlibchapter} through \ref{\lastlibchapter} or \ref{depr}, its meaning is established as-if by performing unqualified name lookup\iref{basic.lookup.unqual} @@ -1046,6 +1047,10 @@ The meaning of the unqualified name \tcode{swap} is established in an overload resolution context for swappable values\iref{swappable.requirements}. +The meanings of the unqualified names +\tcode{make_error_code} and \tcode{make_error_condition} are established +as-if by performing argument-dependent lookup\iref{basic.lookup.argdep}. + \rSec3[headers]{Headers} From e64a5fbbd3e33f0be24d20144854d94708a9b8eb Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 14:36:53 -0800 Subject: [PATCH 11/44] LWG3646 std::ranges::view_interface::size returns a signed type --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 31ec7a4d5a..43ccaf8f5f 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1726,11 +1726,11 @@ constexpr auto size() requires @\libconcept{forward_range}@ && @\libconcept{sized_sentinel_for}@, iterator_t> { - return ranges::end(@\exposid{derived}@()) - ranges::begin(@\exposid{derived}@()); + return @\exposid{to-unsigned-like}@(ranges::end(@\exposid{derived}@()) - ranges::begin(@\exposid{derived}@())); } constexpr auto size() const requires @\libconcept{forward_range}@ && @\libconcept{sized_sentinel_for}@, iterator_t> { - return ranges::end(@\exposid{derived}@()) - ranges::begin(@\exposid{derived}@()); + return @\exposid{to-unsigned-like}@(ranges::end(@\exposid{derived}@()) - ranges::begin(@\exposid{derived}@())); } constexpr decltype(auto) front() requires @\libconcept{forward_range}@; From 5001d5d3c101df0390ae8170590bcc60463e9aea Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 14:48:53 -0800 Subject: [PATCH 12/44] LWG3677 Is a cv-qualified pair specially handled in uses-allocator construction? --- source/memory.tex | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/source/memory.tex b/source/memory.tex index 5e86fb6b3d..7bb0f232dc 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -1043,18 +1043,18 @@ \begin{itemdescr} \pnum \constraints -\tcode{T} is not a specialization of \tcode{pair}. +\tcode{remove_cv_t} is not a specialization of \tcode{pair}. \pnum \returns A \tcode{tuple} value determined as follows: \begin{itemize} \item - If \tcode{uses_allocator_v} is \tcode{false} and - \tcode{is_constructible_v} is \tcode{true}, + If \tcode{uses_allocator_v, Alloc>} is \tcode{false} and + \tcode{is_constructible_v} is \tcode{true}, return \tcode{forward_as_tuple(std::forward(args)...)}. \item - Otherwise, if \tcode{uses_allocator_v} is \tcode{true} and + Otherwise, if \tcode{uses_allocator_v, Alloc>} is \tcode{true} and \tcode{is_constructible_v} is \tcode{true}, return @@ -1063,7 +1063,7 @@ allocator_arg, alloc, std::forward(args)...) \end{codeblock} \item - Otherwise, if \tcode{uses_allocator_v} is \tcode{true} and + Otherwise, if \tcode{uses_allocator_v, Alloc>} is \tcode{true} and \tcode{is_constructible_v} is \tcode{true}, return \tcode{forward_as_tuple(std::forward(args)..., alloc)}. \item @@ -1084,13 +1084,17 @@ \end{itemdecl} \begin{itemdescr} +\pnum +Let \tcode{T1} be \tcode{T::first_type}. +Let \tcode{T2} be \tcode{T::second_type}. + \pnum \constraints -\tcode{T} is a specialization of \tcode{pair}. +\tcode{remove_cv_t} is a specialization of \tcode{pair}. \pnum \effects -For \tcode{T} specified as \tcode{pair}, equivalent to: +Equivalent to: \begin{codeblock} return make_tuple( piecewise_construct, @@ -1114,7 +1118,7 @@ \begin{itemdescr} \pnum \constraints -\tcode{T} is a specialization of \tcode{pair}. +\tcode{remove_cv_t} is a specialization of \tcode{pair}. \pnum \effects @@ -1135,7 +1139,7 @@ \begin{itemdescr} \pnum \constraints -\tcode{T} is a specialization of \tcode{pair}. +\tcode{remove_cv_t} is a specialization of \tcode{pair}. \pnum \effects @@ -1160,7 +1164,7 @@ \begin{itemdescr} \pnum \constraints -\tcode{T} is a specialization of \tcode{pair}. +\tcode{remove_cv_t} is a specialization of \tcode{pair}. \pnum \effects @@ -1185,7 +1189,7 @@ \begin{itemdescr} \pnum \constraints -\tcode{T} is a specialization of \tcode{pair}. +\tcode{remove_cv_t} is a specialization of \tcode{pair}. \pnum \effects @@ -1213,7 +1217,7 @@ \pnum \constraints -\tcode{T} is a specialization of \tcode{pair}, and +\tcode{remove_cv_t} is a specialization of \tcode{pair}, and the expression \tcode{\exposid{FUN}(u)} is not well-formed when considered as an unevaluated operand. From 2b33e1464d02da5554d8c0fb1acbe16784fe07eb Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 15:00:50 -0800 Subject: [PATCH 13/44] LWG3732 prepend_range and append_range can't be amortized constant time --- source/containers.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 7b67e5bd7d..f34b7695ae 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -1826,7 +1826,8 @@ \pnum The following operations are provided for some types of sequence containers but not others. -An implementation shall implement them so as to take amortized constant time. +Operations other than \tcode{prepend_range} and \tcode{append_range} +are implemented so as to take amortized constant time. \begin{itemdecl} a.front() From ca38a0a1020a8198428861dacffe0828bb388f57 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 15:10:21 -0800 Subject: [PATCH 14/44] LWG3736 move_iterator missing disable_sized_sentinel_for specialization --- source/iterators.tex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source/iterators.tex b/source/iterators.tex index 52f9c9544e..e1183ae0a5 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -402,6 +402,11 @@ template constexpr move_iterator make_move_iterator(Iterator i); // freestanding + template + requires (!@\libconcept{sized_sentinel_for}@) + inline constexpr bool disable_sized_sentinel_for, // freestanding + move_iterator> = true; + template<@\libconcept{semiregular}@ S> class move_sentinel; // freestanding // \ref{iterators.common}, common iterators From 3617d8340e31fd9c63087745efb81c633550304f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 15:12:44 -0800 Subject: [PATCH 15/44] LWG3738 Missing preconditions for take_view constructor --- source/ranges.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/ranges.tex b/source/ranges.tex index 43ccaf8f5f..e022a47fb3 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -5806,6 +5806,10 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\expects +\tcode{count >= 0} is \tcode{true}. + \pnum \effects Initializes \exposid{base_} with \tcode{std::move(base)} and From cb86a18ec7926dc928afb1b0e603cd7da5d7418e Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 15:17:32 -0800 Subject: [PATCH 16/44] LWG3743 ranges::to's reserve may be ill-formed --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index e022a47fb3..cbb30fb2e9 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -2338,7 +2338,7 @@ \begin{codeblock} C c(std::forward(args)...); if constexpr (@\libconcept{sized_range}@ && @\exposid{reservable-container}@) - c.reserve(ranges::size(r)); + c.reserve(static_cast>(ranges::size(r))); ranges::copy(r, @\exposid{container-inserter}@>(c)); \end{codeblock} \end{itemize} From 2014b746676f0df26e4770b012fdb3b0b428cd4e Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 15:28:56 -0800 Subject: [PATCH 17/44] LWG3745 std::atomic_wait and its friends lack noexcept --- source/threads.tex | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 55dbadb167..d0ddcfb1ce 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -2222,24 +2222,25 @@ memory_order) noexcept; template - void atomic_wait(const volatile atomic*, typename atomic::value_type); // freestanding + void atomic_wait(const volatile atomic*, // freestanding + typename atomic::value_type) noexcept; template - void atomic_wait(const atomic*, typename atomic::value_type); // freestanding + void atomic_wait(const atomic*, typename atomic::value_type) noexcept; // freestanding template void atomic_wait_explicit(const volatile atomic*, // freestanding typename atomic::value_type, - memory_order); + memory_order) noexcept; template void atomic_wait_explicit(const atomic*, typename atomic::value_type, // freestanding - memory_order); + memory_order) noexcept; template - void atomic_notify_one(volatile atomic*); // freestanding + void atomic_notify_one(volatile atomic*) noexcept; // freestanding template - void atomic_notify_one(atomic*); // freestanding + void atomic_notify_one(atomic*) noexcept; // freestanding template - void atomic_notify_all(volatile atomic*); // freestanding + void atomic_notify_all(volatile atomic*) noexcept; // freestanding template - void atomic_notify_all(atomic*); // freestanding + void atomic_notify_all(atomic*) noexcept; // freestanding // \ref{atomics.alias}, type aliases using atomic_bool = atomic; // freestanding From 3a129f21a31f248089460280c5aba636559689d4 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 15:57:56 -0800 Subject: [PATCH 18/44] LWG3746 optional's spaceship with U with a type derived from optional causes infinite constraint meta-recursion --- source/utilities.tex | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index e5b0f8b081..9b7bba4b0c 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -3131,9 +3131,9 @@ class optional; template - constexpr bool @\exposid{is-optional}@ = false; // \expos - template - constexpr bool @\exposid{is-optional}@> = true; // \expos + concept @\defexposconcept{is-derived-from-optional}@ = requires(const T& t) { // \expos + [](const optional&){ }(t); + }; // \ref{optional.nullopt}, no-value state indicator struct nullopt_t{@\seebelow@}; @@ -3177,7 +3177,8 @@ template constexpr bool operator<=(const T&, const optional&); template constexpr bool operator>=(const optional&, const U&); template constexpr bool operator>=(const T&, const optional&); - template requires (!@\exposid{is-optional}@) && @\libconcept{three_way_comparable_with}@ + template + requires (!@\exposconcept{is-derived-from-optional}@) && @\libconcept{three_way_comparable_with}@ constexpr compare_three_way_result_t operator<=>(const optional&, const U&); @@ -4748,7 +4749,8 @@ \indexlibrarymember{operator<=>}{optional}% \begin{itemdecl} -template requires (!@\exposid{is-optional}@) && @\libconcept{three_way_comparable_with}@ +template + requires (!@\exposconcept{is-derived-from-optional}@) && @\libconcept{three_way_comparable_with}@ constexpr compare_three_way_result_t operator<=>(const optional& x, const U& v); \end{itemdecl} From 12fb78311bfe8abb96490abc16db5c308a6caf35 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 16:23:03 -0800 Subject: [PATCH 19/44] LWG3747 ranges::uninitialized_copy_n, ranges::uninitialized_move_n, and ranges::destroy_n should use std::move --- source/algorithms.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 1b47c0b20b..0c6389b14e 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -11127,7 +11127,7 @@ \effects Equivalent to: \begin{codeblock} -auto t = uninitialized_copy(counted_iterator(ifirst, n), +auto t = uninitialized_copy(counted_iterator(std::move(ifirst), n), default_sentinel, ofirst, olast); return {std::move(t.in).base(), t.out}; \end{codeblock} @@ -11237,7 +11237,7 @@ \effects Equivalent to: \begin{codeblock} -auto t = uninitialized_move(counted_iterator(ifirst, n), +auto t = uninitialized_move(counted_iterator(std::move(ifirst), n), default_sentinel, ofirst, olast); return {std::move(t.in).base(), t.out}; \end{codeblock} @@ -11448,7 +11448,7 @@ \effects Equivalent to: \begin{codeblock} -return destroy(counted_iterator(first, n), default_sentinel).base(); +return destroy(counted_iterator(std::move(first), n), default_sentinel).base(); \end{codeblock} \end{itemdescr} From e80eb14e6f3d1d674089a7b8e39ab54d8c3951e0 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 16:26:01 -0800 Subject: [PATCH 20/44] LWG3750 Too many papers bump __cpp_lib_format --- source/support.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/support.tex b/source/support.tex index 3cba171dd8..86a01b6db7 100644 --- a/source/support.tex +++ b/source/support.tex @@ -624,6 +624,7 @@ #define @\defnlibxname{cpp_lib_find_last}@ 202207L // also in \libheader{algorithm} #define @\defnlibxname{cpp_lib_flat_map}@ 202207L // also in \libheader{flat_map} #define @\defnlibxname{cpp_lib_format}@ 202207L // also in \libheader{format} +#define @\defnlibxname{cpp_lib_format_ranges}@ 202207L // also in \libheader{format} #define @\defnlibxname{cpp_lib_forward_like}@ 202207L // also in \libheader{utility} #define @\defnlibxname{cpp_lib_gcd_lcm}@ 201606L // also in \libheader{numeric} #define @\defnlibxname{cpp_lib_generator}@ 202207L // also in \libheader{generator} From 91b26d3873bd85b124a68b6574a416cebc2e3f7f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 16:27:19 -0800 Subject: [PATCH 21/44] LWG3751 Missing feature macro for flat_set --- source/support.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/support.tex b/source/support.tex index 86a01b6db7..924d9b45f2 100644 --- a/source/support.tex +++ b/source/support.tex @@ -623,6 +623,7 @@ #define @\defnlibxname{cpp_lib_filesystem}@ 201703L // also in \libheader{filesystem} #define @\defnlibxname{cpp_lib_find_last}@ 202207L // also in \libheader{algorithm} #define @\defnlibxname{cpp_lib_flat_map}@ 202207L // also in \libheader{flat_map} +#define @\defnlibxname{cpp_lib_flat_set}@ 202207L // also in \libheader{flat_set} #define @\defnlibxname{cpp_lib_format}@ 202207L // also in \libheader{format} #define @\defnlibxname{cpp_lib_format_ranges}@ 202207L // also in \libheader{format} #define @\defnlibxname{cpp_lib_forward_like}@ 202207L // also in \libheader{utility} From bdf9fd3ff9dab1c52813eef1aa6bd80811c9afed Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 16:29:03 -0800 Subject: [PATCH 22/44] LWG3755 tuple-for-each can call user-defined operator, --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index cbb30fb2e9..32259f7195 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -4275,7 +4275,7 @@ template constexpr void @\exposid{tuple-for-each}@(F&& f, Tuple&& t) { // \expos apply([&](Ts&&... elements) { - (invoke(f, std::forward(elements)), ...); + (static_cast(invoke(f, std::forward(elements))), ...); }, std::forward(t)); } } From b69d4417b38230b1e3081602b44e193a21ba7a4a Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 16:33:51 -0800 Subject: [PATCH 23/44] LWG3757 What's the effect of std::forward_like(x)? --- source/utilities.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/utilities.tex b/source/utilities.tex index 9b7bba4b0c..97c2ba5f30 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -367,6 +367,10 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\mandates +\tcode{T} is a referenceable type\iref{defns.referenceable}. + \pnum \begin{itemize} \item From 96902274e0b5ea5da7e277a9ccc213ff4993d5e1 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 16:35:27 -0800 Subject: [PATCH 24/44] LWG3759 ranges::rotate_copy should use std::move --- source/algorithms.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 0c6389b14e..ce678c8680 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -6293,7 +6293,7 @@ \effects Equivalent to: \begin{codeblock} -return ranges::rotate_copy(ranges::begin(r), middle, ranges::end(r), result); +return ranges::rotate_copy(ranges::begin(r), middle, ranges::end(r), std::move(result)); \end{codeblock} \end{itemdescr} From 387e3f596cfe5db9ff1bc3891eddcdd6ca47bb96 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 18:58:35 -0800 Subject: [PATCH 25/44] LWG3760 cartesian_product_view::iterator's parent_ is never valid [range.cartesian.iterator] Use \exposidnc on exposids when followed by an \expos comment. --- source/ranges.tex | 35 ++++++++++++++++++++++------------- 1 file changed, 22 insertions(+), 13 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 32259f7195..f83cdc6140 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -14345,7 +14345,9 @@ \pnum \effects Equivalent to: -\tcode{return \exposid{iterator}(\exposid{tuple-transform}(ranges::begin, \exposid{bases_}));} +\begin{codeblock} +return @\exposid{iterator}@(*this, @\exposid{tuple-transform}@(ranges::begin, @\exposid{bases_}@)); +\end{codeblock} \end{itemdescr} \begin{itemdecl} @@ -14357,7 +14359,9 @@ \pnum \effects Equivalent to: -\tcode{return \exposid{iterator}(\exposid{tuple-transform}(ranges::begin, \exposid{bases_}));} +\begin{codeblock} +return @\exposid{iterator}@(*this, @\exposid{tuple-transform}@(ranges::begin, @\exposid{bases_}@)); +\end{codeblock} \end{itemdescr} \begin{itemdecl} @@ -14391,7 +14395,7 @@ \effects Equivalent to: \begin{codeblock} -@\exposid{iterator}@<@\exposid{is-const}@> it(@\exposid{tuple-transform}@( +@\exposid{iterator}@<@\exposid{is-const}@> it(*this, @\exposid{tuple-transform}@( [](auto& rng){ return @\exposid{begin-or-first-end}@(rng); }, @\exposid{bases_}@)); return it; \end{codeblock} @@ -14506,21 +14510,22 @@ @\libconcept{indirectly_swappable}@>>); private: - @\exposid{maybe-const}@* @\exposid{parent_}@ = nullptr; // \expos + using @\exposidnc{Parent}@ = @\exposidnc{maybe-const}@; // \expos + @\exposidnc{Parent}@* @\exposidnc{parent_}@ = nullptr; // \expos tuple>, - iterator_t<@\exposid{maybe-const}@>...> @\exposid{current_}@; // \expos + iterator_t<@\exposidnc{maybe-const}@>...> @\exposidnc{current_}@; // \expos template - constexpr void @\exposid{next}@(); // \expos + constexpr void @\exposidnc{next}@(); // \expos template - constexpr void @\exposid{prev}@(); // \expos + constexpr void @\exposidnc{prev}@(); // \expos template - constexpr difference_type @\exposid{distance-from}@(Tuple t); // \expos + constexpr difference_type @\exposidnc{distance-from}@(Tuple t); // \expos - constexpr explicit @\exposid{iterator}@(tuple>, - iterator_t<@\exposid{maybe-const}@>...> current); // \expos + constexpr @\exposid{iterator}@(@\exposid{Parent}@& parent, tuple>, + iterator_t<@\exposidnc{maybe-const}@>...> current); // \expos }; } \end{codeblock} @@ -14633,14 +14638,16 @@ \end{itemdescr} \begin{itemdecl} -constexpr explicit @\exposid{iterator}@(tuple>, +constexpr @\exposid{iterator}@(@\exposid{Parent}@& parent, tuple>, iterator_t<@\exposid{maybe-const}@>...> current); \end{itemdecl} \begin{itemdescr} \pnum \effects -Initializes \exposid{current_} with \tcode{std::move(current)}. +Initializes +\exposid{parent_} with \tcode{addressof(parent)} and +\exposid{current_} with \tcode{std::move(current)}. \end{itemdescr} \begin{itemdecl} @@ -14652,7 +14659,9 @@ \begin{itemdescr} \pnum \effects -Initializes \exposid{current_} with \tcode{std::move(i.\exposid{current_})}. +Initializes +\exposid{parent_} with \tcode{i.\exposid{parent_}} and +\exposid{current_} with \tcode{std::move(i.\exposid{current_})}. \end{itemdescr} \begin{itemdecl} From 6a3a7a3b5a755dc57c88261e1be8e7e1ecd52ce9 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 20:48:21 -0800 Subject: [PATCH 26/44] LWG3761 cartesian_product_view::iterator::operator- should pass by reference --- source/ranges.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index f83cdc6140..3ef50e15b6 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -14498,9 +14498,9 @@ friend constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) requires @\exposconcept{cartesian-is-sized-sentinel}@; - friend constexpr difference_type operator-(@\exposid{iterator}@ i, default_sentinel_t) + friend constexpr difference_type operator-(const @\exposid{iterator}@& i, default_sentinel_t) requires @\exposconcept{cartesian-is-sized-sentinel}@; - friend constexpr difference_type operator-(default_sentinel_t, @\exposid{iterator}@ i) + friend constexpr difference_type operator-(default_sentinel_t, const @\exposid{iterator}@& i) requires @\exposconcept{cartesian-is-sized-sentinel}@; friend constexpr auto iter_move(const @\exposid{iterator}@& i) noexcept(@\seebelow@); @@ -14522,7 +14522,7 @@ constexpr void @\exposidnc{prev}@(); // \expos template - constexpr difference_type @\exposidnc{distance-from}@(Tuple t); // \expos + constexpr difference_type @\exposidnc{distance-from}@(const Tuple& t) const; // \expos constexpr @\exposid{iterator}@(@\exposid{Parent}@& parent, tuple>, iterator_t<@\exposidnc{maybe-const}@>...> current); // \expos @@ -14608,7 +14608,7 @@ \begin{itemdecl} template - constexpr difference_type @\exposid{distance-from}@(Tuple t); + constexpr difference_type @\exposid{distance-from}@(const Tuple& t) const; \end{itemdecl} \begin{itemdescr} @@ -14893,7 +14893,7 @@ \end{itemdescr} \begin{itemdecl} -friend constexpr difference_type operator-(@\exposid{iterator}@ i, default_sentinel_t) +friend constexpr difference_type operator-(const @\exposid{iterator}@& i, default_sentinel_t) requires @\exposconcept{cartesian-is-sized-sentinel}@; \end{itemdecl} @@ -14917,7 +14917,7 @@ \end{itemdescr} \begin{itemdecl} -friend constexpr difference_type operator-(default_sentinel_t s, @\exposid{iterator}@ i) +friend constexpr difference_type operator-(default_sentinel_t s, const @\exposid{iterator}@& i) requires @\exposconcept{cartesian-is-sized-sentinel}@; \end{itemdecl} From 89abc99495d7e945f6b352dd4ffacbe0e945c397 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 20:55:12 -0800 Subject: [PATCH 27/44] LWG3762 generator::iterator::operator== should pass by reference --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 3ef50e15b6..83fa5087ec 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -15525,7 +15525,7 @@ @\exposid{iterator}@& operator++(); void operator++(int); - friend bool operator==(@\exposid{iterator}@ i, default_sentinel_t); + friend bool operator==(const @\exposid{iterator}@& i, default_sentinel_t); private: coroutine_handle @\exposid{coroutine_}@; // \expos @@ -15613,7 +15613,7 @@ \indexlibrarymember{operator==}{generator::\exposid{iterator}}% \begin{itemdecl} -friend bool operator==(@\exposid{iterator}@ i, default_sentinel_t); +friend bool operator==(const @\exposid{iterator}@& i, default_sentinel_t); \end{itemdecl} \begin{itemdescr} From f70fe4410e7ba877895b7d20dfabbefdf4ff9b9a Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 20:59:52 -0800 Subject: [PATCH 28/44] LWG3764 reference_wrapper::operator() should propagate noexcept --- source/utilities.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 97c2ba5f30..f815f22eab 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -10188,7 +10188,8 @@ // \ref{refwrap.invoke}, invocation template - constexpr invoke_result_t operator()(ArgTypes&&...) const; + constexpr invoke_result_t operator()(ArgTypes&&...) const + noexcept(is_nothrow_invocable_v); }; template @@ -10297,7 +10298,7 @@ \begin{itemdecl} template constexpr invoke_result_t - operator()(ArgTypes&&... args) const; + operator()(ArgTypes&&... args) const noexcept(is_nothrow_invocable_v); \end{itemdecl} \begin{itemdescr} From d7ed9ee77a702fe68abca6b0a3707a72b4e898ac Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 21:07:50 -0800 Subject: [PATCH 29/44] LWG3765 const_sentinel should be constrained --- source/iterators.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index e1183ae0a5..de89d31340 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -342,7 +342,7 @@ concept @\exposconcept{constant-iterator}@ = @\seebelow@; // \expos template<@\libconcept{input_iterator}@ I> using const_iterator = @\seebelow@; // freestanding - template + template<@\libconcept{semiregular}@ S> using const_sentinel = @\seebelow@; // freestanding // \ref{const.iterators.iterator}, class template \tcode{basic_const_iterator} @@ -365,7 +365,7 @@ template<@\libconcept{input_iterator}@ I> constexpr const_iterator make_const_iterator(I it) { return it; } // freestanding - template + template<@\libconcept{semiregular}@ S> constexpr const_sentinel make_const_sentinel(S s) { return s; } // freestanding // \ref{move.iterators}, move iterators and sentinels @@ -4199,7 +4199,7 @@ \end{itemdescr} \begin{itemdecl} -template +template<@\libconcept{semiregular}@ S> using @\libglobal{const_sentinel}@ = @\seebelow@; \end{itemdecl} From 3045e51fae5705123622f81e050dec64368e22b4 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 21:13:17 -0800 Subject: [PATCH 30/44] LWG3770 const_sentinel_t is missing --- source/ranges.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/ranges.tex b/source/ranges.tex index 83fa5087ec..2367218c37 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -66,6 +66,8 @@ using sentinel_t = decltype(ranges::end(declval())); // freestanding template<@\libconcept{range}@ R> using const_iterator_t = const_iterator>; // freestanding + template<@\libconcept{range}@ R> + using const_sentinel_t = const_sentinel>; // freestanding template<@\libconcept{range}@ R> using range_difference_t = iter_difference_t>; // freestanding template<@\libconcept{sized_range}@ R> From c83caad348c97a3000877df8db813d23a07da56f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 21:16:21 -0800 Subject: [PATCH 31/44] LWG3773 views::zip_transform still requires F to be copy_constructible when empty pack --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 2367218c37..61b250fe1f 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -9995,7 +9995,7 @@ let \tcode{FD} be \tcode{decay_t}. \begin{itemize} \item -If \tcode{\libconcept{copy_constructible} \&\& +If \tcode{\libconcept{move_constructible} \&\& \libconcept{regular_invocable}} is \tcode{false}, or if \tcode{decay_t>} is not an object type, \tcode{views::zip_transform(F, Es...)} is ill-formed. From 60c60bb48da01db5276e02d8a254366bc98c16a8 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 21:18:13 -0800 Subject: [PATCH 32/44] LWG3774 should include --- source/containers.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/containers.tex b/source/containers.tex index f34b7695ae..3d02687b11 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -13297,6 +13297,7 @@ \indexheader{flat_set}% \begin{codeblock} +#include // see \ref{compare.syn} #include // see \ref{initializer.list.syn} namespace std { From 6b5633081d5aa029e404c7b53cc9f04002bfbd5a Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 21:45:26 -0800 Subject: [PATCH 33/44] LWG3775 Broken dependencies in the Cpp17Allocator requirements --- source/lib-intro.tex | 78 ++++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 5fc5814457..69e0869379 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -2047,11 +2047,11 @@ \begin{itemdescr} \pnum \mandates -\tcode{X::pointer} is convertible to \tcode{X::const_pointer}. +\tcode{XX::pointer} is convertible to \tcode{XX::const_pointer}. \pnum \remarks -Default: \tcode{pointer_traits::rebind} +Default: \tcode{pointer_traits::rebind} \end{itemdescr} \begin{itemdecl} @@ -2062,13 +2062,13 @@ \begin{itemdescr} \pnum \mandates -\tcode{X::pointer} is convertible to \tcode{X::void_pointer}. -\tcode{X::void_pointer} and \tcode{Y::void_pointer} are the same type. +\tcode{XX::pointer} is convertible to \tcode{XX::void_pointer}. +\tcode{XX::void_pointer} and \tcode{YY::void_pointer} are the same type. \pnum \remarks Default: -\tcode{pointer_traits::rebind} +\tcode{pointer_traits::rebind} \end{itemdescr} \begin{itemdecl} @@ -2079,15 +2079,15 @@ \begin{itemdescr} \pnum \mandates -\tcode{X::pointer}, \tcode{X::const_pointer}, and \tcode{X::void_pointer} -are convertible to \tcode{X::const_void_pointer}. -\tcode{X::const_void_pointer} and \tcode{Y::const_void_pointer} +\tcode{XX::pointer}, \tcode{XX::const_pointer}, and \tcode{XX::void_pointer} +are convertible to \tcode{XX::const_void_pointer}. +\tcode{XX::const_void_pointer} and \tcode{YY::const_void_pointer} are the same type. \pnum \remarks Default: -\tcode{pointer_traits::rebind} +\tcode{pointer_traits::rebind} \end{itemdescr} \begin{itemdecl} @@ -2113,7 +2113,7 @@ \pnum \remarks Default: -\tcode{make_unsigned_t} +\tcode{make_unsigned_t} \end{itemdescr} \begin{itemdecl} @@ -2129,7 +2129,7 @@ \pnum \remarks Default: -\tcode{pointer_traits::difference_type} +\tcode{pointer_traits::difference_type} \end{itemdescr} \begin{itemdecl} @@ -2144,7 +2144,7 @@ \pnum \ensures For all \tcode{U} (including \tcode{T}), -\tcode{Y::template rebind::other} is \tcode{X}. +\tcode{YY::rebind_alloc} is \tcode{X}. \pnum \remarks @@ -2230,41 +2230,41 @@ \end{itemdescr} \begin{itemdecl} -static_cast(w) +static_cast(w) \end{itemdecl} \begin{itemdescr} \pnum \result -\tcode{X::pointer} +\tcode{XX::pointer} \pnum \ensures -\tcode{static_cast(w) == p}. +\tcode{static_cast(w) == p}. \end{itemdescr} \begin{itemdecl} -static_cast(x) +static_cast(x) \end{itemdecl} \begin{itemdescr} \pnum \result -\tcode{X::const_pointer} +\tcode{XX::const_pointer} \pnum \ensures -\tcode{static_cast(x) == q}. +\tcode{static_cast(x) == q}. \end{itemdescr} \begin{itemdecl} -pointer_traits::pointer_to(r) +pointer_traits::pointer_to(r) \end{itemdecl} \begin{itemdescr} \pnum \result -\tcode{X::pointer} +\tcode{XX::pointer} \pnum \ensures @@ -2278,7 +2278,7 @@ \begin{itemdescr} \pnum \result -\tcode{X::pointer} +\tcode{XX::pointer} \pnum \effects @@ -2316,7 +2316,7 @@ \begin{itemdescr} \pnum \result -\tcode{X::pointer} +\tcode{XX::pointer} \pnum \effects @@ -2335,11 +2335,11 @@ \begin{itemdescr} \pnum \result -\tcode{allocation_result} +\tcode{allocation_result} \pnum \returns -\tcode{allocation_result\{ptr, count\}} +\tcode{allocation_result\{ptr, count\}} where \tcode{ptr} is memory allocated for an array of \tcode{count} \tcode{T} and such an object is created but array elements are not constructed, such that $\tcode{count} \geq \tcode{n}$. @@ -2397,11 +2397,11 @@ \begin{itemdescr} \pnum \result -\tcode{X::size_type} +\tcode{XX::size_type} \pnum \returns -The largest value that can meaningfully be passed to \tcode{X::allocate()}. +The largest value \tcode{n} that can meaningfully be passed to \tcode{a.allocate(n)}. \pnum \remarks @@ -2458,7 +2458,7 @@ \pnum \returns -\tcode{a == Y::rebind::other(b)}. +\tcode{a == YY::rebind_alloc(b)}. \end{itemdescr} \begin{itemdecl} @@ -2677,43 +2677,43 @@ \pnum An allocator type \tcode{X} shall meet the \oldconcept{CopyConstructible} requirements (\tref{cpp17.copyconstructible}). -The \tcode{X::pointer}, \tcode{X::const_pointer}, \tcode{X::void_pointer}, and -\tcode{X::const_void_pointer} types shall meet the +The \tcode{XX::pointer}, \tcode{XX::const_pointer}, \tcode{XX::void_pointer}, and +\tcode{XX::const_void_pointer} types shall meet the \oldconcept{Nullable\-Pointer} requirements (\tref{cpp17.nullablepointer}). No constructor, comparison operator function, copy operation, move operation, or swap operation on -these pointer types shall exit via an exception. \tcode{X::pointer} and \tcode{X::const_pointer} shall also +these pointer types shall exit via an exception. \tcode{XX::pointer} and \tcode{XX::const_pointer} shall also meet the requirements for a \oldconcept{RandomAccessIterator}\iref{random.access.iterators} and -the additional requirement that, when \tcode{a} and \tcode{(a + n)} are +the additional requirement that, when \tcode{p} and \tcode{(p + n)} are dereferenceable pointer values for some integral value \tcode{n}, \begin{codeblock} -addressof(*(a + n)) == addressof(*a) + n +addressof(*(p + n)) == addressof(*p) + n \end{codeblock} is \tcode{true}. \pnum Let \tcode{x1} and \tcode{x2} denote objects of (possibly different) types -\tcode{X::void_pointer}, \tcode{X::const_void_pointer}, \tcode{X::pointer}, -or \tcode{X::const_pointer}. Then, \tcode{x1} and \tcode{x2} are +\tcode{XX::void_pointer}, \tcode{XX::const_void_pointer}, \tcode{XX::pointer}, +or \tcode{XX::const_pointer}. Then, \tcode{x1} and \tcode{x2} are \defn{equivalently-valued} pointer values, if and only if both \tcode{x1} and \tcode{x2} can be explicitly converted to the two corresponding objects \tcode{px1} and \tcode{px2} -of type \tcode{X::const_pointer}, using a sequence of \keyword{static_cast}s +of type \tcode{XX::const_pointer}, using a sequence of \keyword{static_cast}s using only these four types, and the expression \tcode{px1 == px2} evaluates to \tcode{true}. \pnum -Let \tcode{w1} and \tcode{w2} denote objects of type \tcode{X::void_pointer}. +Let \tcode{w1} and \tcode{w2} denote objects of type \tcode{XX::void_pointer}. Then for the expressions \begin{codeblock} w1 == w2 w1 != w2 \end{codeblock} either or both objects may be replaced by an equivalently-valued object of type -\tcode{X::const_void_pointer} with no change in semantics. +\tcode{XX::const_void_pointer} with no change in semantics. \pnum -Let \tcode{p1} and \tcode{p2} denote objects of type \tcode{X::pointer}. +Let \tcode{p1} and \tcode{p2} denote objects of type \tcode{XX::pointer}. Then for the expressions \begin{codeblock} p1 == p2 @@ -2725,7 +2725,7 @@ p1 - p2 \end{codeblock} either or both objects may be replaced by an equivalently-valued object of type -\tcode{X::const_pointer} with no change in semantics. +\tcode{XX::const_pointer} with no change in semantics. \pnum An allocator may constrain the types on which it can be instantiated and the From fc94532f86cbacf90ce54c5720823664b044e172 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 22:12:48 -0800 Subject: [PATCH 34/44] LWG3778 vector missing exception specifications --- source/containers.tex | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 3d02687b11..5c2e399ea2 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -9166,8 +9166,8 @@ }; // construct/copy/destroy - constexpr vector() : vector(Allocator()) { } - constexpr explicit vector(const Allocator&); + constexpr vector() noexcept(noexcept(Allocator())) : vector(Allocator()) { } + constexpr explicit vector(const Allocator&) noexcept; constexpr explicit vector(size_type n, const Allocator& = Allocator()); constexpr vector(size_type n, const bool& value, const Allocator& = Allocator()); template @@ -9175,13 +9175,15 @@ template<@\exposconcept{container-compatible-range}@ R> constexpr vector(from_range_t, R&& rg, const Allocator& = Allocator()); constexpr vector(const vector& x); - constexpr vector(vector&& x); + constexpr vector(vector&& x) noexcept; constexpr vector(const vector&, const type_identity_t&); constexpr vector(vector&&, const type_identity_t&); constexpr vector(initializer_list, const Allocator& = Allocator()); constexpr ~vector(); constexpr vector& operator=(const vector& x); - constexpr vector& operator=(vector&& x); + constexpr vector& operator=(vector&& x) + noexcept(allocator_traits::propagate_on_container_move_assignment::value || + allocator_traits::is_always_equal::value); constexpr vector& operator=(initializer_list); template constexpr void assign(InputIterator first, InputIterator last); @@ -9243,7 +9245,9 @@ constexpr iterator erase(const_iterator position); constexpr iterator erase(const_iterator first, const_iterator last); - constexpr void swap(vector&); + constexpr void swap(vector&) + noexcept(allocator_traits::propagate_on_container_swap::value || + allocator_traits::is_always_equal::value); static constexpr void swap(reference x, reference y) noexcept; constexpr void flip() noexcept; // flips all bits constexpr void clear() noexcept; From b660805376cda6d178e0426f1b2c3c2aa6a02a97 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 22:17:19 -0800 Subject: [PATCH 35/44] LWG3781 The exposition-only alias templates cont-key-type and cont-mapped-type should be removed --- source/containers.tex | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 5c2e399ea2..143eda4f32 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -13158,18 +13158,6 @@ defined in \ref{associative.general} may appear in deduction guides for container adaptors. -\pnum -The following exposition-only alias templates may appear in deduction guides -for container adaptors: -\begin{codeblock} -template - using @\exposid{cont-key-type}@ = // \expos - remove_const_t; -template - using @\exposid{cont-mapped-type}@ = // \expos - typename Container::value_type::second_type; -\end{codeblock} - \rSec2[queue.syn]{Header \tcode{} synopsis} \indexheader{queue} From 14dfafe0a959a8a69c525a84237952d60f52fbbf Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 22:21:51 -0800 Subject: [PATCH 36/44] LWG3782 Should declare ::lerp? --- source/support.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/support.tex b/source/support.tex index 924d9b45f2..635ea42d5c 100644 --- a/source/support.tex +++ b/source/support.tex @@ -6158,6 +6158,7 @@ header is placed within the global namespace scope, except for the functions described in \ref{sf.cmath}, +the \tcode{std::lerp} function overloads\iref{c.math.lerp}, the declaration of \tcode{std::byte}\iref{cstddef.syn}, and the functions and function templates described in \ref{support.types.byteops}. It is unspecified whether these names are first declared or defined within From ccc54fb20b15be879a921e45eff95bcd0e7b69cd Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 22:26:19 -0800 Subject: [PATCH 37/44] LWG3784 std.compat should not provide ::byte and its friends --- source/lib-intro.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 69e0869379..c7d62f3ce3 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1396,7 +1396,9 @@ additionally exports declarations in the global namespace corresponding to the declarations in namespace \tcode{std} that are provided by -the \Cpp{} headers for C library facilities~(\tref{headers.cpp.c}). +the \Cpp{} headers for C library facilities~(\tref{headers.cpp.c}), +except the explicitly excluded declarations +described in \ref{support.c.headers.other}. \pnum It is unspecified to which module a declaration in the standard library From 0077d295fa637c602965b679a116e8835fd873f3 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 22:32:11 -0800 Subject: [PATCH 38/44] LWG3785 ranges::to is over-constrained on the destination type being a range --- source/ranges.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 61b250fe1f..4222324f20 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -2300,7 +2300,8 @@ constructed from the elements of \tcode{r} in the following manner: \begin{itemize} \item -If \tcode{\libconcept{convertible_to}, range_value_t>} +If \tcode{C} does not satisfy \libconcept{input_range} or +\tcode{\libconcept{convertible_to}, range_value_t>} is \tcode{true}: \begin{itemize} \item From 75fdbc8f8c14c2bf66dd0247241c74465e5639b3 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 22:42:22 -0800 Subject: [PATCH 39/44] LWG3788 jthread::operator=(jthread&&) postconditions are unimplementable under self-assignment --- source/threads.tex | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index d0ddcfb1ce..dcc3ae6006 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -1756,19 +1756,18 @@ \begin{itemdescr} \pnum \effects -If \tcode{joinable()} is \tcode{true}, -calls \tcode{request_stop()} and then \tcode{join()}. -Assigns the state of \tcode{x} to \tcode{*this} +If \tcode{\&x == this} is \tcode{true}, there are no effects. +Otherwise, if \tcode{joinable()} is \tcode{true}, +calls \tcode{request_stop()} and then \tcode{join()}, +then assigns the state of \tcode{x} to \tcode{*this} and sets \tcode{x} to a default constructed state. \pnum \ensures -\tcode{x.get_id() == id()} -and \tcode{get_id()} returns the value of \tcode{x.get_id()} +\tcode{get_id()} returns the value of \tcode{x.get_id()} prior to the assignment. \tcode{ssource} has the value of \tcode{x.ssource} -prior to the assignment -and \tcode{x.ssource.stop_possible()} is \tcode{false}. +prior to the assignment. \pnum \returns From 26f99d40618a50a23cc43c7a63048614db61c8fa Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 22:49:13 -0800 Subject: [PATCH 40/44] LWG3792 __cpp_lib_constexpr_algorithms should also be defined in --- source/support.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/support.tex b/source/support.tex index 635ea42d5c..f7e00951ff 100644 --- a/source/support.tex +++ b/source/support.tex @@ -591,7 +591,7 @@ #define @\defnlibxname{cpp_lib_clamp}@ 201603L // also in \libheader{algorithm} #define @\defnlibxname{cpp_lib_complex_udls}@ 201309L // also in \libheader{complex} #define @\defnlibxname{cpp_lib_concepts}@ 202207L // also in \libheader{concepts}, \libheader{compare} -#define @\defnlibxname{cpp_lib_constexpr_algorithms}@ 201806L // also in \libheader{algorithm} +#define @\defnlibxname{cpp_lib_constexpr_algorithms}@ 201806L // also in \libheader{algorithm}, \libheader{utility} #define @\defnlibxname{cpp_lib_constexpr_bitset}@ 202202L // also in \libheader{bitset} #define @\defnlibxname{cpp_lib_constexpr_charconv}@ 202207L // also in \libheader{charconv} #define @\defnlibxname{cpp_lib_constexpr_cmath}@ 202202L // also in \libheader{cmath}, \libheader{cstdlib} From 9839456b7cc5f771dac2a85ff53bf2d15d54f484 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 23:43:21 -0800 Subject: [PATCH 41/44] LWG3795 Self-move-assignment of std::future and std::shared_future have unimplementable postconditions --- source/threads.tex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/threads.tex b/source/threads.tex index dcc3ae6006..c40a7c6511 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -10576,6 +10576,8 @@ \begin{itemdescr} \pnum \effects +If \tcode{addressof(rhs) == this} is \tcode{true}, there are no effects. +Otherwise: \begin{itemize} \item Releases any shared state\iref{futures.state}. @@ -10591,6 +10593,7 @@ assignment. \item +If \tcode{addressof(rhs) == this} is \tcode{false}, \tcode{rhs.valid() == false}. \end{itemize} \end{itemdescr} @@ -10897,6 +10900,8 @@ \begin{itemdescr} \pnum \effects +If \tcode{addressof(rhs) == this} is \tcode{true}, there are no effects. +Otherwise: \begin{itemize} \item Releases any shared state\iref{futures.state}; @@ -10912,6 +10917,7 @@ the assignment. \item +If \tcode{addressof(rhs) == this} is \tcode{false}, \tcode{rhs.valid() == false}. \end{itemize} \end{itemdescr} @@ -10924,6 +10930,8 @@ \begin{itemdescr} \pnum \effects +If \tcode{addressof(rhs) == this} is \tcode{true}, there are no effects. +Otherwise: \begin{itemize} \item Releases any shared state\iref{futures.state}; From 9925f3a0519ca9f20b431d4041e1d4d67e5cadcb Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 15 Nov 2022 23:55:23 -0800 Subject: [PATCH 42/44] LWG3796 movable-box as member should use default-initialization instead of copy-initialization --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 4222324f20..7bf21b71a4 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -3416,7 +3416,7 @@ // \ref{range.repeat.iterator}, class \tcode{repeat_view::\exposid{iterator}} struct @\exposidnc{iterator}@; // \expos - @\exposidnc{movable-box}@ @\exposid{value_}@ = W(); // \expos, see \ref{range.move.wrap} + @\exposidnc{movable-box}@ @\exposid{value_}@; // \expos, see \ref{range.move.wrap} Bound @\exposid{bound_}@ = Bound(); // \expos public: @@ -13308,7 +13308,7 @@ requires @\libconcept{view}@ && is_object_v class chunk_by_view : public view_interface> { V @\exposid{base_}@ = V(); // \expos - @\exposidnc{movable-box}@ @\exposid{pred_}@ = Pred(); // \expos + @\exposidnc{movable-box}@ @\exposid{pred_}@; // \expos // \ref{range.chunk.by.iter}, class \tcode{chunk_by_view::\exposid{iterator}} class @\exposidnc{iterator}@; // \expos From 8b08ed27847db2c39ad7c334345a5b99c264776f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 16 Nov 2022 00:46:08 -0800 Subject: [PATCH 43/44] LWG3798 Rvalue reference and iterator_category --- source/iterators.tex | 2 +- source/ranges.tex | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index de89d31340..a0c8cbdb8b 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -946,7 +946,7 @@ template concept @\defexposconcept{cpp17-forward-iterator}@ = @\exposconcept{cpp17-input-iterator}@ && @\libconcept{constructible_from}@ && - is_lvalue_reference_v> && + is_reference_v> && @\libconcept{same_as}@>, typename indirectly_readable_traits::value_type> && requires(I i) { diff --git a/source/ranges.tex b/source/ranges.tex index 7bf21b71a4..21314d8f6b 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -5231,7 +5231,7 @@ \tcode{iterator_traits>::iterator_category}. \begin{itemize} \item -If \tcode{is_lvalue_reference_v\&, range_reference_t<\linebreak\exposid{Base}>>>} +If \tcode{is_reference_v\&, range_reference_t<\exposid{Base}>>>} is \tcode{true}, then \begin{itemize} \item @@ -7110,8 +7110,8 @@ \item If \begin{codeblock} -is_lvalue_reference_v, - iter_reference_t<@\exposid{PatternIter}@>>> +is_reference_v, + iter_reference_t<@\exposid{PatternIter}@>>> \end{codeblock} is \tcode{false}, \tcode{iterator_category} denotes \tcode{input_iterator_tag}. @@ -10180,7 +10180,7 @@ \begin{codeblock} invoke_result_t<@\exposid{maybe-const}@&, range_reference_t<@\exposid{maybe-const}@>...> \end{codeblock} -is not an lvalue reference, +is not a reference, \tcode{iterator_category} denotes \tcode{input_iterator_tag}. \item Otherwise, let \tcode{Cs} denote the pack of types @@ -11330,7 +11330,7 @@ \item If \tcode{invoke_result_t<\exposid{maybe-const}\&, \exposid{REPEAT}(range_reference_t<\exposid{Base}>, N)...>} -is\linebreak not an lvalue reference, +is\linebreak not a reference, \tcode{iterator_category} denotes \tcode{input_iterator_tag}. \item Otherwise, let \tcode{C} denote the type From 890ba0b6c527bf07b01064f433190a81070f693d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Wed, 16 Nov 2022 01:00:45 -0800 Subject: [PATCH 44/44] LWG3801 cartesian_product_view::iterator::distance-from ignores the size of last underlying range --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 21314d8f6b..32a887d8d0 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -14622,7 +14622,7 @@ $\exposid{scaled-size}(N)$ be the product of \tcode{static_cast(ranges::size(std::get<\brk{}$N$>(\exposid{parent_}->\exposid{bases_})))} and $\exposid{scaled-size}(N+1)$ -if $N < \tcode{sizeof...(Vs)}$, otherwise \tcode{static_cast(1)}; +if $N \le \tcode{sizeof...(Vs)}$, otherwise \tcode{static_cast(1)}; \item $\exposid{scaled-distance}(N)$ be the product of \tcode{static_cast(std::get<$N$>(\exposid{cur\-rent_}) - std::get<$N$>(t))} and $\exposid{scaled-size}(N+1)$; and