From 1b4e47439ce2c4fe190159311be92cde124672ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 16 Apr 2024 13:15:43 +0100 Subject: [PATCH 001/162] Update configuration for building working drafts after N4981. --- source/config.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/config.tex b/source/config.tex index bac1ee788a..be1743a556 100644 --- a/source/config.tex +++ b/source/config.tex @@ -1,8 +1,8 @@ %!TEX root = std.tex %%-------------------------------------------------- %% Version numbers -\newcommand{\docno}{N4981} -\newcommand{\prevdocno}{N4971} +\newcommand{\docno}{Dxxxx} +\newcommand{\prevdocno}{N4981} \newcommand{\cppver}{202302L} %% Release date From 59d6bfc0c23b61cabb72d9a48270ed1c3b7e02f9 Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Tue, 16 Apr 2024 09:57:19 -0400 Subject: [PATCH 002/162] [basic.life] Reflow text defining transparently replaceable p8 is difficult to read as it defines transparently replaceable only after it has made all use of it. The edit pulls the definition of transparently replaceable into its own preceding paragraph, and then simplifies the sentence that uses this term. --- source/basic.tex | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 1343ca29f2..2f2b318681 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -3625,17 +3625,7 @@ \end{itemize} \pnum -If, after the lifetime of an object has ended and before the storage -which the object occupied is reused or released, a new object is created -at the storage location which the original object occupied, a pointer -that pointed to the original object, a reference that referred to the -original object, or the name of the original object will automatically -refer to the new object and, once the lifetime of the new object has -started, can be used to manipulate the new object, if -the original object is transparently replaceable (see below) -by the new object. -An object $o_1$ is \defn{transparently replaceable} -by an object $o_2$ if: +An object $o_1$ is \defn{transparently replaceable} by an object $o_2$ if: \begin{itemize} \item the storage that $o_2$ occupies exactly overlays the storage that $o_1$ occupied, and @@ -3652,6 +3642,17 @@ $o_1$ and $o_2$ are direct subobjects of objects $p_1$ and $p_2$, respectively, and $p_1$ is transparently replaceable by $p_2$. \end{itemize} + +\pnum +After the lifetime of an object has ended and before the storage which the +object occupied is reused or released, if a new object is created at the +storage location which the original object occupied and the original object was +transparently replaceable by the new object, a pointer that pointed to the +original object, a reference that referred to the original object, or the name +of the original object will automatically refer to the new object and, once the +lifetime of the new object has started, can be used to manipulate the new +object. + \begin{example} \begin{codeblock} struct C { From 93b7f539ded4f9ee078659ddc858437e4198de6b Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Wed, 17 Apr 2024 14:55:38 +0800 Subject: [PATCH 003/162] [range.concat.iterator] Add missing \tcode (#6928) --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 05147c3046..e0335c89d7 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -9023,7 +9023,7 @@ \begin{itemdescr} \pnum \expects -\exposid{it_}.valueless_by_exception() is \tcode{false}. +\tcode{\exposid{it_}.valueless_by_exception()} is \tcode{false}. \pnum \effects @@ -9114,7 +9114,7 @@ \begin{itemdescr} \pnum \expects -\exposid{it_}.valueless_by_exception() is \tcode{false}. +\tcode{\exposid{it_}.valueless_by_exception()} is \tcode{false}. \pnum \effects From ccfb6adea4373a63b7063f4d41cb9d47876a9347 Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Wed, 17 Apr 2024 03:08:36 -0400 Subject: [PATCH 004/162] [tab:headers.cpp.fs] Move the debugging library to numberically sorted position (#6927) --- 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 2cc47ecbcc..92957019f4 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1530,6 +1530,7 @@ \ref{function.objects} & Function objects & \tcode{} \\ \rowsep \ref{charconv} & Primitive numeric conversions & \tcode{} \\ \rowsep \ref{bit} & Bit manipulation & \tcode{} \\ \rowsep +\ref{debugging} & Debugging & \tcode{} \\ \rowsep \ref{string.view} & String view classes & \tcode{} \\ \rowsep \ref{string.classes} & String classes & \tcode{} \\ \rowsep \ref{c.strings} & Null-terminated sequence utilities & \tcode{}, \tcode{} \\ \rowsep @@ -1541,7 +1542,6 @@ \ref{algorithms} & Algorithms library & \tcode{}, \tcode{} \\ \rowsep \ref{c.math} & Mathematical functions for floating-point types & \tcode{} \\ \rowsep \ref{atomics} & Atomics & \tcode{} \\ \rowsep -\ref{debugging} & Debugging & \tcode{} \\ \rowsep \end{libsumtab} \pnum From c82e95ca91b313bc2cfde60aac9abbd49406d930 Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Wed, 17 Apr 2024 18:42:19 -0400 Subject: [PATCH 005/162] [zombie.names] Turn lists of zombie names into tables (#6925) --- source/lib-intro.tex | 215 ++++++++++++++++++++++++------------------- 1 file changed, 120 insertions(+), 95 deletions(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 92957019f4..8a0dfbcb19 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -3021,107 +3021,132 @@ \indextext{brains!names that want to eat your}% \pnum -In namespace \tcode{std}, the following names are reserved for previous standardization: -\begin{itemize} -\item \indexlibraryzombie{auto_ptr} \tcode{auto_ptr}, -\item \indexlibraryzombie{auto_ptr_ref} \tcode{auto_ptr_ref}, -\item \indexlibraryzombie{binary_function} \tcode{binary_function}, -\item \indexlibraryzombie{binary_negate} \tcode{binary_negate}, -\item \indexlibraryzombie{bind1st} \tcode{bind1st}, -\item \indexlibraryzombie{bind2nd} \tcode{bind2nd}, -\item \indexlibraryzombie{binder1st} \tcode{binder1st}, -\item \indexlibraryzombie{binder2nd} \tcode{binder2nd}, -\item \indexlibraryzombie{codecvt_mode} \tcode{codecvt_mode}, -\item \indexlibraryzombie{codecvt_utf16} \tcode{codecvt_utf16}, -\item \indexlibraryzombie{codecvt_utf8} \tcode{codecvt_utf8}, -\item \indexlibraryzombie{codecvt_utf8_utf16} \tcode{codecvt_utf8_utf16}, -\item \indexlibraryzombie{const_mem_fun1_ref_t} \tcode{const_mem_fun1_ref_t}, -\item \indexlibraryzombie{const_mem_fun1_t} \tcode{const_mem_fun1_t}, -\item \indexlibraryzombie{const_mem_fun_ref_t} \tcode{const_mem_fun_ref_t}, -\item \indexlibraryzombie{const_mem_fun_t} \tcode{const_mem_fun_t}, -\item \indexlibraryzombie{consume_header} \tcode{consume_header}, -\item \indexlibraryzombie{declare_no_pointers} \tcode{declare_no_pointers}, -\item \indexlibraryzombie{declare_reachable} \tcode{declare_reachable}, -\item \indexlibraryzombie{generate_header} \tcode{generate_header}, -\item \indexlibraryzombie{get_pointer_safety} \tcode{get_pointer_safety}, -\item \indexlibraryzombie{get_temporary_buffer} \tcode{get_temporary_buffer}, -\item \indexlibraryzombie{get_unexpected} \tcode{get_unexpected}, -\item \indexlibraryzombie{gets} \tcode{gets}, -\item \indexlibraryzombie{is_literal_type} \tcode{is_literal_type}, -\item \indexlibraryzombie{is_literal_type_v} \tcode{is_literal_type_v}, -\item \indexlibraryzombie{istrstream} \tcode{istrstream}, -\item \indexlibraryzombie{little_endian} \tcode{little_endian}, -\item \indexlibraryzombie{mem_fun1_ref_t} \tcode{mem_fun1_ref_t}, -\item \indexlibraryzombie{mem_fun1_t} \tcode{mem_fun1_t}, -\item \indexlibraryzombie{mem_fun_ref_t} \tcode{mem_fun_ref_t}, -\item \indexlibraryzombie{mem_fun_ref} \tcode{mem_fun_ref}, -\item \indexlibraryzombie{mem_fun_t} \tcode{mem_fun_t}, -\item \indexlibraryzombie{mem_fun} \tcode{mem_fun}, -\item \indexlibraryzombie{not1} \tcode{not1}, -\item \indexlibraryzombie{not2} \tcode{not2}, -\item \indexlibraryzombie{ostrstream} \tcode{ostrstream}, -\item \indexlibraryzombie{pointer_safety} \tcode{pointer_safety}, -\item \indexlibraryzombie{pointer_to_binary_function} \tcode{pointer_to_binary_function}, -\item \indexlibraryzombie{pointer_to_unary_function} \tcode{pointer_to_unary_function}, -\item \indexlibraryzombie{ptr_fun} \tcode{ptr_fun}, -\item \indexlibraryzombie{random_shuffle} \tcode{random_shuffle}, -\item \indexlibraryzombie{raw_storage_iterator} \tcode{raw_storage_iterator}, -\item \indexlibraryzombie{result_of} \tcode{result_of}, -\item \indexlibraryzombie{result_of_t} \tcode{result_of_t}, -\item \indexlibraryzombie{return_temporary_buffer} \tcode{return_temporary_buffer}, -\item \indexlibraryzombie{set_unexpected} \tcode{set_unexpected}, -\item \indexlibraryzombie{strstream} \tcode{strstream}, -\item \indexlibraryzombie{strstreambuf} \tcode{strstreambuf}, -\item \indexlibraryzombie{unary_function} \tcode{unary_function}, -\item \indexlibraryzombie{unary_negate} \tcode{unary_negate}, -\item \indexlibraryzombie{uncaught_exception} \tcode{uncaught_exception}, -\item \indexlibraryzombie{undeclare_no_pointers} \tcode{undeclare_no_pointers}, -\item \indexlibraryzombie{undeclare_reachable} \tcode{undeclare_reachable}, -\item \indexlibraryzombie{unexpected_handler} \tcode{unexpected_handler}, -\item \indexlibraryzombie{wbuffer_convert} \tcode{wbuffer_convert}, -and -\item \indexlibraryzombie{wstring_convert} \tcode{wstring_convert}. -\end{itemize} +In namespace \tcode{std}, the names shown in \tref{zombie.names.std} are +reserved for previous standardization: + +\begin{multicolfloattable}{Zombie names in namespace \tcode{std}}{zombie.names.std} +{lll} +\indexlibraryzombie{auto_ptr} \tcode{auto_ptr} \\ +\indexlibraryzombie{auto_ptr_ref} \tcode{auto_ptr_ref} \\ +\indexlibraryzombie{binary_function} \tcode{binary_function} \\ +\indexlibraryzombie{binary_negate} \tcode{binary_negate} \\ +\indexlibraryzombie{bind1st} \tcode{bind1st} \\ +\indexlibraryzombie{bind2nd} \tcode{bind2nd} \\ +\indexlibraryzombie{binder1st} \tcode{binder1st} \\ +\indexlibraryzombie{binder2nd} \tcode{binder2nd} \\ +\indexlibraryzombie{codecvt_mode} \tcode{codecvt_mode} \\ +\indexlibraryzombie{codecvt_utf16} \tcode{codecvt_utf16} \\ +\indexlibraryzombie{codecvt_utf8} \tcode{codecvt_utf8} \\ +\indexlibraryzombie{codecvt_utf8_utf16} \tcode{codecvt_utf8_utf16} \\ +\indexlibraryzombie{const_mem_fun1_ref_t} \tcode{const_mem_fun1_ref_t} \\ +\indexlibraryzombie{const_mem_fun1_t} \tcode{const_mem_fun1_t} \\ +\indexlibraryzombie{const_mem_fun_ref_t} \tcode{const_mem_fun_ref_t} \\ +\indexlibraryzombie{const_mem_fun_t} \tcode{const_mem_fun_t} \\ +\indexlibraryzombie{consume_header} \tcode{consume_header} \\ +\indexlibraryzombie{declare_no_pointers} \tcode{declare_no_pointers} \\ +\indexlibraryzombie{declare_reachable} \tcode{declare_reachable} \\ +\columnbreak +\indexlibraryzombie{generate_header} \tcode{generate_header} \\ +\indexlibraryzombie{get_pointer_safety} \tcode{get_pointer_safety} \\ +\indexlibraryzombie{get_temporary_buffer} \tcode{get_temporary_buffer} \\ +\indexlibraryzombie{get_unexpected} \tcode{get_unexpected} \\ +\indexlibraryzombie{gets} \tcode{gets} \\ +\indexlibraryzombie{is_literal_type} \tcode{is_literal_type} \\ +\indexlibraryzombie{is_literal_type_v} \tcode{is_literal_type_v} \\ +\indexlibraryzombie{istrstream} \tcode{istrstream} \\ +\indexlibraryzombie{little_endian} \tcode{little_endian} \\ +\indexlibraryzombie{mem_fun1_ref_t} \tcode{mem_fun1_ref_t} \\ +\indexlibraryzombie{mem_fun1_t} \tcode{mem_fun1_t} \\ +\indexlibraryzombie{mem_fun_ref_t} \tcode{mem_fun_ref_t} \\ +\indexlibraryzombie{mem_fun_ref} \tcode{mem_fun_ref} \\ +\indexlibraryzombie{mem_fun_t} \tcode{mem_fun_t} \\ +\indexlibraryzombie{mem_fun} \tcode{mem_fun} \\ +\indexlibraryzombie{not1} \tcode{not1} \\ +\indexlibraryzombie{not2} \tcode{not2} \\ +\indexlibraryzombie{ostrstream} \tcode{ostrstream} \\ +\indexlibraryzombie{pointer_safety} \tcode{pointer_safety} \\ +\columnbreak +\indexlibraryzombie{pointer_to_binary_function} \tcode{pointer_to_binary_function} \\ +\indexlibraryzombie{pointer_to_unary_function} \tcode{pointer_to_unary_function} \\ +\indexlibraryzombie{ptr_fun} \tcode{ptr_fun} \\ +\indexlibraryzombie{random_shuffle} \tcode{random_shuffle} \\ +\indexlibraryzombie{raw_storage_iterator} \tcode{raw_storage_iterator} \\ +\indexlibraryzombie{result_of} \tcode{result_of} \\ +\indexlibraryzombie{result_of_t} \tcode{result_of_t} \\ +\indexlibraryzombie{return_temporary_buffer} \tcode{return_temporary_buffer} \\ +\indexlibraryzombie{set_unexpected} \tcode{set_unexpected} \\ +\indexlibraryzombie{strstream} \tcode{strstream} \\ +\indexlibraryzombie{strstreambuf} \tcode{strstreambuf} \\ +\indexlibraryzombie{unary_function} \tcode{unary_function} \\ +\indexlibraryzombie{unary_negate} \tcode{unary_negate} \\ +\indexlibraryzombie{uncaught_exception} \tcode{uncaught_exception} \\ +\indexlibraryzombie{undeclare_no_pointers} \tcode{undeclare_no_pointers} \\ +\indexlibraryzombie{undeclare_reachable} \tcode{undeclare_reachable} \\ +\indexlibraryzombie{unexpected_handler} \tcode{unexpected_handler} \\ +\indexlibraryzombie{wbuffer_convert} \tcode{wbuffer_convert} \\ +\indexlibraryzombie{wstring_convert} \tcode{wstring_convert} \\ +\end{multicolfloattable} + \pnum -The following names are reserved as members for previous standardization, -and may not be used as a name for object-like macros in portable code: -\begin{itemize} -\item \indexlibraryzombie{argument_type} \tcode{argument_type}, -\item \indexlibraryzombie{first_argument_type} \tcode{first_argument_type}, -\item \indexlibraryzombie{io_state} \tcode{io_state}, -\item \indexlibraryzombie{op} \tcode{op}, -\item \indexlibraryzombie{open_mode} \tcode{open_mode}, -\item \indexlibraryzombie{preferred} \tcode{preferred}, -\item \indexlibraryzombie{second_argument_type} \tcode{second_argument_type}, -\item \indexlibraryzombie{seek_dir} \tcode{seek_dir}, and -\item \indexlibraryzombie{strict} \tcode{strict}. -\end{itemize} +The names shown in \tref{zombie.names.objmacro} are reserved as members for +previous standardization, and may not be used as a name for object-like macros +in portable code: + +\begin{multicolfloattable}{Zombie object-like macros}{zombie.names.objmacro} +{lll} +\indexlibraryzombie{argument_type} \tcode{argument_type} \\ +\indexlibraryzombie{first_argument_type} \tcode{first_argument_type} \\ +\indexlibraryzombie{io_state} \tcode{io_state} \\ +\columnbreak +\indexlibraryzombie{op} \tcode{op} \\ +\indexlibraryzombie{open_mode} \tcode{open_mode} \\ +\indexlibraryzombie{preferred} \tcode{preferred} \\ +\columnbreak +\indexlibraryzombie{second_argument_type} \tcode{second_argument_type} \\ +\indexlibraryzombie{seek_dir} \tcode{seek_dir} \\ +\indexlibraryzombie{strict} \tcode{strict} \\ +\end{multicolfloattable} + \pnum -The following names are reserved as member functions for previous -standardization, and may not be used as a name for function-like macros in -portable code: -\begin{itemize} -\item \indexlibraryzombie{converted} \tcode{converted}, -\item \indexlibraryzombie{from_bytes} \tcode{from_bytes}, -\item \indexlibraryzombie{freeze} \tcode{freeze}, -\item \indexlibraryzombie{pcount} \tcode{pcount}, -\item \indexlibraryzombie{stossc} \tcode{stossc}, and -\item \indexlibraryzombie{to_bytes} \tcode{to_bytes}. -\end{itemize} +The names shown in \tref{zombie.names.fnmacro} are reserved as member functions +for previous standardization, and may not be used as a name for function-like +macros in portable code: + +\begin{multicolfloattable}{Zombie function-like macros}{zombie.names.fnmacro} +{llllll} +\indexlibraryzombie{converted} \tcode{converted} \\ +\columnbreak +\indexlibraryzombie{freeze} \tcode{freeze} \\ +\columnbreak +\indexlibraryzombie{from_bytes} \tcode{from_bytes} \\ +\columnbreak +\indexlibraryzombie{pcount} \tcode{pcount} \\ +\columnbreak +\indexlibraryzombie{stossc} \tcode{stossc} \\ +\columnbreak +\indexlibraryzombie{to_bytes} \tcode{to_bytes} \\ +\end{multicolfloattable} \pnum -The following header names are reserved for previous standardization: -\begin{itemize} -\item \libnoheader{ccomplex}, -\item \libnoheader{ciso646}, -\item \libnoheader{codecvt}, -\item \libnoheader{cstdalign}, -\item \libnoheader{cstdbool}, -\item \libnoheader{ctgmath}, and -\item \libnoheader{strstream}. -\end{itemize} +The header names shown in \tref{zombie.names.header} are reserved for previous +standardization: + +\begin{multicolfloattable}{Zombie headers}{zombie.names.header} +{lllll} +\libnoheader{ccomplex} \\ +\libnoheader{ciso646} \\ +\columnbreak +\libnoheader{codecvt} \\ +\libnoheader{cstdalign} \\ +\columnbreak +\libnoheader{cstdbool} \\ +\columnbreak +\libnoheader{ctgmath} \\ +\columnbreak +\libnoheader{strstream} \\ +\end{multicolfloattable} \rSec4[macro.names]{Macro names} From c1eec01966d6383dabfaa4304939ce3be3868f1f Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Thu, 18 Apr 2024 23:51:53 +0800 Subject: [PATCH 006/162] [range.concat.overview] Remove unnecessary `std::` prefix from example (#6931) --- source/ranges.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index e0335c89d7..5f0fe9e2dd 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8488,11 +8488,11 @@ \end{itemize} \begin{example} \begin{codeblock} -std::vector v1{1, 2, 3}, v2{4, 5}, v3{}; -std::array a{6, 7, 8}; -auto s = std::views::single(9); -for (auto&& i : std::views::concat(v1, v2, v3, a, s)) { - std::print("{} ", i); // prints \tcode{1 2 3 4 5 6 7 8 9} +vector v1{1, 2, 3}, v2{4, 5}, v3{}; +array a{6, 7, 8}; +auto s = views::single(9); +for (auto&& i : views::concat(v1, v2, v3, a, s)) { + print("{} ", i); // prints \tcode{1 2 3 4 5 6 7 8 9} } \end{codeblock} \end{example} From 2de15529d3f98a5de25cecf9ac8ed5b104d776e1 Mon Sep 17 00:00:00 2001 From: Jan Schultke Date: Thu, 18 Apr 2024 18:00:42 +0200 Subject: [PATCH 007/162] [charconv.syn] Clarify types matching integer-type (#6847) --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index a354b49ff0..f856a423b4 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -15317,7 +15317,7 @@ When a function is specified with a type placeholder of \tcode{\placeholder{integer-type}}, the implementation provides overloads -for all cv-unqualified signed and unsigned integer types and \tcode{char} +for \tcode{char} and all cv-unqualified signed and unsigned integer types in lieu of \tcode{\placeholder{integer-type}}. When a function is specified with a type placeholder of \tcode{\placeholder{floating-point-type}}, From bae18b69cbca566eac284c8c2f316407fda98d16 Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Fri, 19 Apr 2024 01:21:19 +0800 Subject: [PATCH 008/162] [range.concat.view] Format code to match the current style (#6929) --- source/ranges.tex | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 5f0fe9e2dd..55e971ad72 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8533,16 +8533,16 @@ constexpr concat_view() = default; constexpr explicit concat_view(Views... views); - constexpr @\exposid{iterator}@ begin() requires(!(@\exposconcept{simple-view}@ && ...)); + constexpr @\exposid{iterator}@ begin() requires (!(@\exposconcept{simple-view}@ && ...)); constexpr @\exposid{iterator}@ begin() const - requires((@\libconcept{range}@ && ...) && @\exposconcept{concatable}@); + requires (@\libconcept{range}@ && ...) && @\exposconcept{concatable}@; - constexpr auto end() requires(!(@\exposconcept{simple-view}@ && ...)); + constexpr auto end() requires (!(@\exposconcept{simple-view}@ && ...)); constexpr auto end() const - requires((@\libconcept{range}@ && ...) && @\exposconcept{concatable}@); + requires (@\libconcept{range}@ && ...) && @\exposconcept{concatable}@; - constexpr auto size() requires(@\libconcept{sized_range}@&&...); - constexpr auto size() const requires(@\libconcept{sized_range}@&&...); + constexpr auto size() requires (@\libconcept{sized_range}@ && ...); + constexpr auto size() const requires (@\libconcept{sized_range}@ && ...); }; template @@ -8650,9 +8650,9 @@ \indexlibrarymember{begin}{concat_view}% \begin{itemdecl} -constexpr @\exposid{iterator}@ begin() requires(!(@\exposconcept{simple-view}@ && ...)); +constexpr @\exposid{iterator}@ begin() requires (!(@\exposconcept{simple-view}@ && ...)); constexpr @\exposid{iterator}@ begin() const - requires((@\libconcept{range}@ && ...) && @\exposconcept{concatable}@); + requires (@\libconcept{range}@ && ...) && @\exposconcept{concatable}@; \end{itemdecl} \begin{itemdescr} @@ -8671,9 +8671,9 @@ \indexlibrarymember{end}{concat_view}% \begin{itemdecl} -constexpr auto end() requires(!(@\exposconcept{simple-view}@ && ...)); +constexpr auto end() requires (!(@\exposconcept{simple-view}@ && ...)); constexpr auto end() const - requires((@\libconcept{range}@ && ...) && @\exposconcept{concatable}@); + requires (@\libconcept{range}@ && ...) && @\exposconcept{concatable}@; \end{itemdecl} \begin{itemdescr} @@ -8696,8 +8696,8 @@ \indexlibrarymember{size}{concat_view}% \begin{itemdecl} -constexpr auto size() requires(@\libconcept{sized_range}@&&...); -constexpr auto size() const requires(@\libconcept{sized_range}@&&...); +constexpr auto size() requires (@\libconcept{sized_range}@ && ...); +constexpr auto size() const requires (@\libconcept{sized_range}@ && ...); \end{itemdecl} \begin{itemdescr} From c842b5a5ccb181b8b250b6742f604ab7574860dc Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Fri, 19 Apr 2024 14:00:22 +0800 Subject: [PATCH 009/162] [range.concat.iterator] Fix whitespace in constraints for operator== (#6935) --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 55e971ad72..53a3e83e3d 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8778,7 +8778,7 @@ requires @\exposconcept{concat-is-random-access}@; friend constexpr bool operator==(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) - requires(@\libconcept{equality_comparable}@>>&&...); + requires (@\libconcept{equality_comparable}@>> && ...); friend constexpr bool operator==(const @\exposid{iterator}@& it, default_sentinel_t); friend constexpr bool operator<(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) requires @\exposconcept{all-random-access}@; @@ -9164,7 +9164,7 @@ \indexlibrarymember{operator==}{concat_view::\exposid{iterator}}% \begin{itemdecl} friend constexpr bool operator==(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) - requires(@\libconcept{equality_comparable}@>>&&...); + requires (@\libconcept{equality_comparable}@>> && ...); \end{itemdecl} \begin{itemdescr} From 0211a3d9b4334f4846260d968da715e56d379f1f Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Fri, 19 Apr 2024 14:02:04 +0800 Subject: [PATCH 010/162] [range.concat.view] Mark make-unsigned-like-t with \exposid (#6933) --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 53a3e83e3d..84a405f578 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8707,7 +8707,7 @@ \begin{codeblock} return apply( [](auto... sizes) { - using CT = make-unsigned-like-t>; + using CT = @\exposid{make-unsigned-like-t}@>; return (CT(sizes) + ...); }, tuple-transform(ranges::size, @\exposid{views_}@)); From 79dcca82c22d75fc2b2b6cbc1c338a0229db9a34 Mon Sep 17 00:00:00 2001 From: "S. B. Tam" Date: Fri, 19 Apr 2024 19:51:29 +0800 Subject: [PATCH 011/162] [range.utility.conv.general] Fix misapplication of LWG4016 (#6932) --- source/ranges.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 84a405f578..22ccd6c5fe 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -2268,10 +2268,10 @@ \end{codeblock} \pnum -Let \exposid{container-appendable} be defined as follows: +Let \exposid{container-append} be defined as follows: \begin{codeblock} -template -constexpr auto @\exposid{container-appendable}@(Container& c) { // \expos +template +constexpr auto @\exposid{container-append}@(Container& c) { // \expos return [&c](Ref&& ref) { if constexpr (requires { c.emplace_back(declval()); }) c.emplace_back(std::forward(ref)); From 79eb180041f385b56724dd70b00ae0d19c5a7d72 Mon Sep 17 00:00:00 2001 From: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> Date: Fri, 19 Apr 2024 15:39:27 +0200 Subject: [PATCH 012/162] [range.concat.iterator] Fix indentation (#6937) --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 22ccd6c5fe..25c8cfadc8 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8792,7 +8792,7 @@ requires (@\exposconcept{all-random-access}@ && (@\libconcept{three_way_comparable}@>> && ...)); friend constexpr @\exposid{iterator}@ operator+(const @\exposid{iterator}@& it, difference_type n) - requires @\exposconcept{concat-is-random-access}@; + requires @\exposconcept{concat-is-random-access}@; friend constexpr @\exposid{iterator}@ operator+(difference_type n, const @\exposid{iterator}@& it) requires @\exposconcept{concat-is-random-access}@; friend constexpr @\exposid{iterator}@ operator-(const @\exposid{iterator}@& it, difference_type n) From e572580d71dfc8bdb32b8d1a21a2e493676e2151 Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Fri, 19 Apr 2024 21:57:48 +0800 Subject: [PATCH 013/162] [range.concat.iterator] Remove @ outside of codeblocks (#6934) --- source/ranges.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 25c8cfadc8..16fdd76a1d 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8839,14 +8839,14 @@ \begin{itemize} \item If -\tcode{is_reference_v<\exposid{concat-reference-t}<@\exposid{maybe-const}@...>>} +\tcode{is_reference_v<\exposid{concat-reference-t}<\exposid{maybe-const}...>>} is \tcode{false}, -then \tcode{it\-erator_category} denotes \tcode{input_iterator_tag}. +then \tcode{iter\-ator_category} denotes \tcode{input_iterator_tag}. \item Otherwise, let \tcode{Cs} denote the pack of types -\tcode{iterator_traits>>::iterator_category...}. +\tcode{iterator_traits>>::iterator_category...}. \begin{itemize} \item If @@ -9471,7 +9471,7 @@ \end{codeblock} where \tcode{its} is a pack of lvalues of type %FIXME "respectively" doesn't make sense here. -\tcode{const iterator_t<@\exposid{maybe-const}@>} respectively. +\tcode{const iterator_t<\exposid{maybe-const}>} respectively. \par % This paragraph is part of the \remarks clause. The expression in the \grammarterm{requires-clause} is equivalent to From 5a5295d9c9e1881e58d3b4696fe45f00ef1cc507 Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Fri, 19 Apr 2024 17:32:53 -0400 Subject: [PATCH 014/162] [index] Add missing entries for Cpp17 concepts (#6940) --- source/lib-intro.tex | 4 ++-- source/threads.tex | 10 +++++----- source/time.tex | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 8a0dfbcb19..c4eef90633 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1863,12 +1863,12 @@ swappable with any rvalue or lvalue, respectively, of type \tcode{T}. \pnum -A type \tcode{X} meets the \oldconcept{Swappable} requirements +A type \tcode{X} meets the \defnoldconcept{Swappable} requirements if lvalues of type \tcode{X} are swappable. \pnum A type \tcode{X} meeting any of the iterator requirements\iref{iterator.requirements} -meets the \oldconcept{ValueSwappable} requirements if, +meets the \defnoldconcept{ValueSwappable} requirements if, for any dereferenceable object \tcode{x} of type \tcode{X}, \tcode{*x} is swappable. diff --git a/source/threads.tex b/source/threads.tex index 9ba0aabcec..354a99f6ba 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -230,7 +230,7 @@ \rSec3[thread.req.lockable.basic]{\oldconcept{BasicLockable} requirements} \pnum -A type \tcode{L} meets the \oldconcept{BasicLockable} requirements if the following expressions are +A type \tcode{L} meets the \defnoldconcept{BasicLockable} requirements if the following expressions are well-formed and have the specified semantics (\tcode{m} denotes a value of type \tcode{L}). \begin{itemdecl} @@ -266,7 +266,7 @@ \rSec3[thread.req.lockable.req]{\oldconcept{Lockable} requirements} \pnum -A type \tcode{L} meets the \oldconcept{Lockable} requirements if it meets the \oldconcept{BasicLockable} +A type \tcode{L} meets the \defnoldconcept{Lockable} requirements if it meets the \oldconcept{BasicLockable} requirements and the following expressions are well-formed and have the specified semantics (\tcode{m} denotes a value of type \tcode{L}). @@ -291,7 +291,7 @@ \rSec3[thread.req.lockable.timed]{\oldconcept{TimedLockable} requirements} \pnum -A type \tcode{L} meets the \oldconcept{TimedLockable} requirements if it meets the \oldconcept{Lockable} +A type \tcode{L} meets the \defnoldconcept{TimedLockable} requirements if it meets the \oldconcept{Lockable} requirements and the following expressions are well-formed and have the specified semantics (\tcode{m} denotes a value of type \tcode{L}, \tcode{rel_time} denotes a value of an instantiation of \tcode{duration}\iref{time.duration}, and \tcode{abs_time} denotes a value @@ -342,7 +342,7 @@ \rSec3[thread.req.lockable.shared]{\oldconcept{SharedLockable} requirements} \pnum -A type \tcode{L} meets the \oldconcept{SharedLockable} requirements if +A type \tcode{L} meets the \defnoldconcept{SharedLockable} requirements if the following expressions are well-formed, have the specified semantics, and the expression \tcode{m.try_lock_shared()} has type \tcode{bool} (\tcode{m} denotes a value of type \tcode{L}): @@ -396,7 +396,7 @@ \rSec3[thread.req.lockable.shared.timed]{\oldconcept{SharedTimedLockable} requirements} \pnum -A type \tcode{L} meets the \oldconcept{SharedTimedLockable} requirements if +A type \tcode{L} meets the \defnoldconcept{SharedTimedLockable} requirements if it meets the \oldconcept{SharedLockable} requirements, and the following expressions are well-formed, have type \tcode{bool}, and have the specified semantics diff --git a/source/time.tex b/source/time.tex index d66ef5652c..aa4addb0fd 100644 --- a/source/time.tex +++ b/source/time.tex @@ -1036,7 +1036,7 @@ \end{note} \pnum -A type \tcode{TC} meets the \oldconcept{TrivialClock} requirements if: +A type \tcode{TC} meets the \defnoldconcept{TrivialClock} requirements if: \begin{itemize} \item \tcode{TC} meets the \oldconcept{Clock} requirements, From 5d4d9508bca4709366a0ff7acb17ba7b3a2efced Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Sat, 20 Apr 2024 20:16:23 +0800 Subject: [PATCH 015/162] [range.join.with.iterator] Add missing 'template' keyword for dependent name 'emplace' (#5455) --- source/ranges.tex | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 16fdd76a1d..5be8662537 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -7349,16 +7349,16 @@ if (@\exposid{inner_it_}@.index() == 0) { if (std::get<0>(@\exposid{inner_it_}@) != ranges::end(@\exposid{parent_}@->@\exposid{pattern_}@)) break; - @\exposid{inner_it_}@.emplace<1>(ranges::begin(@\exposid{update-inner}@())); + @\exposid{inner_it_}@.template emplace<1>(ranges::begin(@\exposid{update-inner}@())); } else { if (std::get<1>(@\exposid{inner_it_}@) != ranges::end(@\exposid{get-inner}@())) break; if (++@\exposid{outer}@() == ranges::end(@\exposid{parent_}@->@\exposid{base_}@)) { if constexpr (@\exposid{ref-is-glvalue}@) - @\exposid{inner_it_}@.emplace<0>(); + @\exposid{inner_it_}@.template emplace<0>(); break; } - @\exposid{inner_it_}@.emplace<0>(ranges::begin(@\exposid{parent_}@->@\exposid{pattern_}@)); + @\exposid{inner_it_}@.template emplace<0>(ranges::begin(@\exposid{parent_}@->@\exposid{pattern_}@)); } } \end{codeblock} @@ -7385,7 +7385,7 @@ Then, equivalent to: \begin{codeblock} if (@\exposid{outer}@() != ranges::end(@\exposid{parent_}@->@\exposid{base_}@)) { - @\exposid{inner_it_}@.emplace<1>(ranges::begin(@\exposid{update-inner}@())); + @\exposid{inner_it_}@.template emplace<1>(ranges::begin(@\exposid{update-inner}@())); @\exposidnc{satisfy}@(); } \end{codeblock} @@ -7407,9 +7407,9 @@ Then, equivalent to: \begin{codeblock} if (i.@\exposid{inner_it_}@.index() == 0) - @\exposid{inner_it_}@.emplace<0>(std::get<0>(std::move(i.@\exposid{inner_it_}@))); + @\exposid{inner_it_}@.template emplace<0>(std::get<0>(std::move(i.@\exposid{inner_it_}@))); else - @\exposid{inner_it_}@.emplace<1>(std::get<1>(std::move(i.@\exposid{inner_it_}@))); + @\exposid{inner_it_}@.template emplace<1>(std::get<1>(std::move(i.@\exposid{inner_it_}@))); \end{codeblock} \pnum @@ -7488,7 +7488,7 @@ \begin{codeblock} if (@\exposid{outer_it_}@ == ranges::end(@\exposid{parent_}@->@\exposid{base_}@)) { auto&& inner = *--@\exposid{outer_it_}@; - @\exposid{inner_it_}@.emplace<1>(ranges::end(inner)); + @\exposid{inner_it_}@.template emplace<1>(ranges::end(inner)); } while (true) { @@ -7496,7 +7496,7 @@ auto& it = std::get<0>(@\exposid{inner_it_}@); if (it == ranges::begin(@\exposid{parent_}@->@\exposid{pattern_}@)) { auto&& inner = *--@\exposid{outer_it_}@; - @\exposid{inner_it_}@.emplace<1>(ranges::end(inner)); + @\exposid{inner_it_}@.template emplace<1>(ranges::end(inner)); } else { break; } @@ -7504,7 +7504,7 @@ auto& it = std::get<1>(@\exposid{inner_it_}@); auto&& inner = *@\exposid{outer_it_}@; if (it == ranges::begin(inner)) { - @\exposid{inner_it_}@.emplace<0>(ranges::end(@\exposid{parent_}@->@\exposid{pattern_}@)); + @\exposid{inner_it_}@.template emplace<0>(ranges::end(@\exposid{parent_}@->@\exposid{pattern_}@)); } else { break; } From 0ac38fd4c4548ff61cd378f98eff3e18f4463caf Mon Sep 17 00:00:00 2001 From: "S. B. Tam" Date: Fri, 18 Aug 2023 15:12:08 +0800 Subject: [PATCH 016/162] Fix typo (`dynamic_rank` => `rank_dynamic`) --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index ece8bdea92..8261583bee 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -19441,7 +19441,7 @@ \effects \begin{itemize} \item -If \tcode{N} equals \tcode{dynamic_rank()}, +If \tcode{N} equals \tcode{rank_dynamic()}, for all $d$ in the range $[0, \tcode{rank_dynamic()})$, direct-non-list-initializes \tcode{\exposidnc{dynamic-extents}[$d$]} with \tcode{as_const(exts[$d$])}. From 7c0a98d680b509650fdbe653f710c6d77d710dc4 Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Sun, 21 Apr 2024 19:30:18 +0800 Subject: [PATCH 017/162] [range.concat.iterator] Add missing \tcode for difference_type (#6943) --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 5be8662537..dd7a95e5d0 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -9314,7 +9314,7 @@ \range{$i_\tcode{y}$ + 1}{$i_\tcode{x}$} if there is any, and \tcode{0} otherwise, -of type difference_type, +of type \tcode{difference_type}, equivalent to: \begin{codeblock} return @$d_\tcode{y}$@ + @$s$@ + @$d_\tcode{x}$@; From 47c2f68d84cb13a7ca83a507fb1f32ddf4774ec1 Mon Sep 17 00:00:00 2001 From: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> Date: Mon, 22 Apr 2024 23:19:41 +0200 Subject: [PATCH 018/162] [mdspan.layout.leftpad.obs] Remove superfluous \item (#6944) --- source/containers.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 8261583bee..0b7b1e0d80 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -21485,7 +21485,6 @@ \item \tcode{(is_convertible_v \&\& ...)} is \tcode{true}. \item -\item \tcode{(is_nothrow_constructible_v \&\& ...)} is \tcode{true}. \end{itemize} From 4f0779d5a3665af9dd92a96e52d809ba3911495d Mon Sep 17 00:00:00 2001 From: Jan Schultke Date: Tue, 23 Apr 2024 12:13:27 +0200 Subject: [PATCH 019/162] [intro.execution] Add comma after conditional clause (#6945) --- source/basic.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index 2f2b318681..f33d0dc648 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -5955,7 +5955,7 @@ determining the identity of an object for glvalue evaluation and fetching a value previously assigned to an object for prvalue evaluation) and initiation of side effects. When a call to a library I/O function -returns or an access through a volatile glvalue is evaluated the side +returns or an access through a volatile glvalue is evaluated, the side effect is considered complete, even though some external actions implied by the call (such as the I/O itself) or by the \keyword{volatile} access may not have completed yet. From 90caab82f89b8b79b272ecbf694affaa8ba03356 Mon Sep 17 00:00:00 2001 From: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> Date: Wed, 24 Apr 2024 17:14:15 +0200 Subject: [PATCH 020/162] [mdspan.layout.rightpad.obs] Add missing paragraph break (#6947) --- source/containers.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/containers.tex b/source/containers.tex index 0b7b1e0d80..26cae02912 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -22168,6 +22168,7 @@ \pnum \expects \tcode{r} is smaller than \exposid{rank_}. + \pnum \returns \begin{itemize} From 9707fb9da49d5ca176f593a818d5bfabd49a0cea Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Fri, 26 Apr 2024 01:32:48 +0800 Subject: [PATCH 021/162] [range.concat.view] Add missing \exposid for tuple-transform (#6951) --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index dd7a95e5d0..f672d7eb37 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8710,7 +8710,7 @@ using CT = @\exposid{make-unsigned-like-t}@>; return (CT(sizes) + ...); }, - tuple-transform(ranges::size, @\exposid{views_}@)); + @\exposid{tuple-transform}@(ranges::size, @\exposid{views_}@)); \end{codeblock} \end{itemdescr} From 5c521b6d29be35610f988aaf7de55da265c2c6a2 Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Sun, 28 Apr 2024 03:37:03 +0800 Subject: [PATCH 022/162] [range.concat.iterator] Add missing \libconcept markup (#6953) --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index f672d7eb37..79a246259e 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -9476,8 +9476,8 @@ \par % This paragraph is part of the \remarks clause. The expression in the \grammarterm{requires-clause} is equivalent to \begin{codeblock} -swappable_with, iter_reference_t> && -(... && indirectly_swappable>>) +@\libconcept{swappable_with}@, iter_reference_t> && +(... && @\libconcept{indirectly_swappable}@>>) \end{codeblock} \end{itemdescr} From dad191d5490b740e0d9376f364a06f4df9ab8392 Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Sun, 28 Apr 2024 21:48:13 +0800 Subject: [PATCH 023/162] [alg.rand.generate] Use \libconcept for sized_range (#6955) --- source/algorithms.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index ec47564de5..3c02fe09f7 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -11692,7 +11692,7 @@ Calls \tcode{g.generate_random(std::forward(r))} if this expression is well-formed. \item -Otherwise, if \tcode{R} models \tcode{sized_range}, +Otherwise, if \tcode{R} models \libconcept{sized_range}, fills \tcode{r} with \tcode{ranges::size(r)} values of type \tcode{invoke_result_t} by performing an unspecified number of invocations of @@ -11750,7 +11750,7 @@ Calls \tcode{d.generate_random(std::forward(r), g)} if this expression is well-formed. \item -Otherwise, if \tcode{R} models \tcode{sized_range}, +Otherwise, if \tcode{R} models \libconcept{sized_range}, fills \tcode{r} with \tcode{ranges::size(r)} values of type \tcode{invoke_result_t} by performing an unspecified number of invocations of From 12b6307589257a803527eb38c43f08f867d59322 Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Mon, 29 Apr 2024 15:23:41 +0800 Subject: [PATCH 024/162] [algorithm.syn,alg.fill] Fix typos in constraints (#6957) --- source/algorithms.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 3c02fe09f7..24d6646140 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -1672,7 +1672,7 @@ requires @\libconcept{output_range}@ constexpr borrowed_iterator_t fill(R&& r, const T& value); template> - requires @\libconcept{output_iterator}@ O> + requires @\libconcept{output_iterator}@ constexpr O fill_n(O first, iter_difference_t n, const T& value); } @@ -5692,10 +5692,10 @@ requires @\libconcept{output_iterator}@ constexpr O ranges::fill(O first, S last, const T& value); template> - requires @\libconcept{output_range}@> + requires @\libconcept{output_range}@ constexpr borrowed_iterator_t ranges::fill(R&& r, const T& value); template> - requires @\libconcept{output_iterator}@> + requires @\libconcept{output_iterator}@ constexpr O ranges::fill_n(O first, iter_difference_t n, const T& value); \end{itemdecl} From 927d0dba2b068ba9f2136479b4ba05a430eec348 Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Mon, 29 Apr 2024 22:43:49 +0800 Subject: [PATCH 025/162] [alg.rand.generate] Remove brace typo (#6956) --- source/algorithms.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 24d6646140..58377c00dd 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -11776,7 +11776,7 @@ \remarks The effects of \tcode{generate_random(r, g, d)} shall be equivalent to \begin{codeblock} -ranges::generate(std::forward(r), [&d, &g] { return invoke(d, g); })} +ranges::generate(std::forward(r), [&d, &g] { return invoke(d, g); }) \end{codeblock} \begin{note} This implies that \tcode{d.generate_random(a, g)} From 608ae5c17531fb081238c126a24c5e1ff4825992 Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Tue, 30 Apr 2024 02:13:22 +0800 Subject: [PATCH 026/162] [mdspan.layout.leftpad.overview] Add missing \tcode (#6958) --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 26cae02912..980e05e7c9 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -21061,7 +21061,7 @@ \item the empty parameter pack, if \exposid{rank_} equals zero; \item -\tcode otherwise, {0zu}, if \exposid{rank_} equals one; +\tcode otherwise, \tcode{0zu}, if \exposid{rank_} equals one; \item otherwise, the parameter pack \tcode{0zu}, \tcode{1zu}, \ldots, \tcode{\exposid{rank_}- 1}. \end{itemize} From 480adbe4d6ae54e03b6cec5f8784689445c36eee Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 30 Apr 2024 07:48:14 +0200 Subject: [PATCH 027/162] [print.syn] Correctly order println overloads --- source/iostreams.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index e865cd8211..101e063a36 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -4258,15 +4258,15 @@ // \ref{print.fun}, print functions template void print(format_string fmt, Args&&... args); - void println(); template void print(FILE* stream, format_string fmt, Args&&... args); - void println(FILE* stream); template void println(format_string fmt, Args&&... args); + void println(); template void println(FILE* stream, format_string fmt, Args&&... args); + void println(FILE* stream); void vprint_unicode(string_view fmt, format_args args); void vprint_unicode(FILE* stream, string_view fmt, format_args args); From 3333421819c1b2c6dec1becd0dd2a9fa0aeba8cd Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Tue, 30 Apr 2024 20:22:43 +0800 Subject: [PATCH 028/162] [range.concat.iterator] Remove superfluous period (#6960) --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 79a246259e..c0db50c92b 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8726,7 +8726,7 @@ class concat_view::@\exposid{iterator}@ { public: - using iterator_category = @\seebelow@; // not always present. + using iterator_category = @\seebelow@; // not always present using iterator_concept = @\seebelow@; using value_type = @\exposid{concat-value-t}@<@\exposid{maybe-const}@...>; using difference_type = common_type_t>...>; From 33486e0a02cf715d4f86f94d0625081a446a9be3 Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Wed, 1 May 2024 02:05:12 +0800 Subject: [PATCH 029/162] [mdspan.layout] Remove superfluous spacing around \seebelow (#6961) --- source/containers.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 980e05e7c9..c2d1113887 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -20999,10 +20999,10 @@ constexpr explicit(extents_type::rank() > 0) mapping(const layout_stride::mapping&); template - constexpr explicit( @\seebelow@ ) + constexpr explicit(@\seebelow@) mapping(const LayoutLeftPaddedMapping&); template - constexpr explicit( @\seebelow@ ) + constexpr explicit(@\seebelow@) mapping(const LayoutRightPaddedMapping&) noexcept; constexpr mapping& operator=(const mapping&) noexcept = default; @@ -21622,10 +21622,10 @@ constexpr explicit(rank_ > 0) mapping(const layout_stride::mapping&); template - constexpr explicit( @\seebelow@ ) + constexpr explicit(@\seebelow@) mapping(const LayoutRightPaddedMapping&); template - constexpr explicit( @\seebelow@ ) + constexpr explicit(@\seebelow@) mapping(const LayoutLeftPaddedMapping&) noexcept; constexpr mapping& operator=(const mapping&) noexcept = default; @@ -21963,7 +21963,7 @@ \indexlibraryctor{layout_right_padded::mapping}% \begin{itemdecl} template - constexpr explicit( @\seebelow@ ) + constexpr explicit(@\seebelow@) mapping(const LayoutRightPaddedMapping& other); \end{itemdecl} @@ -22029,7 +22029,7 @@ \indexlibraryctor{layout_right_padded::mapping}% \begin{itemdecl} template - constexpr explicit( @\seebelow@ ) + constexpr explicit(@\seebelow@) mapping(const LayoutLeftPaddedMapping& other) noexcept; \end{itemdecl} From 920722b7cd5b703a7fe3e35ce0cf498b8ee33a94 Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Fri, 3 May 2024 00:38:51 +0800 Subject: [PATCH 030/162] [linalg] Spacing in example 'for' loops (#6962) --- source/numerics.tex | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index 2ab8b57ecf..e08036998a 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -12327,7 +12327,7 @@ void test_scaled(mdspan> x) { auto x_scaled = scaled(5.0, x); - for(int i = 0; i < x.extent(0); ++i) { + for (int i = 0; i < x.extent(0); ++i) { assert(x_scaled[i] == 5.0 * x[i]); } } @@ -12486,22 +12486,22 @@ \begin{codeblock} void test_conjugated_complex(mdspan, extents> a) { auto a_conj = conjugated(a); - for(int i = 0; i < a.extent(0); ++i) { + for (int i = 0; i < a.extent(0); ++i) { assert(a_conj[i] == conj(a[i]); } auto a_conj_conj = conjugated(a_conj); - for(int i = 0; i < a.extent(0); ++i) { + for (int i = 0; i < a.extent(0); ++i) { assert(a_conj_conj[i] == a[i]); } } void test_conjugated_real(mdspan> a) { auto a_conj = conjugated(a); - for(int i = 0; i < a.extent(0); ++i) { + for (int i = 0; i < a.extent(0); ++i) { assert(a_conj[i] == a[i]); } auto a_conj_conj = conjugated(a_conj); - for(int i = 0; i < a.extent(0); ++i) { + for (int i = 0; i < a.extent(0); ++i) { assert(a_conj_conj[i] == a[i]); } } @@ -12791,8 +12791,8 @@ assert(a.stride(0) == a_t.stride(1)); assert(a.stride(1) == a_t.stride(0)); - for(size_t row = 0; row < num_rows; ++row) { - for(size_t col = 0; col < num_rows; ++col) { + for (size_t row = 0; row < num_rows; ++row) { + for (size_t col = 0; col < num_rows; ++col) { assert(a[row, col] == a_t[col, row]); } } @@ -12803,8 +12803,8 @@ assert(a.stride(0) == a_t_t.stride(0)); assert(a.stride(1) == a_t_t.stride(1)); - for(size_t row = 0; row < num_rows; ++row) { - for(size_t col = 0; col < num_rows; ++col) { + for (size_t row = 0; row < num_rows; ++row) { + for (size_t col = 0; col < num_rows; ++col) { assert(a[row, col] == a_t_t[row, col]); } } @@ -12843,8 +12843,8 @@ assert(a.stride(0) == a_ct.stride(1)); assert(a.stride(1) == a_ct.stride(0)); - for(size_t row = 0; row < num_rows; ++row) { - for(size_t col = 0; col < num_rows; ++col) { + for (size_t row = 0; row < num_rows; ++row) { + for (size_t col = 0; col < num_rows; ++col) { assert(a[row, col] == conj(a_ct[col, row])); } } @@ -12855,8 +12855,8 @@ assert(a.stride(0) == a_ct_ct.stride(0)); assert(a.stride(1) == a_ct_ct.stride(1)); - for(size_t row = 0; row < num_rows; ++row) { - for(size_t col = 0; col < num_rows; ++col) { + for (size_t row = 0; row < num_rows; ++row) { + for (size_t col = 0; col < num_rows; ++col) { assert(a[row, col] == a_ct_ct[row, col]); assert(conj(a_ct[col, row]) == a_ct_ct[row, col]); } From 513635b371c6a664be2a0ea6fc6939350b9b5e6b Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Fri, 10 May 2024 00:17:43 +0800 Subject: [PATCH 031/162] [range.reverse.overview] Replace 'equivalent to' with 'then' (#6966) --- source/ranges.tex | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index c0db50c92b..415826deeb 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -9660,26 +9660,21 @@ \item If the type of \tcode{E} is a (possibly cv-qualified) specialization of \tcode{reverse_view}, - equivalent to \tcode{E.base()}. + then \tcode{E.base()}. \item Otherwise, if the type of \tcode{E} is \cv{} \tcode{subrange, reverse_iterator, K>} for some iterator type \tcode{I} and value \tcode{K} of type \tcode{subrange_kind}, \begin{itemize} \item - if \tcode{K} is \tcode{subrange_kind::sized}, equivalent to: -\begin{codeblock} -subrange(E.end().base(), E.begin().base(), E.size()) -\end{codeblock} + if \tcode{K} is \tcode{subrange_kind::sized}, then +\tcode{subrange(E.end().base(), E.begin().base(), E.size())}; \item - otherwise, equivalent to: -\begin{codeblock} -subrange(E.end().base(), E.begin().base()) -\end{codeblock} + otherwise, \tcode{subrange(E.end().base(), E.begin().base())}. \end{itemize} However, in either case \tcode{E} is evaluated only once. \item - Otherwise, equivalent to \tcode{reverse_view\{E\}}. + Otherwise, \tcode{reverse_view\{E\}}. \end{itemize} \pnum From be18ecc17114bcae4acdad10a3467686510b22c2 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 11 May 2024 21:51:48 +0200 Subject: [PATCH 032/162] [class.derived.general] Restore accidental reversal of P2662R3 change P2662R3 contained a rename of the grammar production "class-or-decltype" to "class-or-computed-type-specifier". That was editorially reverted with commit c831ec0b8aac369aa61ce392783865ff04b84b19, but that commit also accidentally reverted the change from "decltype-specifier" to "computed-type-specifier" as one of the options for "class-or-decltype". This commit restores the latter change, as intended by P2662R3. --- source/classes.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/classes.tex b/source/classes.tex index 1472b94a64..c9da349462 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3381,7 +3381,7 @@ \nontermdef{class-or-decltype}\br \opt{nested-name-specifier} type-name\br nested-name-specifier \keyword{template} simple-template-id\br - decltype-specifier + computed-type-specifier \end{bnf} \indextext{specifier access|see{access specifier}}% From 9dcff41d2d26577c2ec0643056187a0f8094832e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 12 May 2024 15:24:43 +0100 Subject: [PATCH 033/162] [intro.refs] Fix document titles --- source/intro.tex | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/source/intro.tex b/source/intro.tex index 506c912ee4..b43a1e474d 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -36,24 +36,20 @@ \item ISO/IEC 2382, \doccite{Information technology --- Vocabulary} \item ISO 8601-1:2019, \doccite{Date and time --- Representations for information interchange --- Part 1: Basic rules} \item \IsoC{}, \doccite{Information technology --- Programming languages --- C} -\item ISO/IEC/IEEE 9945:2009, \doccite{Information Technology --- Portable -Operating System Interface (POSIX -\begin{footnote} +\item ISO/IEC/IEEE 9945:2009, \doccite{Information Technology --- Portable Operating System Interface\begin{footnote} POSIX\textregistered\ is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc. This information is given for the convenience of users of this document and does not constitute an endorsement by ISO or IEC of this product. \end{footnote}% -)} -\item ISO/IEC/IEEE 9945:2009/Cor 1:2013, \doccite{Information Technology --- Portable -Operating System Interface (POSIX), Technical Corrigendum 1} -\item ISO/IEC/IEEE 9945:2009/Cor 2:2017, \doccite{Information Technology --- Portable -Operating System Interface (POSIX), Technical Corrigendum 2} -\item ISO/IEC/IEEE 60559:2020, \doccite{Information technology --- -Microprocessor Systems --- Floating-Point arithmetic} -\item ISO 80000-2:2009, \doccite{Quantities and units --- -Part 2: Mathematical signs and symbols -to be used in the natural sciences and technology} +(POSIX\textregistered) Base Specifications, Issue 7} +\item ISO/IEC/IEEE 9945:2009/Cor 1:2013, \doccite{Information Technology --- Portable Operating System Interface +(POSIX\textregistered) Base Specifications, Issue 7 --- Technical Corrigendum 1} +\item ISO/IEC/IEEE 9945:2009/Cor 2:2017, \doccite{Information Technology --- Portable Operating System Interface +(POSIX\textregistered) Base Specifications, Issue 7 --- Technical Corrigendum 2} +\item ISO/IEC 60559:2020, \doccite{Information technology --- Microprocessor Systems --- Floating-Point arithmetic} +\item ISO 80000-2:2009, \doccite{Quantities and units --- Part 2: +Mathematical signs and symbols to be used in the natural sciences and technology} % Other international standards. \item Ecma International, \doccite{ECMAScript \begin{footnote} From 5b332fed1a4577ad08ed469da26c9c7864ea9e11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 12 May 2024 15:31:43 +0100 Subject: [PATCH 034/162] [intro.refs, intro.defs] Update ISO 80000-2:2009 to :2019, change "and" to comma --- source/intro.tex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/intro.tex b/source/intro.tex index b43a1e474d..bf976a7246 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -48,8 +48,7 @@ \item ISO/IEC/IEEE 9945:2009/Cor 2:2017, \doccite{Information Technology --- Portable Operating System Interface (POSIX\textregistered) Base Specifications, Issue 7 --- Technical Corrigendum 2} \item ISO/IEC 60559:2020, \doccite{Information technology --- Microprocessor Systems --- Floating-Point arithmetic} -\item ISO 80000-2:2009, \doccite{Quantities and units --- Part 2: -Mathematical signs and symbols to be used in the natural sciences and technology} +\item ISO 80000-2:2019, \doccite{Quantities and units --- Part 2: Mathematics} % Other international standards. \item Ecma International, \doccite{ECMAScript \begin{footnote} @@ -72,7 +71,7 @@ \indextext{definitions|(}% For the purposes of this document, the terms and definitions -given in ISO/IEC 2382 and ISO 80000-2:2009, +given in ISO/IEC 2382, ISO 80000-2:2019, and the following apply. \pnum From 85f4bb454effe50029de636d6f206f9c1153236a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 12 May 2024 15:53:11 +0100 Subject: [PATCH 035/162] [defns.order.ptr] Add missing hypen in "built-in" --- source/intro.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/intro.tex b/source/intro.tex index bf976a7246..2058956582 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -321,7 +321,7 @@ \impldef{strict total order over pointer values} strict total ordering over all pointer values such that the ordering is consistent with the partial order -imposed by the builtin operators +imposed by the built-in operators \tcode{<}, \tcode{>}, \tcode{<=}, \tcode{>=}, and \tcode{<=>} \indexdefn{limits!implementation}% From 9cd8d6ce9cc446c94d91e1350b9113906774f0af Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Tue, 14 May 2024 21:49:55 +0800 Subject: [PATCH 036/162] [format.context] Fix error in example (#6970) --- source/utilities.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index f856a423b4..d3f5015061 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -17713,12 +17713,13 @@ // Parses a width argument id in the format \tcode{\{} \fmtgrammarterm{digit} \tcode{\}}. constexpr auto parse(format_parse_context& ctx) { auto iter = ctx.begin(); + auto is_digit = [](auto c) { return c >= '0' && c <= '9'; }; auto get_char = [&]() { return iter != ctx.end() ? *iter : 0; }; if (get_char() != '{') return iter; ++iter; char c = get_char(); - if (!isdigit(c) || (++iter, get_char()) != '}') + if (!is_digit(c) || (++iter, get_char()) != '}') throw format_error("invalid format"); width_arg_id = c - '0'; ctx.check_arg_id(width_arg_id); @@ -17735,7 +17736,7 @@ else return value; }); - return format_to(ctx.out(), "{0:x<{1}}", s.value, width); + return format_to(ctx.out(), "{0:x>{1}}", s.value, width); } }; From 951ded4880e4295981c0d691915a81d84c2baa9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 12 May 2024 16:01:09 +0100 Subject: [PATCH 037/162] [defns.unblock] Italicize entire term "blocked", not just "block". ISO has indicated that this is the acceptable way to state a reference to another definition, in this case "block" [defns.block]. --- source/intro.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/intro.tex b/source/intro.tex index 2058956582..f2cef31ff0 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -624,7 +624,7 @@ \indexdefn{unblock}% \definition{unblock}{defns.unblock} -satisfy a condition that one or more \termref{defns.block}{block}{ed} threads of execution are waiting for +satisfy a condition that one or more \termref{defns.block}{blocked}{} threads of execution are waiting for \indexdefn{behavior!undefined}% \definition{undefined behavior}{defns.undefined} From 1cb3842f83412720a23c664f478a4167cb3162a2 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 14 May 2024 18:52:30 +0200 Subject: [PATCH 038/162] [styles] Redesign Annex titles per Rice Model Standard Fixes ISO/CS comment (C++23 proof) --- source/std.tex | 1 + source/styles.tex | 18 ++++++++++++++---- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/source/std.tex b/source/std.tex index c97d4302bd..f269c5e8f7 100644 --- a/source/std.tex +++ b/source/std.tex @@ -137,6 +137,7 @@ %%-------------------------------------------------- %% appendices \appendix +\chapterstyle{cppannex} % \include and \addtocontents don't mix; see % https://tex.stackexchange.com/questions/13914/toc-numbering-problem diff --git a/source/styles.tex b/source/styles.tex index 8d771e10db..76541f69a8 100644 --- a/source/styles.tex +++ b/source/styles.tex @@ -5,11 +5,11 @@ % footnotes %%-------------------------------------------------- -%% create chapter style +%% create chapter styles \makechapterstyle{cppstd}{% - \renewcommand{\beforechapskip}{\onelineskip} - \renewcommand{\afterchapskip}{\onelineskip} + \setlength{\beforechapskip}{\onelineskip} + \setlength{\afterchapskip}{\onelineskip} \renewcommand{\chapternamenum}{} \renewcommand{\chapnamefont}{\chaptitlefont} \renewcommand{\chapnumfont}{\chaptitlefont} @@ -17,6 +17,16 @@ \renewcommand{\afterchapternum}{} } +\makechapterstyle{cppannex}{% + \setlength{\beforechapskip}{\onelineskip} + \setlength{\afterchapskip}{\onelineskip} + \renewcommand{\chapternamenum}{} + \renewcommand{\chapnamefont}{\chaptitlefont} + \renewcommand{\chapnumfont}{\chaptitlefont} + \renewcommand{\printchapternum}{\chapnumfont\centering\thechapter\protect\\} + \renewcommand{\afterchapternum}{} +} + %%-------------------------------------------------- %% create page styles @@ -86,7 +96,7 @@ %%-------------------------------------------------- % set heading style for annexes -\newcommand{\Annex}[3]{\chapter[#2]{(#3)\protect\\#2\hfill[#1]}\relax\annexlabel{#1}} +\newcommand{\Annex}[3]{\chapter[#2]{\textnormal{(#3)}\protect\\[3ex]#2\hfill[#1]}\relax\annexlabel{#1}} \newcommand{\infannex}[2]{\addxref{#1}\Annex{#1}{#2}{informative}} \newcommand{\normannex}[2]{\addxref{#1}\Annex{#1}{#2}{normative}} From 2f23560744a966f7a455629506468a02055d53ea Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Mon, 20 May 2024 05:52:26 -0400 Subject: [PATCH 039/162] [alg.ends.with] Replace drop_view with views::drop (#6773) --- source/algorithms.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 58377c00dd..ed658e1650 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -4682,7 +4682,7 @@ \returns \tcode{false} if $\tcode{N1} < \tcode{N2}$, otherwise \begin{codeblock} -ranges::equal(ranges::drop_view(ranges::ref_view(r1), N1 - N2), r2, pred, proj1, proj2) +ranges::equal(views::drop(ranges::ref_view(r1), N1 - N2), r2, pred, proj1, proj2) \end{codeblock} \end{itemdescr} From bbac8a98d303d3ad5ecd9514fb2db37745d16984 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Mon, 20 May 2024 07:24:27 -0400 Subject: [PATCH 040/162] [dcl.init.list] Eliminate "specialization of initializer_list" (#6258) --- source/declarations.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/declarations.tex b/source/declarations.tex index 2079217bac..4034565e2b 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -5984,7 +5984,7 @@ \item Otherwise, if the initializer list has no elements and \tcode{T} is a class type with a default constructor, the object is value-initialized. -\item Otherwise, if \tcode{T} is a specialization of \tcode{std::initializer_list}, +\item Otherwise, if \tcode{T} is a specialization of \tcode{std::initializer_list}, the object is constructed as described below. \item Otherwise, if \tcode{T} is a class type, constructors are considered. From ad37b863dec4af4c88d8f2154d5f3e4a9b2a3b33 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Tue, 21 May 2024 07:12:32 -0400 Subject: [PATCH 041/162] [support.initlist] "initializer list" should be "initializer_list" (#6680) This note is talking about the class type, not the grammatical construct. --- source/support.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/support.tex b/source/support.tex index 9924cbdabd..dda0ca29bd 100644 --- a/source/support.tex +++ b/source/support.tex @@ -4139,7 +4139,7 @@ A pair of pointers or a pointer plus a length would be obvious representations for \tcode{initializer_list}. \tcode{initializer_list} is used to implement initializer lists as specified -in~\ref{dcl.init.list}. Copying an initializer list does not copy the underlying +in~\ref{dcl.init.list}. Copying an \tcode{initializer_list} does not copy the underlying elements. \end{note} From 2e455af5d6a2bdaac7e9d0d4e7f23ac7a6c0451d Mon Sep 17 00:00:00 2001 From: zhihaoy <43971430+zhihaoy@users.noreply.github.com> Date: Tue, 21 May 2024 22:50:56 -0700 Subject: [PATCH 042/162] [util.smartptr.shared.cast] Properly describe possibility of double deletion in notes (#7037) --- source/memory.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/memory.tex b/source/memory.tex index 1a80d14ed0..9c78a3bf7a 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -4356,7 +4356,7 @@ \begin{note} The seemingly equivalent expression \tcode{shared_ptr(static_cast(r.get()))} -will eventually result in undefined behavior, attempting to delete the +can result in undefined behavior, attempting to delete the same object twice. \end{note} \end{itemdescr} @@ -4393,7 +4393,7 @@ \pnum \begin{note} The seemingly equivalent expression -\tcode{shared_ptr(dynamic_cast(r.get()))} will eventually result in +\tcode{shared_ptr(dynamic_cast(r.get()))} can result in undefined behavior, attempting to delete the same object twice. \end{note} \end{itemdescr} @@ -4422,7 +4422,7 @@ \pnum \begin{note} The seemingly equivalent expression -\tcode{shared_ptr(const_cast(r.get()))} will eventually result in +\tcode{shared_ptr(const_cast(r.get()))} can result in undefined behavior, attempting to delete the same object twice. \end{note} \end{itemdescr} @@ -4451,7 +4451,7 @@ \pnum \begin{note} The seemingly equivalent expression -\tcode{shared_ptr(reinterpret_cast(r.get()))} will eventually result in +\tcode{shared_ptr(reinterpret_cast(r.get()))} can result in undefined behavior, attempting to delete the same object twice. \end{note} \end{itemdescr} From 4b3f32ae814c8da3faccc0dc307904bd250371d9 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 28 May 2024 22:10:36 +0100 Subject: [PATCH 043/162] [input.output] Add cross-references to header synopses (#7005) Several of the synopses are not adjacent to the types they declare. Adding cross-references makes it easier to find the relevant definitions of classes and class templates. Also make the title of [ostream.manip] more specific to its content. --- source/iostreams.tex | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 101e063a36..b893c397a9 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -683,11 +683,15 @@ #include // see \ref{iosfwd.syn} namespace std { + // \ref{stream.types}, types using streamoff = @\impdef@; using streamsize = @\impdef@; + // \ref{ios}, class template \tcode{fpos} template class fpos; + // \ref{ios.base}, class \tcode{ios_base} class ios_base; + // \ref{ios}, class template \tcode{basic_ios} template> class basic_ios; @@ -2883,6 +2887,7 @@ \indexlibraryglobal{basic_streambuf}% \begin{codeblock} namespace std { + // \ref{streambuf}, class template \tcode{basic_streambuf} template> class basic_streambuf; using streambuf = basic_streambuf; @@ -4147,21 +4152,25 @@ \indexheader{istream}% \begin{codeblock} namespace std { + // \ref{istream}, class template \tcode{basic_istream} template> class basic_istream; using istream = basic_istream; using wistream = basic_istream; + // \ref{iostreamclass}, class template \tcode{basic_iostream} template> class basic_iostream; using iostream = basic_iostream; using wiostream = basic_iostream; + // \ref{istream.manip}, standard \tcode{basic_istream} manipulators template basic_istream& ws(basic_istream& is); + // \ref{istream.rvalue}, rvalue stream extraction template Istream&& operator>>(Istream&& is, T&& x); } @@ -4177,12 +4186,14 @@ \indexheader{ostream}% \begin{codeblock} namespace std { + // \ref{ostream}, class template \tcode{basic_ostream} template> class basic_ostream; using ostream = basic_ostream; using wostream = basic_ostream; + // \ref{ostream.manip}, standard \tcode{basic_ostream} manipulators template basic_ostream& endl(basic_ostream& os); template @@ -4197,6 +4208,7 @@ template basic_ostream& flush_emit(basic_ostream& os); + // \ref{ostream.rvalue}, rvalue stream insertion template Ostream&& operator<<(Ostream&& os, const T& x); @@ -4222,17 +4234,21 @@ \indexheader{iomanip}% \begin{codeblock} namespace std { + // \ref{std.manip}, standard manipulators @\unspec@ resetiosflags(ios_base::fmtflags mask); @\unspec@ setiosflags (ios_base::fmtflags mask); @\unspec@ setbase(int base); template @\unspec@ setfill(charT c); @\unspec@ setprecision(int n); @\unspec@ setw(int n); + + // \ref{ext.manip}, extended manipulators template @\unspec@ get_money(moneyT& mon, bool intl = false); template @\unspec@ put_money(const moneyT& mon, bool intl = false); template @\unspec@ get_time(tm* tmb, const charT* fmt); template @\unspec@ put_time(const tm* tmb, const charT* fmt); + // \ref{quoted.manip}, quoted manipulators template @\unspec@ quoted(const charT* s, charT delim = charT('"'), charT escape = charT('\\')); @@ -7015,7 +7031,7 @@ \tcode{*this}. \end{itemdescr} -\rSec3[ostream.manip]{Standard manipulators} +\rSec3[ostream.manip]{Standard \tcode{basic_ostream} manipulators} \pnum Each instantiation of any of the function templates @@ -7956,6 +7972,7 @@ \indexlibraryglobal{basic_stringstream}% \begin{codeblock} namespace std { + // \ref{stringbuf}, class template \tcode{basic_stringbuf} template, class Allocator = allocator> class basic_stringbuf; @@ -7967,6 +7984,7 @@ using stringbuf = basic_stringbuf; using wstringbuf = basic_stringbuf; + // \ref{istringstream}, class template \tcode{basic_istringstream} template, class Allocator = allocator> class basic_istringstream; @@ -7978,6 +7996,7 @@ using istringstream = basic_istringstream; using wistringstream = basic_istringstream; + // \ref{ostringstream}, class template \tcode{basic_ostringstream} template, class Allocator = allocator> class basic_ostringstream; @@ -7989,6 +8008,7 @@ using ostringstream = basic_ostringstream; using wostringstream = basic_ostringstream; + // \ref{stringstream}, class template \tcode{basic_stringstream} template, class Allocator = allocator> class basic_stringstream; @@ -10022,6 +10042,7 @@ \indexlibraryglobal{wspanstream}% \begin{codeblock} namespace std { + // \ref{spanbuf}, class template \tcode{basic_spanbuf} template> class basic_spanbuf; @@ -10031,6 +10052,7 @@ using spanbuf = basic_spanbuf; using wspanbuf = basic_spanbuf; + // \ref{ispanstream}, class template \tcode{basic_ispanstream} template> class basic_ispanstream; @@ -10040,6 +10062,7 @@ using ispanstream = basic_ispanstream; using wispanstream = basic_ispanstream; + // \ref{ospanstream}, class template \tcode{basic_ospanstream} template> class basic_ospanstream; @@ -10049,6 +10072,7 @@ using ospanstream = basic_ospanstream; using wospanstream = basic_ospanstream; + // \ref{spanstream}, class template \tcode{basic_spanstream} template> class basic_spanstream; @@ -10876,6 +10900,7 @@ \indexlibraryglobal{basic_fstream}% \begin{codeblock} namespace std { + // \ref{filebuf}, class template \tcode{basic_filebuf} template> class basic_filebuf; @@ -10885,6 +10910,7 @@ using filebuf = basic_filebuf; using wfilebuf = basic_filebuf; + // \ref{ifstream}, class template \tcode{basic_ifstream} template> class basic_ifstream; @@ -10894,6 +10920,7 @@ using ifstream = basic_ifstream; using wifstream = basic_ifstream; + // \ref{ofstream}, class template \tcode{basic_ofstream} template> class basic_ofstream; @@ -10903,6 +10930,7 @@ using ofstream = basic_ofstream; using wofstream = basic_ofstream; + // \ref{fstream}, class template \tcode{basic_fstream} template> class basic_fstream; @@ -12561,6 +12589,7 @@ #include // see \ref{ostream.syn} namespace std { + // \ref{syncstream.syncbuf}, class template \tcode{basic_syncbuf} template, class Allocator = allocator> class basic_syncbuf; @@ -12572,6 +12601,7 @@ using syncbuf = basic_syncbuf; using wsyncbuf = basic_syncbuf; + // \ref{syncstream.osyncstream}, class template \tcode{basic_osyncstream} template, class Allocator = allocator> class basic_osyncstream; From b80d3826c3807329c5b938f0cce1ca377eb1dd84 Mon Sep 17 00:00:00 2001 From: Jan Schultke Date: Tue, 4 Jun 2024 23:09:40 +0200 Subject: [PATCH 044/162] [defns.erroneous,basic.indet] Index 'erroneous behavior' and 'erroneous value' (#7044) --- source/basic.tex | 4 +--- source/intro.tex | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index f33d0dc648..d6b58e4464 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -3748,8 +3748,6 @@ \rSec2[basic.indet]{Indeterminate and erroneous values} \pnum -\indextext{value!indeterminate}% -\indextext{indeterminate value}% When storage for an object with automatic or dynamic storage duration is obtained, the bytes comprising the storage for the object @@ -3762,7 +3760,7 @@ the \tcode{[[indeterminate]]} attribute\iref{dcl.attr.indet}, the bytes have \defnadjx{indeterminate}{values}{value}; \item -otherwise, the bytes have erroneous values, +otherwise, the bytes have \defnadjx{erroneous}{values}{value}, where each value is determined by the implementation independently of the state of the program. \end{itemize} diff --git a/source/intro.tex b/source/intro.tex index f2cef31ff0..2435b4fbd6 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -248,6 +248,7 @@ \definition{dynamic type}{defns.dynamic.type.prvalue} \defncontext{prvalue} \termref{defns.static.type}{static type}{} of the prvalue expression +\indexdefn{behavior!erroneous}% \definition{erroneous behavior}{defns.erroneous} well-defined behavior that the implementation is recommended to diagnose \begin{defnote} From dbf17528619707307f859bac1b36c52654fecfc8 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Mon, 10 Jun 2024 17:06:15 -0400 Subject: [PATCH 045/162] [container.adaptors] Reorder constructors for flat_* adaptors (#6274) Canonicalize the ordering of the constructors for the flat_* adaptors: - default constructor is first - each overload without `key_compare` is followed by the corresponding one with `key_compare` - each pair of overloads without `sorted_unique` is followed by the corresponding pair with `sorted_unique` --- source/containers.tex | 848 +++++++++++++++++++++--------------------- 1 file changed, 414 insertions(+), 434 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index c2d1113887..e5a33d6a26 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -15207,87 +15207,89 @@ mapped_container_type values; }; - // \ref{flat.map.cons}, construct/copy/destroy + // \ref{flat.map.cons}, constructors flat_map() : flat_map(key_compare()) { } - template - flat_map(const flat_map&, const Allocator& a); - template - flat_map(flat_map&&, const Allocator& a); + explicit flat_map(const key_compare& comp) + : c(), compare(comp) { } flat_map(key_container_type key_cont, mapped_container_type mapped_cont, const key_compare& comp = key_compare()); - template - flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const Allocator& a); - template - flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const key_compare& comp, const Allocator& a); flat_map(sorted_unique_t, key_container_type key_cont, mapped_container_type mapped_cont, const key_compare& comp = key_compare()); - template - flat_map(sorted_unique_t, const key_container_type& key_cont, - const mapped_container_type& mapped_cont, const Allocator& a); - template - flat_map(sorted_unique_t, const key_container_type& key_cont, - const mapped_container_type& mapped_cont, - const key_compare& comp, const Allocator& a); - - explicit flat_map(const key_compare& comp) - : c(), compare(comp) { } - template - flat_map(const key_compare& comp, const Allocator& a); - template - explicit flat_map(const Allocator& a); template flat_map(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) : c(), compare(comp) { insert(first, last); } - template - flat_map(InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); - template - flat_map(InputIterator first, InputIterator last, const Allocator& a); + + template + flat_map(sorted_unique_t s, InputIterator first, InputIterator last, + const key_compare& comp = key_compare()) + : c(), compare(comp) { insert(s, first, last); } template<@\exposconcept{container-compatible-range}@ R> flat_map(from_range_t fr, R&& rg) : flat_map(fr, std::forward(rg), key_compare()) { } - template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_map(from_range_t, R&& rg, const Allocator& a); template<@\exposconcept{container-compatible-range}@ R> flat_map(from_range_t, R&& rg, const key_compare& comp) : flat_map(comp) { insert_range(std::forward(rg)); } - template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_map(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); - - template - flat_map(sorted_unique_t s, InputIterator first, InputIterator last, - const key_compare& comp = key_compare()) - : c(), compare(comp) { insert(s, first, last); } - template - flat_map(sorted_unique_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); - template - flat_map(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a); flat_map(initializer_list il, const key_compare& comp = key_compare()) : flat_map(il.begin(), il.end(), comp) { } - template - flat_map(initializer_list il, const key_compare& comp, const Allocator& a); - template - flat_map(initializer_list il, const Allocator& a); flat_map(sorted_unique_t s, initializer_list il, const key_compare& comp = key_compare()) : flat_map(s, il.begin(), il.end(), comp) { } - template + + // \ref{flat.map.cons.alloc}, constructors with allocators + + template + explicit flat_map(const Alloc& a); + template + flat_map(const key_compare& comp, const Alloc& a); + template + flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const Alloc& a); + template + flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const key_compare& comp, const Alloc& a); + template + flat_map(sorted_unique_t, const key_container_type& key_cont, + const mapped_container_type& mapped_cont, const Alloc& a); + template + flat_map(sorted_unique_t, const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const key_compare& comp, const Alloc& a); + template + flat_map(const flat_map&, const Alloc& a); + template + flat_map(flat_map&&, const Alloc& a); + template + flat_map(InputIterator first, InputIterator last, const Alloc& a); + template + flat_map(InputIterator first, InputIterator last, + const key_compare& comp, const Alloc& a); + template + flat_map(sorted_unique_t, InputIterator first, InputIterator last, const Alloc& a); + template + flat_map(sorted_unique_t, InputIterator first, InputIterator last, + const key_compare& comp, const Alloc& a); + template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_map(from_range_t, R&& rg, const Alloc& a); + template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_map(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); + template + flat_map(initializer_list il, const Alloc& a); + template + flat_map(initializer_list il, const key_compare& comp, const Alloc& a); + template + flat_map(sorted_unique_t, initializer_list il, const Alloc& a); + template flat_map(sorted_unique_t, initializer_list il, - const key_compare& comp, const Allocator& a); - template - flat_map(sorted_unique_t, initializer_list il, const Allocator& a); + const key_compare& comp, const Alloc& a); - flat_map& operator=(initializer_list il); + flat_map& operator=(initializer_list); // iterators iterator begin() noexcept; @@ -15546,69 +15548,66 @@ \indexlibraryctor{flat_map}% \begin{itemdecl} -template - flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const Allocator& a); -template - flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const key_compare& comp, const Allocator& a); +flat_map(sorted_unique_t, key_container_type key_cont, mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true} and -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects -Equivalent to \tcode{flat_map(key_cont, mapped_cont)} and -\tcode{flat_map(key_cont, mapped_cont, comp)}, respectively, -except that \tcode{c.keys} and \tcode{c.values} are constructed with -uses-allocator construction\iref{allocator.uses.construction}. +Initializes +\tcode{c.keys} with \tcode{std::move(key_cont)}, +\tcode{c.values} with \tcode{std::move(mapped_cont)}, and +\tcode{compare} with \tcode{comp}. \pnum \complexity -Same as \tcode{flat_map(key_cont, mapped_cont)} and -\tcode{flat_map(key_cont, mapped_cont, comp)}, respectively. +Constant. \end{itemdescr} +\rSec3[flat.map.cons.alloc]{Constructors with allocators} + +\pnum +The constructors in this subclause shall not participate in overload resolution +unless \tcode{uses_allocator_v} is \tcode{true} +and \tcode{uses_allocator_v} is \tcode{true}. + \indexlibraryctor{flat_map}% \begin{itemdecl} -flat_map(sorted_unique_t, key_container_type key_cont, mapped_container_type mapped_cont, - const key_compare& comp = key_compare()); +template + flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const Alloc& a); +template + flat_map(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const key_compare& comp, const Alloc& a); \end{itemdecl} \begin{itemdescr} \pnum \effects -Initializes -\tcode{c.keys} with \tcode{std::move(key_cont)}, -\tcode{c.values} with \tcode{std::move(mapped_cont)}, and -\tcode{compare} with \tcode{comp}. +Equivalent to \tcode{flat_map(key_cont, mapped_cont)} and +\tcode{flat_map(key_cont, mapped_cont, comp)}, respectively, +except that \tcode{c.keys} and \tcode{c.values} are constructed with +uses-allocator construction\iref{allocator.uses.construction}. \pnum \complexity -Constant. +Same as \tcode{flat_map(key_cont, mapped_cont)} and +\tcode{flat_map(key_cont, mapped_cont, comp)}, respectively. \end{itemdescr} \indexlibraryctor{flat_map}% \begin{itemdecl} -template +template flat_map(sorted_unique_t s, const key_container_type& key_cont, - const mapped_container_type& mapped_cont, const Allocator& a); -template + const mapped_container_type& mapped_cont, const Alloc& a); +template flat_map(sorted_unique_t s, const key_container_type& key_cont, const mapped_container_type& mapped_cont, const key_compare& comp, - const Allocator& a); + const Alloc& a); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true} and -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects Equivalent to \tcode{flat_map(s, key_cont, mapped_cont)} and @@ -15623,44 +15622,39 @@ \indexlibraryctor{flat_map}% \begin{itemdecl} -template - flat_map(const flat_map&, const Allocator& a); -template - flat_map(flat_map&&, const Allocator& a); -template - flat_map(const key_compare& comp, const Allocator& a); -template - explicit flat_map(const Allocator& a); -template - flat_map(InputIterator first, InputIterator last, const key_compare& comp, const Allocator& a); -template - flat_map(InputIterator first, InputIterator last, const Allocator& a); -template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_map(from_range_t, R&& rg, const Allocator& a); -template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_map(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); -template +template + explicit flat_map(const Alloc& a); +template + flat_map(const key_compare& comp, const Alloc& a); +template + flat_map(const flat_map&, const Alloc& a); +template + flat_map(flat_map&&, const Alloc& a); +template + flat_map(InputIterator first, InputIterator last, const Alloc& a); +template + flat_map(InputIterator first, InputIterator last, const key_compare& comp, const Alloc& a); +template + flat_map(sorted_unique_t, InputIterator first, InputIterator last, const Alloc& a); +template flat_map(sorted_unique_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); -template - flat_map(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a); -template - flat_map(initializer_list il, const key_compare& comp, const Allocator& a); -template - flat_map(initializer_list il, const Allocator& a); -template + const key_compare& comp, const Alloc& a); +template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_map(from_range_t, R&& rg, const Alloc& a); +template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_map(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); +template + flat_map(initializer_list il, const Alloc& a); +template + flat_map(initializer_list il, const key_compare& comp, const Alloc& a); +template + flat_map(sorted_unique_t, initializer_list il, const Alloc& a); +template flat_map(sorted_unique_t, initializer_list il, - const key_compare& comp, const Allocator& a); -template - flat_map(sorted_unique_t, initializer_list il, const Allocator& a); + const key_compare& comp, const Alloc& a); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true} and -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects Equivalent to the corresponding non-allocator constructors @@ -16396,92 +16390,94 @@ mapped_container_type values; }; - // \ref{flat.multimap.cons}, construct/copy/destroy + // \ref{flat.multimap.cons}, constructors flat_multimap() : flat_multimap(key_compare()) { } - template - flat_multimap(const flat_multimap&, const Allocator& a); - template - flat_multimap(flat_multimap&&, const Allocator& a); + explicit flat_multimap(const key_compare& comp) + : c(), compare(comp) { } flat_multimap(key_container_type key_cont, mapped_container_type mapped_cont, const key_compare& comp = key_compare()); - template - flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const Allocator& a); - template - flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const key_compare& comp, const Allocator& a); flat_multimap(sorted_equivalent_t, key_container_type key_cont, mapped_container_type mapped_cont, const key_compare& comp = key_compare()); - template - flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, - const mapped_container_type& mapped_cont, const Allocator& a); - template - flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, - const mapped_container_type& mapped_cont, - const key_compare& comp, const Allocator& a); - - explicit flat_multimap(const key_compare& comp) - : c(), compare(comp) { } - template - flat_multimap(const key_compare& comp, const Allocator& a); - template - explicit flat_multimap(const Allocator& a); template flat_multimap(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) : c(), compare(comp) { insert(first, last); } - template - flat_multimap(InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); - template - flat_multimap(InputIterator first, InputIterator last, const Allocator& a); + + template + flat_multimap(sorted_equivalent_t s, InputIterator first, InputIterator last, + const key_compare& comp = key_compare()) + : c(), compare(comp) { insert(s, first, last); } template<@\exposconcept{container-compatible-range}@ R> flat_multimap(from_range_t fr, R&& rg) : flat_multimap(fr, std::forward(rg), key_compare()) { } - template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_multimap(from_range_t, R&& rg, const Allocator& a); template<@\exposconcept{container-compatible-range}@ R> flat_multimap(from_range_t, R&& rg, const key_compare& comp) : flat_multimap(comp) { insert_range(std::forward(rg)); } - template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_multimap(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); - - template - flat_multimap(sorted_equivalent_t s, InputIterator first, InputIterator last, - const key_compare& comp = key_compare()) - : c(), compare(comp) { insert(s, first, last); } - template - flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); - template - flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, - const Allocator& a); flat_multimap(initializer_list il, const key_compare& comp = key_compare()) : flat_multimap(il.begin(), il.end(), comp) { } - template - flat_multimap(initializer_list il, const key_compare& comp, - const Allocator& a); - template - flat_multimap(initializer_list il, const Allocator& a); flat_multimap(sorted_equivalent_t s, initializer_list il, const key_compare& comp = key_compare()) : flat_multimap(s, il.begin(), il.end(), comp) { } - template + + // \ref{flat.multimap.cons.alloc}, constructors with allocators + + template + explicit flat_multimap(const Alloc& a); + template + flat_multimap(const key_compare& comp, const Alloc& a); + template + flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const Alloc& a); + template + flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const key_compare& comp, const Alloc& a); + template + flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, + const mapped_container_type& mapped_cont, const Alloc& a); + template + flat_multimap(sorted_equivalent_t, const key_container_type& key_cont, + const mapped_container_type& mapped_cont, + const key_compare& comp, const Alloc& a); + template + flat_multimap(const flat_multimap&, const Alloc& a); + template + flat_multimap(flat_multimap&&, const Alloc& a); + template + flat_multimap(InputIterator first, InputIterator last, const Alloc& a); + template + flat_multimap(InputIterator first, InputIterator last, + const key_compare& comp, const Alloc& a); + template + flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, + const Alloc& a); + template + flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, + const key_compare& comp, const Alloc& a); + template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_multimap(from_range_t, R&& rg, const Alloc& a); + template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_multimap(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); + template + flat_multimap(initializer_list il, const Alloc& a); + template + flat_multimap(initializer_list il, const key_compare& comp, + const Alloc& a); + template + flat_multimap(sorted_equivalent_t, initializer_list il, const Alloc& a); + template flat_multimap(sorted_equivalent_t, initializer_list il, - const key_compare& comp, const Allocator& a); - template - flat_multimap(sorted_equivalent_t, initializer_list il, const Allocator& a); + const key_compare& comp, const Alloc& a); - flat_multimap& operator=(initializer_list il); + flat_multimap& operator=(initializer_list); // iterators iterator begin() noexcept; @@ -16697,69 +16693,66 @@ \indexlibraryctor{flat_multimap}% \begin{itemdecl} -template - flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const Allocator& a); -template - flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, - const key_compare& comp, const Allocator& a); +flat_multimap(sorted_equivalent_t, key_container_type key_cont, mapped_container_type mapped_cont, + const key_compare& comp = key_compare()); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true} and -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects -Equivalent to \tcode{flat_multimap(key_cont, mapped_cont)} and -\tcode{flat_multimap(key_cont, \linebreak{}mapped_cont, comp)}, respectively, -except that \tcode{c.keys} and \tcode{c.values} are constructed -with uses-allocator construction\iref{allocator.uses.construction}. +Initializes +\tcode{c.keys} with \tcode{std::move(key_cont)}, +\tcode{c.values} with \tcode{std::move(mapped_cont)}, and +\tcode{compare} with \tcode{comp}. \pnum \complexity -Same as \tcode{flat_multimap(key_cont, mapped_cont)} and -\tcode{flat_multimap(key_cont, \linebreak{}mapped_cont, comp)}, respectively. +Constant. \end{itemdescr} +\rSec3[flat.multimap.cons.alloc]{Constructors with allocators} + +\pnum +The constructors in this subclause shall not participate in overload resolution +unless \tcode{uses_allocator_v} is \tcode{true} +and \tcode{uses_allocator_v} is \tcode{true}. + \indexlibraryctor{flat_multimap}% \begin{itemdecl} -flat_multimap(sorted_equivalent_t, key_container_type key_cont, mapped_container_type mapped_cont, - const key_compare& comp = key_compare()); +template + flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const Alloc& a); +template + flat_multimap(const key_container_type& key_cont, const mapped_container_type& mapped_cont, + const key_compare& comp, const Alloc& a); \end{itemdecl} \begin{itemdescr} \pnum \effects -Initializes -\tcode{c.keys} with \tcode{std::move(key_cont)}, -\tcode{c.values} with \tcode{std::move(mapped_cont)}, and -\tcode{compare} with \tcode{comp}. +Equivalent to \tcode{flat_multimap(key_cont, mapped_cont)} and +\tcode{flat_multimap(key_cont, \linebreak{}mapped_cont, comp)}, respectively, +except that \tcode{c.keys} and \tcode{c.values} are constructed +with uses-allocator construction\iref{allocator.uses.construction}. \pnum \complexity -Constant. +Same as \tcode{flat_multimap(key_cont, mapped_cont)} and +\tcode{flat_multimap(key_cont, \linebreak{}mapped_cont, comp)}, respectively. \end{itemdescr} \indexlibraryctor{flat_multimap}% \begin{itemdecl} -template +template flat_multimap(sorted_equivalent_t s, const key_container_type& key_cont, - const mapped_container_type& mapped_cont, const Allocator& a); -template + const mapped_container_type& mapped_cont, const Alloc& a); +template flat_multimap(sorted_equivalent_t s, const key_container_type& key_cont, const mapped_container_type& mapped_cont, const key_compare& comp, - const Allocator& a); + const Alloc& a); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true} and -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects Equivalent to \tcode{flat_multimap(s, key_cont, mapped_cont)} and @@ -16774,46 +16767,41 @@ \indexlibraryctor{flat_multimap}% \begin{itemdecl} -template - flat_multimap(const flat_multimap&, const Allocator& a); -template - flat_multimap(flat_multimap&&, const Allocator& a); -template - flat_multimap(const key_compare& comp, const Allocator& a); -template - explicit flat_multimap(const Allocator& a); -template +template + explicit flat_multimap(const Alloc& a); +template + flat_multimap(const key_compare& comp, const Alloc& a); +template + flat_multimap(const flat_multimap&, const Alloc& a); +template + flat_multimap(flat_multimap&&, const Alloc& a); +template + flat_multimap(InputIterator first, InputIterator last, const Alloc& a); +template flat_multimap(InputIterator first, InputIterator last, const key_compare& comp, - const Allocator& a); -template - flat_multimap(InputIterator first, InputIterator last, const Allocator& a); -template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_multimap(from_range_t, R&& rg, const Allocator& a); -template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_multimap(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); -template + const Alloc& a); +template flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); -template + const Alloc& a); +template flat_multimap(sorted_equivalent_t, InputIterator first, InputIterator last, - const Allocator& a); -template - flat_multimap(initializer_list il, const key_compare& comp, const Allocator& a); -template - flat_multimap(initializer_list il, const Allocator& a); -template + const key_compare& comp, const Alloc& a); +template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_multimap(from_range_t, R&& rg, const Alloc& a); +template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_multimap(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); +template + flat_multimap(initializer_list il, const Alloc& a); +template + flat_multimap(initializer_list il, const key_compare& comp, const Alloc& a); +template + flat_multimap(sorted_equivalent_t, initializer_list il, const Alloc& a); +template flat_multimap(sorted_equivalent_t, initializer_list il, - const key_compare& comp, const Allocator& a); -template - flat_multimap(sorted_equivalent_t, initializer_list il, const Allocator& a); + const key_compare& comp, const Alloc& a); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true} and -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects Equivalent to the corresponding non-allocator constructors @@ -16969,79 +16957,81 @@ // \ref{flat.set.cons}, constructors flat_set() : flat_set(key_compare()) { } - template - flat_set(const flat_set&, const Allocator& a); - template - flat_set(flat_set&&, const Allocator& a); + explicit flat_set(const key_compare& comp) + : @\exposid{c}@(), @\exposid{compare}@(comp) { } explicit flat_set(container_type cont, const key_compare& comp = key_compare()); - template - flat_set(const container_type& cont, const Allocator& a); - template - flat_set(const container_type& cont, const key_compare& comp, const Allocator& a); flat_set(sorted_unique_t, container_type cont, const key_compare& comp = key_compare()) : @\exposid{c}@(std::move(cont)), @\exposid{compare}@(comp) { } - template - flat_set(sorted_unique_t, const container_type& cont, const Allocator& a); - template - flat_set(sorted_unique_t, const container_type& cont, - const key_compare& comp, const Allocator& a); - - explicit flat_set(const key_compare& comp) - : @\exposid{c}@(), @\exposid{compare}@(comp) { } - template - flat_set(const key_compare& comp, const Allocator& a); - template - explicit flat_set(const Allocator& a); template flat_set(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) : @\exposid{c}@(), @\exposid{compare}@(comp) { insert(first, last); } - template - flat_set(InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); - template - flat_set(InputIterator first, InputIterator last, const Allocator& a); + + template + flat_set(sorted_unique_t, InputIterator first, InputIterator last, + const key_compare& comp = key_compare()) + : @\exposid{c}@(first, last), @\exposid{compare}@(comp) { } template<@\exposconcept{container-compatible-range}@ R> flat_set(from_range_t fr, R&& rg) : flat_set(fr, std::forward(rg), key_compare()) { } - template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_set(from_range_t, R&& rg, const Allocator& a); template<@\exposconcept{container-compatible-range}@ R> flat_set(from_range_t, R&& rg, const key_compare& comp) : flat_set(comp) { insert_range(std::forward(rg)); } - template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_set(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); - - template - flat_set(sorted_unique_t, InputIterator first, InputIterator last, - const key_compare& comp = key_compare()) - : @\exposid{c}@(first, last), @\exposid{compare}@(comp) { } - template - flat_set(sorted_unique_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); - template - flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a); flat_set(initializer_list il, const key_compare& comp = key_compare()) : flat_set(il.begin(), il.end(), comp) { } - template - flat_set(initializer_list il, const key_compare& comp, const Allocator& a); - template - flat_set(initializer_list il, const Allocator& a); flat_set(sorted_unique_t s, initializer_list il, const key_compare& comp = key_compare()) : flat_set(s, il.begin(), il.end(), comp) { } - template + + // \ref{flat.set.cons.alloc}, constructors with allocators + + template + explicit flat_set(const Alloc& a); + template + flat_set(const key_compare& comp, const Alloc& a); + template + flat_set(const container_type& cont, const Alloc& a); + template + flat_set(const container_type& cont, const key_compare& comp, const Alloc& a); + template + flat_set(sorted_unique_t, const container_type& cont, const Alloc& a); + template + flat_set(sorted_unique_t, const container_type& cont, + const key_compare& comp, const Alloc& a); + template + flat_set(const flat_set&, const Alloc& a); + template + flat_set(flat_set&&, const Alloc& a); + template + flat_set(InputIterator first, InputIterator last, const Alloc& a); + template + flat_set(InputIterator first, InputIterator last, + const key_compare& comp, const Alloc& a); + template + flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Alloc& a); + template + flat_set(sorted_unique_t, InputIterator first, InputIterator last, + const key_compare& comp, const Alloc& a); + template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_set(from_range_t, R&& rg, const Alloc& a); + template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_set(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); + template + flat_set(initializer_list il, const Alloc& a); + template + flat_set(initializer_list il, const key_compare& comp, const Alloc& a); + template + flat_set(sorted_unique_t, initializer_list il, const Alloc& a); + template flat_set(sorted_unique_t, initializer_list il, - const key_compare& comp, const Allocator& a); - template - flat_set(sorted_unique_t, initializer_list il, const Allocator& a); + const key_compare& comp, const Alloc& a); flat_set& operator=(initializer_list); @@ -17226,23 +17216,25 @@ \pnum \complexity -Linear in $N$ if \tcode{cont} is sorted with respect to \exposid{compare} and +Linear in $N$ if \tcode{cont} is already sorted with respect to \exposid{compare} and otherwise $N \log N$, where $N$ is the value of \tcode{cont.size()} before this call. \end{itemdescr} +\rSec3[flat.set.cons.alloc]{Constructors with allocators} + +\pnum +The constructors in this subclause shall not participate in overload resolution +unless \tcode{uses_allocator_v} is \tcode{true}. + \indexlibraryctor{flat_set}% \begin{itemdecl} -template - flat_set(const container_type& cont, const Allocator& a); -template - flat_set(const container_type& cont, const key_compare& comp, const Allocator& a); +template + flat_set(const container_type& cont, const Alloc& a); +template + flat_set(const container_type& cont, const key_compare& comp, const Alloc& a); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects Equivalent to @@ -17257,18 +17249,14 @@ \indexlibraryctor{flat_set}% \begin{itemdecl} -template - flat_set(sorted_unique_t s, const container_type& cont, const Allocator& a); -template +template + flat_set(sorted_unique_t s, const container_type& cont, const Alloc& a); +template flat_set(sorted_unique_t s, const container_type& cont, - const key_compare& comp, const Allocator& a); + const key_compare& comp, const Alloc& a); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects Equivalent to @@ -17283,43 +17271,39 @@ \indexlibraryctor{flat_set}% \begin{itemdecl} -template - flat_set(const flat_set&, const Allocator& a); -template - flat_set(flat_set&&, const Allocator& a); -template - flat_set(const key_compare& comp, const Allocator& a); -template - explicit flat_set(const Allocator& a); -template - flat_set(InputIterator first, InputIterator last, const key_compare& comp, const Allocator& a); -template - flat_set(InputIterator first, InputIterator last, const Allocator& a); -template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_set(from_range_t, R&& rg, const Allocator& a); -template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_set(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); -template +template + explicit flat_set(const Alloc& a); +template + flat_set(const key_compare& comp, const Alloc& a); +template + flat_set(const flat_set&, const Alloc& a); +template + flat_set(flat_set&&, const Alloc& a); +template + flat_set(InputIterator first, InputIterator last, const Alloc& a); +template + flat_set(InputIterator first, InputIterator last, const key_compare& comp, const Alloc& a); +template + flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Alloc& a); +template flat_set(sorted_unique_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); -template - flat_set(sorted_unique_t, InputIterator first, InputIterator last, const Allocator& a); -template - flat_set(initializer_list il, const key_compare& comp, const Allocator& a); -template - flat_set(initializer_list il, const Allocator& a); -template + const key_compare& comp, const Alloc& a); +template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_set(from_range_t, R&& rg, const Alloc& a); +template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_set(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); +template + flat_set(initializer_list il, const Alloc& a); +template + flat_set(initializer_list il, const key_compare& comp, const Alloc& a); +template + flat_set(sorted_unique_t, initializer_list il, const Alloc& a); +template flat_set(sorted_unique_t, initializer_list il, - const key_compare& comp, const Allocator& a); -template - flat_set(sorted_unique_t, initializer_list il, const Allocator& a); + const key_compare& comp, const Alloc& a); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects Equivalent to the corresponding non-allocator constructors @@ -17632,83 +17616,85 @@ // \ref{flat.multiset.cons}, constructors flat_multiset() : flat_multiset(key_compare()) { } - template - flat_multiset(const flat_multiset&, const Allocator& a); - template - flat_multiset(flat_multiset&&, const Allocator& a); + explicit flat_multiset(const key_compare& comp) + : @\exposid{c}@(), @\exposid{compare}@(comp) { } explicit flat_multiset(container_type cont, const key_compare& comp = key_compare()); - template - flat_multiset(const container_type& cont, const Allocator& a); - template - flat_multiset(const container_type& cont, const key_compare& comp, const Allocator& a); flat_multiset(sorted_equivalent_t, container_type cont, const key_compare& comp = key_compare()) : @\exposid{c}@(std::move(cont)), @\exposid{compare}@(comp) { } - template - flat_multiset(sorted_equivalent_t, const container_type& cont, const Allocator& a); - template - flat_multiset(sorted_equivalent_t, const container_type& cont, - const key_compare& comp, const Allocator& a); - - explicit flat_multiset(const key_compare& comp) - : @\exposid{c}@(), @\exposid{compare}@(comp) { } - template - flat_multiset(const key_compare& comp, const Allocator& a); - template - explicit flat_multiset(const Allocator& a); template flat_multiset(InputIterator first, InputIterator last, const key_compare& comp = key_compare()) : @\exposid{c}@(), @\exposid{compare}@(comp) { insert(first, last); } - template - flat_multiset(InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); - template - flat_multiset(InputIterator first, InputIterator last, const Allocator& a); + + template + flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, + const key_compare& comp = key_compare()) + : @\exposid{c}@(first, last), @\exposid{compare}@(comp) { } template<@\exposconcept{container-compatible-range}@ R> flat_multiset(from_range_t fr, R&& rg) : flat_multiset(fr, std::forward(rg), key_compare()) { } - template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_multiset(from_range_t, R&& rg, const Allocator& a); template<@\exposconcept{container-compatible-range}@ R> flat_multiset(from_range_t, R&& rg, const key_compare& comp) : flat_multiset(comp) { insert_range(std::forward(rg)); } - template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); - - template - flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, - const key_compare& comp = key_compare()) - : @\exposid{c}@(first, last), @\exposid{compare}@(comp) { } - template - flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); - template - flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, - const Allocator& a); flat_multiset(initializer_list il, const key_compare& comp = key_compare()) : flat_multiset(il.begin(), il.end(), comp) { } - template - flat_multiset(initializer_list il, const key_compare& comp, - const Allocator& a); - template - flat_multiset(initializer_list il, const Allocator& a); flat_multiset(sorted_equivalent_t s, initializer_list il, const key_compare& comp = key_compare()) : flat_multiset(s, il.begin(), il.end(), comp) { } - template + + // \ref{flat.multiset.cons.alloc}, constructors with allocators + + template + explicit flat_multiset(const Alloc& a); + template + flat_multiset(const key_compare& comp, const Alloc& a); + template + flat_multiset(const container_type& cont, const Alloc& a); + template + flat_multiset(const container_type& cont, const key_compare& comp, const Alloc& a); + template + flat_multiset(sorted_equivalent_t, const container_type& cont, const Alloc& a); + template + flat_multiset(sorted_equivalent_t, const container_type& cont, + const key_compare& comp, const Alloc& a); + template + flat_multiset(const flat_multiset&, const Alloc& a); + template + flat_multiset(flat_multiset&&, const Alloc& a); + template + flat_multiset(InputIterator first, InputIterator last, const Alloc& a); + template + flat_multiset(InputIterator first, InputIterator last, + const key_compare& comp, const Alloc& a); + template + flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, + const Alloc& a); + template + flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, + const key_compare& comp, const Alloc& a); + template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_multiset(from_range_t, R&& rg, const Alloc& a); + template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); + template + flat_multiset(initializer_list il, const Alloc& a); + template + flat_multiset(initializer_list il, const key_compare& comp, + const Alloc& a); + template + flat_multiset(sorted_equivalent_t, initializer_list il, const Alloc& a); + template flat_multiset(sorted_equivalent_t, initializer_list il, - const key_compare& comp, const Allocator& a); - template - flat_multiset(sorted_equivalent_t, initializer_list il, const Allocator& a); + const key_compare& comp, const Alloc& a); flat_multiset& operator=(initializer_list); @@ -17890,23 +17876,25 @@ \pnum \complexity -Linear in $N$ if \tcode{cont} is sorted with respect to \exposid{compare} and +Linear in $N$ if \tcode{cont} is already sorted with respect to \exposid{compare} and otherwise $N \log N$, where $N$ is the value of \tcode{cont.size()} before this call. \end{itemdescr} +\rSec3[flat.multiset.cons.alloc]{Constructors with allocators} + +\pnum +The constructors in this subclause shall not participate in overload resolution +unless \tcode{uses_allocator_v} is \tcode{true}. + \indexlibraryctor{flat_multiset}% \begin{itemdecl} -template - flat_multiset(const container_type& cont, const Allocator& a); -template - flat_multiset(const container_type& cont, const key_compare& comp, const Allocator& a); +template + flat_multiset(const container_type& cont, const Alloc& a); +template + flat_multiset(const container_type& cont, const key_compare& comp, const Alloc& a); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects Equivalent to \tcode{flat_multiset(cont)} and @@ -17922,18 +17910,14 @@ \indexlibraryctor{flat_multiset}% \begin{itemdecl} -template - flat_multiset(sorted_equivalent_t s, const container_type& cont, const Allocator& a); -template +template + flat_multiset(sorted_equivalent_t s, const container_type& cont, const Alloc& a); +template flat_multiset(sorted_equivalent_t s, const container_type& cont, - const key_compare& comp, const Allocator& a); + const key_compare& comp, const Alloc& a); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects Equivalent to \tcode{flat_multiset(s, cont)} and @@ -17948,44 +17932,40 @@ \indexlibraryctor{flat_multiset}% \begin{itemdecl} -template - flat_multiset(const flat_multiset&, const Allocator& a); -template - flat_multiset(flat_multiset&&, const Allocator& a); -template - flat_multiset(const key_compare& comp, const Allocator& a); -template - explicit flat_multiset(const Allocator& a); -template +template + explicit flat_multiset(const Alloc& a); +template + flat_multiset(const key_compare& comp, const Alloc& a); +template + flat_multiset(const flat_multiset&, const Alloc& a); +template + flat_multiset(flat_multiset&&, const Alloc& a); +template + flat_multiset(InputIterator first, InputIterator last, const Alloc& a); +template flat_multiset(InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); -template - flat_multiset(InputIterator first, InputIterator last, const Allocator& a); -template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_multiset(from_range_t, R&& rg, const Allocator& a); -template<@\exposconcept{container-compatible-range}@ R, class Allocator> - flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Allocator& a); -template + const key_compare& comp, const Alloc& a); +template + flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, const Alloc& a); +template flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, - const key_compare& comp, const Allocator& a); -template - flat_multiset(sorted_equivalent_t, InputIterator first, InputIterator last, const Allocator& a); -template - flat_multiset(initializer_list il, const key_compare& comp, const Allocator& a); -template - flat_multiset(initializer_list il, const Allocator& a); -template + const key_compare& comp, const Alloc& a); +template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_multiset(from_range_t, R&& rg, const Alloc& a); +template<@\exposconcept{container-compatible-range}@ R, class Alloc> + flat_multiset(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); +template + flat_multiset(initializer_list il, const Alloc& a); +template + flat_multiset(initializer_list il, const key_compare& comp, const Alloc& a); +template + flat_multiset(sorted_equivalent_t, initializer_list il, const Alloc& a); +template flat_multiset(sorted_equivalent_t, initializer_list il, - const key_compare& comp, const Allocator& a); -template - flat_multiset(sorted_equivalent_t, initializer_list il, const Allocator& a); + const key_compare& comp, const Alloc& a); \end{itemdecl} \begin{itemdescr} -\pnum -\constraints -\tcode{uses_allocator_v} is \tcode{true}. - \pnum \effects Equivalent to the corresponding non-allocator constructors From ae9b2d7481af415076ffdf33d5920e31e5591eb1 Mon Sep 17 00:00:00 2001 From: Jan Schultke Date: Tue, 11 Jun 2024 15:32:36 +0200 Subject: [PATCH 046/162] [res.on.exception.handling] Add cross-reference to [except.spec] (#7058) --- 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 c4eef90633..9e575b57d1 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -3844,7 +3844,7 @@ Destructor operations defined in the \Cpp{} standard library shall not throw exceptions. Every destructor in the \Cpp{} standard library shall behave as if it had a -non-throwing exception specification. +non-throwing exception specification\iref{except.spec}. \pnum Functions defined in the From 2049d3b164d2c420e9e24c85a7ab7484f7521a44 Mon Sep 17 00:00:00 2001 From: Brian Bi Date: Tue, 11 Jun 2024 09:45:51 -0400 Subject: [PATCH 047/162] [tables] Add \hypertarget before table captions (#7056) --- source/tables.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/tables.tex b/source/tables.tex index c1f20586f0..7bbd34d2d7 100644 --- a/source/tables.tex +++ b/source/tables.tex @@ -48,6 +48,7 @@ % floattablebase without TableBase, used for lib2dtab2base \newenvironment{floattablebasex}[4] { + \protect\hypertarget{tab:#2}{} \begin{table}[#4] \caption{\label{tab:#2}#1 \quad [tab:#2]} \begin{center} @@ -196,6 +197,7 @@ \newenvironment{LongTable}[3] { \newcommand{\continuedcaption}{\caption[]{#1 (continued)}} + \protect\hypertarget{tab:#2}{} \begin{TableBase} \begin{longtable}{|#3|} \caption{#1 \quad [tab:#2]}\label{tab:#2} From fd284f1f06abbf339afa4bfee140cf9d9c67990b Mon Sep 17 00:00:00 2001 From: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> Date: Tue, 11 Jun 2024 22:35:48 +0200 Subject: [PATCH 048/162] [flat.set.defn] Fix indentation (#7059) --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index e5a33d6a26..4ee0f4c379 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -17022,7 +17022,7 @@ template<@\exposconcept{container-compatible-range}@ R, class Alloc> flat_set(from_range_t, R&& rg, const Alloc& a); template<@\exposconcept{container-compatible-range}@ R, class Alloc> - flat_set(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); + flat_set(from_range_t, R&& rg, const key_compare& comp, const Alloc& a); template flat_set(initializer_list il, const Alloc& a); template From c95ff039b634388962e1fa242e772da8466d49b6 Mon Sep 17 00:00:00 2001 From: Jan Schultke Date: Wed, 12 Jun 2024 12:36:02 +0200 Subject: [PATCH 049/162] [stmt.if] Add missing comma after conditional clause (#7061) --- source/statements.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/statements.tex b/source/statements.tex index 2b6bde2f3a..e3bf29b977 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -267,7 +267,7 @@ \indextext{statement!\idxcode{if}} \pnum -If the condition\iref{stmt.pre} yields \tcode{true} the first +If the condition\iref{stmt.pre} yields \tcode{true}, the first substatement is executed. If the \keyword{else} part of the selection statement is present and the condition yields \tcode{false}, the second substatement is executed. If the first substatement is reached via a From 42a38b072a471a112720535c087d96c8f4865a47 Mon Sep 17 00:00:00 2001 From: Jan Schultke Date: Wed, 12 Jun 2024 18:56:14 +0200 Subject: [PATCH 050/162] [stmt.pre] Add a cross-reference to [intro.execution] (#7060) --- source/statements.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/statements.tex b/source/statements.tex index e3bf29b977..0d8ae2a439 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -9,7 +9,7 @@ \rSec1[stmt.pre]{Preamble} \pnum -Except as indicated, statements are executed in sequence. +Except as indicated, statements are executed in sequence\iref{intro.execution}. \begin{bnf} \nontermdef{statement}\br From 3680e10a5a7eb48b35f150429ce6b3313583bb87 Mon Sep 17 00:00:00 2001 From: Jan Schultke Date: Fri, 14 Jun 2024 12:48:46 +0200 Subject: [PATCH 051/162] [class.virtual] Add commas (#7062) --- source/classes.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index c9da349462..053f9217b0 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3705,13 +3705,13 @@ determining overriding. \end{footnote} $F$. -For convenience we say that any virtual function overrides itself. +For convenience, we say that any virtual function overrides itself. \indextext{overrider!final}% A virtual member function $V$ of a class object $S$ is a \defn{final overrider} unless the most derived class\iref{intro.object} of which $S$ is a base class subobject (if any) has another member function that overrides $V$. In a derived class, if a virtual member function of a base class subobject -has more than one final overrider the program is ill-formed. +has more than one final overrider, the program is ill-formed. \begin{example} \begin{codeblock} struct A { From 9ad7d63f8db28c88dfa68866d23c5ab742be3f80 Mon Sep 17 00:00:00 2001 From: Antony Polukhin Date: Tue, 18 Jun 2024 19:00:34 +0300 Subject: [PATCH 052/162] [associative.reqmts.general] Fix typo (#7069) --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 4ee0f4c379..6e38b932a0 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -2636,7 +2636,7 @@ \tcode{a2} denotes a value of a type with nodes compatible with type \tcode{X} (\tref{container.node.compat}), \item -\tcode{b} denotes a value or type \tcode{X} or \tcode{const X}, +\tcode{b} denotes a value of type \tcode{X} or \tcode{const X}, \item \tcode{u} denotes the name of a variable being declared, \item From a24620eced94b1f04fcbd8add49f5e9ca6326ed4 Mon Sep 17 00:00:00 2001 From: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> Date: Fri, 21 Jun 2024 12:36:01 +0200 Subject: [PATCH 053/162] [class.union.general] Add comma (#7072) --- source/classes.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/classes.tex b/source/classes.tex index 053f9217b0..873bebee75 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3069,7 +3069,7 @@ base classes. A union shall not be used as a base class. \indextext{restriction!\idxcode{union}}% If a union contains a non-static data member of -reference type the program is ill-formed. +reference type, the program is ill-formed. \begin{note} Absent default member initializers\iref{class.mem}, if any non-static data member of a union has a non-trivial From 59e634a8a841f58efeac873459bedf28928a83f9 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Wed, 26 Jun 2024 11:53:47 +0200 Subject: [PATCH 054/162] [func.require] Add missing formatting of subscript index (#7071) --- source/utilities.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index d3f5015061..78e28e7ab5 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -10825,7 +10825,7 @@ \item \tcode{(t$_1$.*f)(t$_2$, $\dotsc$, t$_N$)} when \tcode{f} is a pointer to a member function of a class \tcode{T} and -\tcode{is_same_v> ||} +\tcode{is_same_v> ||} \tcode{is_base_of_v>} is \tcode{true}; \item \tcode{(t$_1$.get().*f)(t$_2$, $\dotsc$, t$_N$)} when \tcode{f} is a pointer to a @@ -10839,7 +10839,7 @@ \item \tcode{t$_1$.*f} when $N = 1$ and \tcode{f} is a pointer to data member of a class \tcode{T} and -\tcode{is_same_v> ||} +\tcode{is_same_v> ||} \tcode{is_base_of_v>} is \tcode{true}; \item \tcode{t$_1$.get().*f} when $N = 1$ and \tcode{f} is a pointer to From 2fffbb2f31b127233658392b6ff5f3d06429d211 Mon Sep 17 00:00:00 2001 From: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> Date: Fri, 28 Jun 2024 14:11:41 +0200 Subject: [PATCH 055/162] [default.allocator.general] Fix indentation (#7075) --- source/memory.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/memory.tex b/source/memory.tex index 9c78a3bf7a..088382414a 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -1673,7 +1673,7 @@ \begin{codeblock} namespace std { template class allocator { - public: + public: using value_type = T; using size_type = size_t; using difference_type = ptrdiff_t; From 6d67d200863e430650047adb651324bc5663b6fc Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 14 May 2024 13:13:42 +0200 Subject: [PATCH 056/162] [diff] Mark examples as such Fixes ISO/CS comment (C++23 proof) --- source/compatibility.tex | 262 ++++++++++++++++++++++++++------------- 1 file changed, 176 insertions(+), 86 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index e3ff48606f..9d7f7cd3bc 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -23,7 +23,7 @@ A valid \CppXXIII{} program that performs operations mixing a value of an enumeration type and a value of a different enumeration type or of a floating-point type is ill-formed. -For example: +\begin{example} \begin{codeblock} enum E1 { e }; enum E2 { f }; @@ -31,6 +31,7 @@ int k = f - e; // ill-formed; previously well-formed auto x = true ? e : f; // ill-formed; previously well-formed \end{codeblock} +\end{example} \rSec2[diff.cpp23.dcl.dcl]{\ref{dcl.dcl}: Declarations} @@ -44,13 +45,14 @@ Valid \CppXXIII{} code that relies on the result of pointer comparison between backing arrays may change behavior. -For example: +\begin{example} \begin{codeblock} bool ne(std::initializer_list a, std::initializer_list b) { return a.begin() != b.begin() + 1; } bool b = ne({2,3}, {1,2,3}); // unspecified result; previously \tcode{false} \end{codeblock} +\end{example} \diffref{dcl.array} \change @@ -61,7 +63,7 @@ \effect Valid \CppXXIII{} code that declares a pack of parameters without specifying a \grammarterm{declarator-id} becomes ill-formed. -For example: +\begin{example} \begin{codeblock} template void f(T... [1]); @@ -72,6 +74,7 @@ g(nullptr, nullptr); // ok } \end{codeblock} +\end{example} \rSec2[diff.cpp23.library]{\ref{library}: library introduction} @@ -101,12 +104,13 @@ \effect \tcode{to_string} and \tcode{to_wstring} function calls that take floating-point arguments may produce a different output. -For example: +\begin{example} \begin{codeblock} auto s = std::to_string(1e-7); // \tcode{"1e-07"} // previously \tcode{"0.000000"} with \tcode{'.'} possibly // changed according to the global C locale \end{codeblock} +\end{example} \rSec2[diff.cpp23.containers]{\ref{containers}: containers library} @@ -118,7 +122,7 @@ \effect Valid \CppXXIII{} code that relies on the lack of this constructor may refuse to compile, or change behavior in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} void one(pair); // \#1 void one(span); // \#2 @@ -132,6 +136,7 @@ any b[10]; int y = span{b, b + 10}.size(); // \tcode{y} is \tcode{2}; previously \tcode{10} \end{codeblock} +\end{example} \rSec2[diff.cpp23.depr]{\ref{depr}: compatibility features} @@ -144,7 +149,8 @@ would not use the one from the allocator base class. \effect It is simpler to correctly define an allocator class with an allocator base -class. For example: +class. +\begin{example} \begin{codeblock} template struct MyAlloc : allocator { @@ -154,6 +160,7 @@ static_assert(!allocator_traits>::is_always_equal); // Error in \CppXXIII{}, // OK in \CppXXVI{} \end{codeblock} +\end{example} \nodiffref \change @@ -266,10 +273,11 @@ Concatenation of \grammarterm{string-literal}s with different \grammarterm{encoding-prefix}es is now ill-formed. -For example: +\begin{example} \begin{codeblock} auto c = L"a" U"b"; // was conditionally-supported; now ill-formed \end{codeblock} +\end{example} \rSec2[diff.cpp20.expr]{\ref{expr}: expressions} @@ -281,11 +289,12 @@ \effect Valid \CppXX{} code that relies on a returned \grammarterm{id-expression}'s being an lvalue may change behavior or fail to compile. -For example: +\begin{example} \begin{codeblock} decltype(auto) f(int&& x) { return (x); } // returns \tcode{int\&\&}; previously returned \tcode{int\&} int& g(int&& x) { return x; } // ill-formed; previously well-formed \end{codeblock} +\end{example} \diffref{expr.sub} \change @@ -295,11 +304,12 @@ \effect Valid \CppXX{} code that uses a comma expression within a subscript expression may fail to compile. -For example: +\begin{example} \begin{codeblock} arr[1, 2] // was equivalent to \tcode{arr[(1, 2)]}, // now equivalent to \tcode{arr.operator[](1, 2)} or ill-formed \end{codeblock} +\end{example} \rSec2[diff.cpp20.stmt]{\ref{stmt.stmt}: statements} @@ -311,7 +321,7 @@ Improve usability of the range-based \keyword{for} statement. \effect Destructors of some temporary objects are invoked later. -For example: +\begin{example} \begin{codeblock} void f() { std::vector v = { 42, 17, 13 }; @@ -323,6 +333,7 @@ } } \end{codeblock} +\end{example} \rSec2[diff.cpp20.dcl]{\ref{dcl.dcl}: declarations} @@ -337,7 +348,7 @@ may now be initialized with a UTF-8 string literal. This can affect initialization that includes arrays that are directly initialized within class types, typically aggregates. -For example: +\begin{example} \begin{codeblock} struct A { char8_t s[10]; @@ -353,6 +364,7 @@ f({u8""}); // ambiguous } \end{codeblock} +\end{example} \rSec2[diff.cpp20.temp]{\ref{temp}: templates} @@ -363,7 +375,7 @@ Facilitate generic handling of throwing and non-throwing functions. \effect Valid ISO \CppXX{} code may be ill-formed in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} template struct A { }; template void f(void (*)(A) noexcept(B)); @@ -372,6 +384,7 @@ f(g); // ill-formed; previously well-formed } \end{codeblock} +\end{example} \rSec2[diff.cpp20.library]{\ref{library}: library introduction} @@ -408,7 +421,7 @@ Valid \CppXX{} code relying on subsumption with \tcode{common_reference_with} may fail to compile in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} template requires @\libconcept{equality_comparable_with}@ @@ -422,6 +435,7 @@ return attempted_equals(p, nullptr); // ill-formed; previously well-formed } \end{codeblock} +\end{example} \rSec2[diff.cpp20.memory]{\ref{mem}: memory management library} @@ -452,11 +466,12 @@ contained errors in format strings or relied on previous format string signatures or \tcode{format_args_t} may become ill-formed. -For example: +\begin{example} \begin{codeblock} auto s = std::format("{:d}", "I am not a number"); // ill-formed, // previously threw \tcode{format_error} \end{codeblock} +\end{example} \diffref{format} \change @@ -469,7 +484,7 @@ \effect Valid \CppXX{} code that passes bit-fields to formatting functions may become ill-formed. -For example: +\begin{example} \begin{codeblock} struct tiny { int bit: 1; @@ -478,6 +493,7 @@ auto t = tiny(); std::format("{}", t.bit); // ill-formed, previously returned \tcode{"0"} \end{codeblock} +\end{example} \diffref{format.string.std} \change @@ -490,12 +506,13 @@ \effect Valid \CppXX{} code that passes a boolean or character type as \fmtgrammarterm{arg-id} becomes invalid. -For example: +\begin{example} \begin{codeblock} std::format("{:*^{}}", "", true); // ill-formed, previously returned \tcode{"*"} std::format("{:*^{}}", "", '1'); // ill-formed, previously returned an // implementation-defined number of \tcode{'*'} characters \end{codeblock} +\end{example} \diffref{format.formatter.spec} \change @@ -524,7 +541,7 @@ on an xvalue expression with type \tcode{S} that is a specialization of \tcode{basic_string} may change meaning in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} std::string s1 = "some long string that forces allocation", s2 = s1; std::move(s1).substr(10, 5); @@ -532,6 +549,7 @@ std::string s3(std::move(s2), 10, 5); assert(s1 == s2); // unspecified, previously guaranteed to be \tcode{true} \end{codeblock} +\end{example} \rSec2[diff.cpp20.containers]{\ref{containers}: containers library} @@ -543,7 +561,7 @@ Improve efficiency of erasing elements from associative containers. \effect Valid \CppXX{} code may fail to compile in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} struct B { auto operator<=>(const B&) const = default; @@ -555,6 +573,7 @@ } }; \end{codeblock} +\end{example} \rSec2[diff.cpp20.thread]{\ref{thread}: concurrency support library} @@ -577,7 +596,7 @@ on a specific thread running the phase completion step, or on a completion function's side effects occurring without \tcode{wait} having been called. -For example: +\begin{example} \begin{codeblock} auto b0 = std::barrier(1); b0.arrive(); @@ -589,6 +608,7 @@ assert(data == 1); // implementation-defined; previously well-defined b1.arrive(); // implementation-defined; previously well-defined \end{codeblock} +\end{example} \rSec1[diff.cpp17]{\Cpp{} and ISO \CppXVII{}} @@ -612,7 +632,7 @@ \tcode{module} or \tcode{import} may be interpreted differently in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} class module {}; module m1; // was variable declaration; now \grammarterm{module-declaration} @@ -622,6 +642,7 @@ import j1; // was variable declaration; now \grammarterm{module-import-declaration} ::import j2; // variable declaration \end{codeblock} +\end{example} \diffref{lex.header} \change @@ -632,12 +653,13 @@ When the identifier \tcode{import} is followed by a \tcode{<} character, a \grammarterm{header-name} token may be formed. -For example: +\begin{example} \begin{codeblock} template class import {}; import f(); // ill-formed; previously well-formed ::import g(); // OK \end{codeblock} +\end{example} \diffref{lex.key} \change @@ -685,7 +707,7 @@ Valid \CppXVII{} code that contains a \tcode{<=} token immediately followed by a \tcode{>} token may be ill-formed or have different semantics in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} namespace N { struct X {}; @@ -694,6 +716,7 @@ Y y; // ill-formed; previously well-formed } \end{codeblock} +\end{example} \diffref{lex.literal} \indextext{UTF-8}% @@ -708,7 +731,7 @@ UTF-8 string literals having type ``array of \tcode{const char}'' and UTF-8 character literals having type ``\tcode{char}'' is not valid in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} const auto *u8s = u8"text"; // \tcode{u8s} previously deduced as \tcode{const char*}; now deduced as \tcode{const char8_t*} const char *ps = u8s; // ill-formed; previously well-formed @@ -727,6 +750,7 @@ }; ct::type x; // ill-formed; previously well-formed. \end{codeblock} +\end{example} \rSec2[diff.cpp17.basic]{\ref{basic}: basics} @@ -739,7 +763,7 @@ \effect Valid ISO \CppXVII{} code may be ill-formed or have undefined behavior in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} int f() { int a = 123; @@ -748,6 +772,7 @@ return a; // undefined behavior; previously returned 123 } \end{codeblock} +\end{example} \diffref{intro.races} \change @@ -786,12 +811,13 @@ Necessary for implementability. \effect Valid \CppXVII{} code may be ill-formed in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} typedef struct { void f() {} // ill-formed; previously well-formed } S; \end{codeblock} +\end{example} \diffref{dcl.fct.default} \change @@ -802,7 +828,7 @@ \effect Valid \CppXVII{} code may be ill-formed in this revision of \Cpp{}, with no diagnostic required. -For example: +\begin{example} \begin{codeblock} // Translation unit 1 int f(int a = 42); @@ -813,6 +839,7 @@ int g(); int main() { return g(); } // used to return 42 \end{codeblock} +\end{example} \diffref{dcl.init.aggr} \change @@ -825,7 +852,7 @@ a type with a user-declared constructor may be ill-formed or have different semantics in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} struct A { // not an aggregate; previously an aggregate A() = delete; @@ -858,6 +885,7 @@ Y y{X{}}; // copy constructor call; previously aggregate-initialization \end{codeblock} +\end{example} \diffref{dcl.init.list} \change @@ -868,10 +896,11 @@ \effect Valid \CppXVII{} code may fail to compile in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} bool y[] = { "bc" }; // ill-formed; previously well-formed \end{codeblock} +\end{example} \rSec2[diff.cpp17.class]{\ref{class}: classes} @@ -888,7 +917,7 @@ \effect Valid \CppXVII{} code may fail to compile in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} struct S { explicit (S)(const S&); // ill-formed; previously well-formed @@ -896,6 +925,7 @@ explicit(true) (S)(int); // OK }; \end{codeblock} +\end{example} \diffref{class.ctor,class.dtor} \change @@ -906,7 +936,7 @@ \effect Valid \CppXVII{} code may fail to compile in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} template struct A { @@ -915,6 +945,7 @@ ~A(); // error: \grammarterm{simple-template-id} not allowed for destructor }; \end{codeblock} +\end{example} \diffref{class.copy.elision} \change @@ -928,7 +959,7 @@ \effect Valid \CppXVII{} code may fail to compile or have different semantics in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} struct base { base(); @@ -960,6 +991,7 @@ char c = *s.m; // undefined behavior; previously ok } \end{codeblock} +\end{example} \rSec2[diff.cpp17.over]{\ref{over}: overloading} @@ -976,7 +1008,7 @@ and an object of the other type invoke a different operator. Also, for certain types, equality or inequality expressions between two objects of that type become ambiguous. -For example: +\begin{example} \begin{codeblock} struct A { operator int() const; @@ -992,6 +1024,7 @@ (10 != x); // calls \#1, previously selected \#3 } \end{codeblock} +\end{example} \diffref{over.match.oper} \change @@ -1001,7 +1034,7 @@ \effect Valid \CppXVII{} code that uses equality operators with conversion functions may be ill-formed or have different semantics in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} struct A { operator int() const { return 10; } @@ -1017,6 +1050,7 @@ B b1; bool eq = (b1 == b1); // ambiguous; previously well-formed \end{codeblock} +\end{example} \rSec2[diff.cpp17.temp]{\ref{temp}: templates} @@ -1038,7 +1072,7 @@ Previously valid code that uses a function name as the left operand of a \tcode{<} operator would become ill-formed. -For example: +\begin{example} \begin{codeblock} struct A {}; bool operator<(void (*fp)(), A); @@ -1049,6 +1083,7 @@ (f) < a; // still well-formed } \end{codeblock} +\end{example} \rSec2[diff.cpp17.except]{\ref{except}: exception handling} @@ -1178,13 +1213,14 @@ Increase safety via preventing buffer overflow at compile time. \effect Valid \CppXVII{} code may fail to compile in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} auto p = new char[100]; char q[100]; std::cin >> std::setw(20) >> p; // ill-formed; previously well-formed std::cin >> std::setw(20) >> q; // OK \end{codeblock} +\end{example} \diffref{ostream.inserters.character} \indextext{UTF-8}% @@ -1196,13 +1232,14 @@ Valid \CppXVII{} code that passes UTF-8 literals to \tcode{basic_ostream::operator<<} or \tcode{basic_ostream::operator<<} is now ill-formed. -For example: +\begin{example} \begin{codeblock} std::cout << u8"text"; // previously called \tcode{operator<<(const char*)} and printed a string; // now ill-formed std::cout << u8'X'; // previously called \tcode{operator<<(char)} and printed a character; // now ill-formed \end{codeblock} +\end{example} \diffref{ostream.inserters.character} \change @@ -1216,13 +1253,14 @@ to \tcode{basic_ostream::operator<<} or that passes \keyword{char16_t} or \keyword{char32_t} characters or strings to \tcode{basic_ostream::operator<<} is now ill-formed. -For example: +\begin{example} \begin{codeblock} std::cout << u"text"; // previously formatted the string as a pointer value; // now ill-formed std::cout << u'X'; // previously formatted the character as an integer value; // now ill-formed \end{codeblock} +\end{example} \diffref{fs.class.path} \change @@ -1233,12 +1271,13 @@ Valid \CppXVII{} code that depends on the \tcode{u8string()} and \tcode{generic_u8string()} member functions of \tcode{std::filesystem::path} returning \tcode{std::string} is not valid in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} std::filesystem::path p; std::string s1 = p.u8string(); // ill-formed; previously well-formed std::string s2 = p.generic_u8string(); // ill-formed; previously well-formed \end{codeblock} +\end{example} \rSec2[diff.cpp17.depr]{\ref{depr}: compatibility features} @@ -1368,11 +1407,12 @@ this revision of \Cpp{}. Specifically, character sequences like \tcode{0p+0} and \tcode{0e1_p+0} are three separate tokens each in \CppXIV{}, but one single token in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} #define F(a) b ## a int b0p = F(0p+0); // ill-formed; equivalent to ``\tcode{int b0p = b0p + 0;}\!'' in \CppXIV{} \end{codeblock} +\end{example} \rSec2[diff.cpp14.expr]{\ref{expr}: expressions} @@ -1421,11 +1461,12 @@ \effect Valid \CppXIV{} code may fail to compile or may change meaning in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} auto x1{1}; // was \tcode{std::initializer_list}, now \tcode{int} auto x2{1, 2}; // was \tcode{std::initializer_list}, now ill-formed \end{codeblock} +\end{example} \diffref{dcl.fct} \change @@ -1435,13 +1476,14 @@ \effect Valid \CppXIV{} code may fail to compile or change meaning in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} void g1() noexcept; void g2(); template int f(T *, T *); int x = f(g1, g2); // ill-formed; previously well-formed \end{codeblock} +\end{example} \diffref{dcl.init.aggr} \change @@ -1454,7 +1496,7 @@ revision of \Cpp{}; initialization from an empty initializer list will perform aggregate initialization instead of invoking a default constructor for the affected types. -For example: +\begin{example} \begin{codeblock} struct derived; struct base { @@ -1467,6 +1509,7 @@ derived d1{}; // error; the code was well-formed in \CppXIV{} derived d2; // still OK \end{codeblock} +\end{example} \rSec2[diff.cpp14.class]{\ref{class}: classes} @@ -1481,7 +1524,7 @@ that names a constructor now makes the corresponding base class constructors visible to initializations of the derived class rather than declaring additional derived class constructors. -For example: +\begin{example} \begin{codeblock} struct A { template A(T, typename T::type = 0); @@ -1495,6 +1538,7 @@ // which called \tcode{A(int)} due to substitution failure // in \tcode{A(long)}. \end{codeblock} +\end{example} \rSec2[diff.cpp14.temp]{\ref{temp}: templates} @@ -1509,7 +1553,7 @@ \effect Valid \CppXIV{} code may fail to compile or produce different results in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} template struct A; template int foo(A *) = delete; @@ -1518,6 +1562,7 @@ foo(p); // ill-formed; previously well-formed } \end{codeblock} +\end{example} \rSec2[diff.cpp14.except]{\ref{except}: exception handling} @@ -1598,12 +1643,13 @@ \effect Valid \CppXIV{} code may fail to compile or may change meaning in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} #include std::unique_ptr arr(new int[1]); std::shared_ptr ptr(std::move(arr)); // error: \tcode{int(*)[]} is not compatible with \tcode{int*} \end{codeblock} +\end{example} \rSec2[diff.cpp14.string]{\ref{strings}: strings library} @@ -1620,13 +1666,14 @@ will execute differently when called with a non-const string's \tcode{.data()} member in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} int f(char *) = delete; int f(const char *); string s; int x = f(s.data()); // ill-formed; previously well-formed \end{codeblock} +\end{example} \rSec2[diff.cpp14.containers]{\ref{containers}: containers library} @@ -1639,7 +1686,7 @@ Valid \CppXIV{} code that attempts to use associative containers having a comparison object with non-const function call operator may fail to compile in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} #include @@ -1656,6 +1703,7 @@ s.find(0); } \end{codeblock} +\end{example} \rSec2[diff.cpp14.depr]{\ref{depr}: compatibility features} @@ -1714,13 +1762,14 @@ this revision of \Cpp{}, but the macro invocation produces different outcomes because the single quotes delimit a \grammarterm{character-literal} in \CppXI{}, whereas they are digit separators in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} #define M(x, ...) __VA_ARGS__ int x[2] = { M(1'2,3'4, 5) }; // \tcode{int x[2] = \{ 5 \};\ \ \ \ \ } --- \CppXI{} // \tcode{int x[2] = \{ 3'4, 5 \};} --- this revision of \Cpp{} \end{codeblock} +\end{example} \rSec2[diff.cpp11.basic]{\ref{basic}: basics} @@ -1756,7 +1805,7 @@ \effect Valid \CppXI{} code that relies on the conversions may behave differently in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} struct S { int x = 1; @@ -1775,6 +1824,7 @@ \end{codeblock} In \CppXI{}, the expression yields \tcode{sizeof(const char*)}. In this revision of \Cpp{}, it yields \tcode{sizeof(const char[1])}. +\end{example} \rSec2[diff.cpp11.dcl.dcl]{\ref{dcl.dcl}: declarations} @@ -1787,7 +1837,7 @@ the object. \effect Valid \CppXI{} code may fail to compile in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} struct S { constexpr const int &f(); @@ -1797,6 +1847,7 @@ This code is valid in \CppXI{} but invalid in this revision of \Cpp{} because it declares the same member function twice with different return types. +\end{example} \diffref{dcl.init.aggr} \change @@ -1806,7 +1857,7 @@ by aggregate initialization. \effect Valid \CppXI{} code may fail to compile or may change meaning in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} struct S { // Aggregate in \CppXIV{} onwards. int m = 1; @@ -1819,6 +1870,7 @@ S b{a}; // uses copy constructor in \CppXI{}, // performs aggregate initialization in this revision of \Cpp{} \end{codeblock} +\end{example} \rSec2[diff.cpp11.library]{\ref{library}: library introduction} @@ -1867,11 +1919,12 @@ \tcode{u8R}, \tcode{u}, \tcode{uR}, \tcode{U}, \tcode{UR}, or \tcode{LR} will not be expanded when adjacent to a \grammarterm{string-literal} but will be interpreted as part of the \grammarterm{string-literal}. -For example: +\begin{example} \begin{codeblock} #define u8 "abc" const char* s = u8"def"; // Previously \tcode{"abcdef"}, now \tcode{"def"} \end{codeblock} +\end{example} \diffref{lex.pptoken} \change @@ -1881,7 +1934,7 @@ \effect Valid \CppIII{} code may fail to compile or produce different results in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} #define _x "there" "hello"_x // \#1 @@ -1890,6 +1943,7 @@ Previously, \#1 would have consisted of two separate preprocessing tokens and the macro \tcode{_x} would have been expanded. In this revision of \Cpp{}, \#1 consists of a single preprocessing token, so the macro is not expanded. +\end{example} \diffref{lex.key} \change @@ -1931,7 +1985,7 @@ \effect Valid \CppIII{} code may fail to compile or produce different results in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} void f(void *); // \#1 void f(...); // \#2 @@ -1939,6 +1993,7 @@ f(0*N); // calls \#2; used to call \#1 } \end{codeblock} +\end{example} \diffref{expr.mul} \change @@ -1958,12 +2013,13 @@ \effect Valid \CppIII{} code may fail to compile or produce different results in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} bool b1 = new int && false; // previously \tcode{false}, now ill-formed struct S { operator int(); }; bool b2 = &S::operator int && false; // previously \tcode{false}, now ill-formed \end{codeblock} +\end{example} \rSec2[diff.cpp03.dcl.dcl]{\ref{dcl.dcl}: declarations} @@ -1987,13 +2043,14 @@ Catches bugs. \effect Valid \CppIII{} code may fail to compile in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} int x[] = { 2.0 }; \end{codeblock} This code is valid in \CppIII{} but invalid in this revision of \Cpp{} because \tcode{double} to \tcode{int} is a narrowing conversion. +\end{example} \diffref{dcl.link} \change @@ -2005,7 +2062,7 @@ \effect Valid \CppIII{} code may violate the one-definition rule\iref{basic.def.odr} in this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} namespace { extern "C" { extern int x; } } // \#1, previously external linkage and C language linkage, // now internal linkage and \Cpp{} language linkage @@ -2015,6 +2072,7 @@ This code is valid in \CppIII{}, but \tcode{\#2} is not a definition for \tcode{\#1} in this revision of \Cpp{}, violating the one-definition rule. +\end{example} \rSec2[diff.cpp03.class]{\ref{class}: classes} @@ -2062,7 +2120,7 @@ Change to semantics of well-defined expression. A valid \CppIII{} expression containing a right angle bracket (``\tcode{>}'') followed immediately by another right angle bracket may now be treated as closing two templates. -For example: +\begin{example} \begin{codeblock} template struct X { }; template struct Y { }; @@ -2071,6 +2129,7 @@ This code is valid in \CppIII{} because ``\tcode{>>}'' is a right-shift operator, but invalid in this revision of \Cpp{} because ``\tcode{>>}'' closes two templates. +\end{example} \diffref{temp.dep.candidate} \change @@ -2397,7 +2456,7 @@ Valid \CppIII{} code that relies on \tcode{std::ios_base} flag types being represented as \tcode{std::bitset} or as an integer type may fail to compile with this revision of \Cpp{}. -For example: +\begin{example} \begin{codeblock} #include @@ -2406,6 +2465,7 @@ std::cout.setf(flag); // error: \tcode{setf} does not take argument of type \tcode{int} } \end{codeblock} +\end{example} \rSec1[diff.iso]{\Cpp{} and ISO C} @@ -2444,7 +2504,8 @@ Type of \grammarterm{character-literal} is changed from \tcode{int} to \tcode{char}. \rationale This is needed for improved overloaded function argument type -matching. For example: +matching. +\begin{example} \begin{codeblock} int function( int i ); int function( char c ); @@ -2453,6 +2514,7 @@ \end{codeblock} It is preferable that this call match the second version of function rather than the first. +\end{example} \effect Change to semantics of well-defined feature. ISO C programs which depend on @@ -2525,16 +2587,18 @@ \diffref{basic.def} \change \Cpp{} does not have ``tentative definitions'' as in C.\\ -E.g., at file scope, +\begin{example} +At file scope, \begin{codeblock} int i; int i; \end{codeblock} is valid in C, invalid in \Cpp{}. +\end{example} This makes it impossible to define mutually referential file-local objects with static storage duration, if initializers are restricted to the syntactic forms of C\@. -For example, +\begin{example} \begin{codeblock} struct X { int i; struct X* next; }; @@ -2542,6 +2606,7 @@ static struct X b = { 0, &a }; static struct X a = { 1, &b }; \end{codeblock} +\end{example} \rationale This avoids having different initialization rules for fundamental types and user-defined types. @@ -2559,7 +2624,7 @@ \diffref{basic.scope} \change A \keyword{struct} is a scope in \Cpp{}, not in C. -For example, +\begin{example} \begin{codeblock} struct X { struct Y { int a; } b; @@ -2567,6 +2632,7 @@ struct Y c; \end{codeblock} is valid in C but not in \Cpp{}, which would require \tcode{X::Y c;}. +\end{example} \rationale Class scope is crucial to \Cpp{}, and a struct is a class. \effect @@ -2636,6 +2702,7 @@ \diffref{conv.ptr} \change Converting \tcode{\keyword{void}*} to a pointer-to-object type requires casting. +\begin{example} \begin{codeblock} char a[10]; void* b=a; @@ -2647,6 +2714,7 @@ ISO C accepts this usage of pointer to \keyword{void} being assigned to a pointer to object type. \Cpp{} does not. +\end{example} \rationale \Cpp{} tries harder than C to enforce compile-time type safety. \effect @@ -2654,12 +2722,12 @@ \difficulty Can be automated. Violations will be diagnosed by the \Cpp{} translator. -The -fix is to add a cast. -For example: +The fix is to add a cast. +\begin{example} \begin{codeblock} char* c = (char*) b; \end{codeblock} +\end{example} \howwide This is fairly widely used but it is good @@ -2671,7 +2739,7 @@ \change Operations mixing a value of an enumeration type and a value of a different enumeration type or of a floating-point type are not valid. -For example: +\begin{example} \begin{codeblock} enum E1 { e }; enum E2 { f }; @@ -2679,6 +2747,7 @@ int k = f - e; // valid in C; ill-formed in \Cpp{} int x = 1 ? e : f; // valid in C; ill-formed in \Cpp{} \end{codeblock} +\end{example} \rationale Reinforcing type safety in \Cpp{}. \effect @@ -2686,13 +2755,14 @@ \difficulty Violations will be diagnosed by the \Cpp{} translator. The original behavior can be restored with a cast or integral promotion. -For example: +\begin{example} \begin{codeblock} enum E1 { e }; enum E2 { f }; int b = (int)e <= 3.7; int k = +f - e; \end{codeblock} +\end{example} \howwide Uncommon. @@ -2711,11 +2781,12 @@ \change In \Cpp{}, types can only be defined in declarations, not in expressions.\\ In C, a \keyword{sizeof} expression or cast expression may define a new type. -For example, +\begin{example} \begin{codeblock} p = (void*)(struct x {int i;} *)0; \end{codeblock} defines a new type, struct \tcode{x}. +\end{example} \rationale This prohibition helps to clarify the location of definitions in the source code. @@ -2740,7 +2811,7 @@ Change to semantics of well-defined feature. Some C expressions that implicitly rely on lvalue-to-rvalue conversions will yield different results. -For example, +\begin{example} \begin{codeblock} char arr[100]; sizeof(0, arr) @@ -2750,6 +2821,7 @@ in \Cpp{} and \tcode{sizeof(char*)} in C. +\end{example} \difficulty Programs must add explicit casts to the appropriate rvalue. \howwide @@ -2811,12 +2883,13 @@ Using these specifiers with type declarations is illegal in \Cpp{}. In C, these specifiers are ignored when used on type declarations. -Example: +\begin{example} \begin{codeblock} static struct S { // valid C, invalid in \Cpp{} int i; }; \end{codeblock} +\end{example} \rationale Storage class specifiers don't have any meaning when associated @@ -2851,23 +2924,25 @@ same name). In C, a \grammarterm{typedef-name} and a struct tag name declared in the same scope can have the same name (because they have different name spaces). -Example: +\begin{example} \begin{codeblock} typedef struct name1 { @\commentellip@ } name1; // valid C and \Cpp{} struct name { @\commentellip@ }; typedef int name; // valid C, invalid \Cpp{} \end{codeblock} +\end{example} \rationale For ease of use, \Cpp{} doesn't require that a type name be prefixed with the keywords \keyword{class}, \keyword{struct} or \keyword{union} when used in object declarations or type casts. -Example: +\begin{example} \begin{codeblock} class name { @\commentellip@ }; name i; // \tcode{i} has type \tcode{class name} \end{codeblock} +\end{example} \effect Deletion of semantically well-defined feature. @@ -2894,12 +2969,13 @@ \change The keyword \keyword{auto} cannot be used as a storage class specifier. -Example: +\begin{example} \begin{codeblock} void f() { auto int x; // valid C, invalid \Cpp{} } \end{codeblock} +\end{example} \rationale Allowing the use of \keyword{auto} to deduce the type @@ -2917,11 +2993,12 @@ In \Cpp{}, a function declared with an empty parameter list takes no arguments. In C, an empty parameter list means that the number and type of the function arguments are unknown. -Example: +\begin{example} \begin{codeblock} int f(); // means \tcode{int f(void)} in \Cpp{} // \tcode{int f(} unknown \tcode{)} in C \end{codeblock} +\end{example} \rationale This is to avoid function calls @@ -2944,11 +3021,12 @@ In \Cpp{}, types may not be defined in return or parameter types. In C, these type definitions are allowed. -Example: +\begin{example} \begin{codeblock} void f( struct S { int a; } arg ) {} // valid C, invalid \Cpp{} enum E { A, B, C } f() {} // valid C, invalid \Cpp{} \end{codeblock} +\end{example} \rationale When comparing types in different translation units, \Cpp{} relies @@ -2991,7 +3069,7 @@ designated and non-designated initializers cannot be mixed in the same initializer list. -Example: +\begin{example} \begin{codeblock} struct A { int x, y; }; struct B { struct A a; }; @@ -3000,6 +3078,7 @@ struct B b = {.a.x = 0}; // valid C, invalid \Cpp{} struct A c = {.x = 1, 2}; // valid C, invalid \Cpp{} \end{codeblock} +\end{example} \rationale In \Cpp{}, members are destroyed in reverse construction order and the elements of an initializer list are evaluated in lexical order, @@ -3021,10 +3100,11 @@ number of elements in the array. In C, an array can be initialized with a string even if the array is not large enough to contain the string-terminating \tcode{'\textbackslash 0'}. -Example: +\begin{example} \begin{codeblock} char array[4] = "abcd"; // valid C, invalid \Cpp{} \end{codeblock} +\end{example} \rationale When these non-terminated arrays are manipulated by standard string functions, there is potential for major catastrophe. @@ -3043,11 +3123,12 @@ \Cpp{} objects of enumeration type can only be assigned values of the same enumeration type. In C, objects of enumeration type can be assigned values of any integral type. -Example: +\begin{example} \begin{codeblock} enum color { red, blue, green }; enum color c = 1; // valid C, invalid \Cpp{} \end{codeblock} +\end{example} \rationale The type-safe nature of \Cpp{}. @@ -3064,13 +3145,14 @@ \change In \Cpp{}, the type of an enumerator is its enumeration. In C, the type of an enumerator is \keyword{int}. -Example: +\begin{example} \begin{codeblock} enum e { A }; sizeof(A) == sizeof(int) // in C sizeof(A) == sizeof(e) // in \Cpp{} /* and @sizeof(int)@ is not necessarily equal to @sizeof(e)@ */ \end{codeblock} +\end{example} \rationale In \Cpp{}, an enumeration is a distinct type. @@ -3091,12 +3173,14 @@ an \grammarterm{alignment-specifier} is an \grammarterm{attribute-specifier}. In C, an \grammarterm{alignment-specifier} is a \gterm{declaration-specifier}. -Example: +\begin{example} \begin{codeblock} #include unsigned alignas(8) int x; // valid C, invalid \Cpp{} unsigned int y alignas(8); // valid \Cpp{}, invalid C \end{codeblock} +\end{example} + \rationale \Cpp{} requires unambiguous placement of the \grammarterm{alignment-specifier}. \effect @@ -3115,7 +3199,7 @@ scope. In C, an inner scope declaration of a struct tag name never hides the name of an object or function in an outer scope. -Example: +\begin{example} \begin{codeblock} int x[99]; void f() { @@ -3124,6 +3208,7 @@ /* size of the struct in @\textit{\textrm{\Cpp{}}}@ */ } \end{codeblock} +\end{example} \rationale This is one of the few incompatibilities between C and \Cpp{} that can be attributed to the new \Cpp{} name space definition where a @@ -3154,7 +3239,8 @@ The implicitly-declared copy constructor and implicitly-declared copy assignment operator cannot make a copy of a volatile lvalue. -For example, the following is valid in ISO C: +\begin{example} +The following is valid in ISO C: \begin{codeblock} struct X { int i; }; volatile struct X x1 = {0}; @@ -3162,6 +3248,7 @@ struct X x3; x3 = x1; // also invalid \Cpp{} \end{codeblock} +\end{example} \rationale Several alternatives were debated at length. @@ -3214,13 +3301,14 @@ In \Cpp{}, the name of a nested class is local to its enclosing class. In C the name of the nested class belongs to the same scope as the name of the outermost enclosing class. -Example: +\begin{example} \begin{codeblock} struct X { struct Y { @\commentellip@ } y; }; struct Y yy; // valid C, invalid \Cpp{} \end{codeblock} +\end{example} \rationale \Cpp{} classes have member functions which require that classes establish scopes. @@ -3238,13 +3326,14 @@ To make the struct type name visible in the scope of the enclosing struct, the struct tag can be declared in the scope of the enclosing struct, before the enclosing struct is defined. -Example: +\begin{example} \begin{codeblock} struct Y; // \tcode{struct Y} and \tcode{struct X} are at the same scope struct X { struct Y { @\commentellip@ } y; }; \end{codeblock} +\end{example} All the definitions of C struct types enclosed in other struct definitions and accessed outside the scope of the enclosing @@ -3258,7 +3347,7 @@ \change In \Cpp{}, a \grammarterm{typedef-name} may not be redeclared in a class definition after being used in that definition. -Example: +\begin{example} \begin{codeblock} typedef int I; struct S { @@ -3266,6 +3355,7 @@ int I; // valid C, invalid \Cpp{} }; \end{codeblock} +\end{example} \rationale When classes become complicated, allowing such a redefinition after the type has been used can create confusion for \Cpp{} From 21e022557462544e2e6d32411f71e42a378d2236 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 2 Jul 2024 14:31:08 +0100 Subject: [PATCH 057/162] [depr.c.macros] Fix "macro" singular when referring to two macros This should have been applied as part of LWG 4036. --- source/future.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/future.tex b/source/future.tex index 04ed0e5eee..90e689171a 100644 --- a/source/future.tex +++ b/source/future.tex @@ -227,7 +227,7 @@ \rSec1[depr.c.macros]{Deprecated C macros} \pnum -The header \libheader{stdalign.h} has the following macro: +The header \libheader{stdalign.h} has the following macros: \indexheader{stdalign.h}% \indexlibraryglobal{__alignas_is_defined}% \begin{codeblock} From 8bb63636c37f8e67808de1e1ce1142a3028293fd Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Wed, 3 Jul 2024 20:53:40 +0100 Subject: [PATCH 058/162] [istream.unformatted] add missing semi-colon to list item (#7117) --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index b893c397a9..5684e8802f 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -5408,7 +5408,7 @@ \item \tcode{n != numeric_limits::max()}\iref{numeric.limits} and -\tcode{n} characters have been extracted so far +\tcode{n} characters have been extracted so far; \item end-of-file occurs on the input sequence (in which case the function calls From 8227c196af96f157a539e5181f7a75ab3de3a096 Mon Sep 17 00:00:00 2001 From: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> Date: Fri, 5 Jul 2024 10:03:47 +0200 Subject: [PATCH 059/162] [except.throw] Add comma (#7118) --- source/exceptions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/exceptions.tex b/source/exceptions.tex index 22fc97a325..8473cd1c64 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -264,7 +264,7 @@ an incomplete type\iref{basic.types.general}, an abstract class type\iref{class.abstract}, or a pointer to an incomplete type other than -\cv{}~\keyword{void}\iref{basic.compound} +\cv{}~\keyword{void}\iref{basic.compound}, the program is ill-formed. \pnum From 07c20b75a867b66c858de716dfb639b0a9d1da2c Mon Sep 17 00:00:00 2001 From: Yihe Li Date: Sat, 6 Jul 2024 23:32:43 +0800 Subject: [PATCH 060/162] [version.syn] Remove redundant for __cpp_lib_ranges_enumerate (#7120) --- source/support.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/support.tex b/source/support.tex index dda0ca29bd..d0d4ca3ce7 100644 --- a/source/support.tex +++ b/source/support.tex @@ -739,7 +739,7 @@ #define @\defnlibxname{cpp_lib_ranges_chunk_by}@ 202202L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_concat}@ 202403L // also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_contains}@ 202207L // also in \libheader{algorithm} -#define @\defnlibxname{cpp_lib_ranges_enumerate}@ 202302L // also in \libheader{ranges}, \libheader{version} +#define @\defnlibxname{cpp_lib_ranges_enumerate}@ 202302L // also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_find_last}@ 202207L // also in \libheader{algorithm} #define @\defnlibxname{cpp_lib_ranges_fold}@ 202207L // also in \libheader{algorithm} #define @\defnlibxname{cpp_lib_ranges_generate_random}@ 202403L // also in \libheader{random} From 15b7ea6c95e471888cda2c334ba8ac30cabccf64 Mon Sep 17 00:00:00 2001 From: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> Date: Sun, 7 Jul 2024 10:23:09 +0200 Subject: [PATCH 061/162] [basic.start.main] fix definite article (#7121) --- source/basic.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index d6b58e4464..dac5bf7ea0 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -6784,7 +6784,7 @@ \tcode{argv[0]} through \tcode{argv[argc-1]} as pointers to the initial characters of null-terminated multibyte strings (\ntmbs{}s)\iref{multibyte.strings} and \tcode{argv[0]} shall be the pointer to -the initial character of a \ntmbs{} that represents the name used to +the initial character of an \ntmbs{} that represents the name used to invoke the program or \tcode{""}. The value of \tcode{argc} shall be non-negative. The value of \tcode{argv[argc]} shall be 0. From 61d85d3f9b78d792bd1bdb1d15202f9cdd931b31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 9 Jul 2024 00:57:58 +0100 Subject: [PATCH 062/162] [intro.compliance.general] Cite Annex B more normatively. --- source/intro.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/intro.tex b/source/intro.tex index 2435b4fbd6..4bc3b594fb 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -724,7 +724,7 @@ If a program contains no violations of the rules in \ref{lex} through \ref{\lastlibchapter} and \ref{depr}, a conforming implementation shall, -within its resource limits as described in \ref{implimits}, +in accordance with the resource limits specified in \ref{implimits}, accept and correctly execute \begin{footnote} ``Correct execution'' can include undefined behavior From 2048179f82bbe92dcccee3cc6bbdac4973c77606 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 9 Jul 2024 01:25:28 +0100 Subject: [PATCH 063/162] [intro.compliance.general] Cite Annex D more normatively. --- source/intro.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/intro.tex b/source/intro.tex index 4bc3b594fb..8bfa905704 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -722,7 +722,7 @@ \begin{itemize} \item If a program contains no violations of the rules in -\ref{lex} through \ref{\lastlibchapter} and \ref{depr}, +\ref{lex} through \ref{\lastlibchapter} as well as those specified in \ref{depr}, a conforming implementation shall, in accordance with the resource limits specified in \ref{implimits}, accept and correctly execute From 6b67a856495634df3a0bd0d8abee36eb0d3c8c6f Mon Sep 17 00:00:00 2001 From: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> Date: Tue, 9 Jul 2024 08:29:50 +0200 Subject: [PATCH 064/162] [temp.inst] Fix definite article --- source/templates.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/templates.tex b/source/templates.tex index 3d27393946..be31e19615 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -6159,7 +6159,7 @@ \pnum The \grammarterm{noexcept-specifier} of a function template specialization is not instantiated along with the function declaration; it is instantiated -when needed\iref{except.spec}. If such an +when needed\iref{except.spec}. If such a \grammarterm{noexcept-specifier} is needed but has not yet been instantiated, the dependent names are looked up, the semantics constraints are checked, and the instantiation of any template used in the From 43c47b42fd1f7cd4d095299aca98666c06e45949 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 9 Jul 2024 01:44:08 +0100 Subject: [PATCH 065/162] [uaxid] Clarify that requirements come "from UAX #31", and use "this document". --- source/uax31.tex | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/source/uax31.tex b/source/uax31.tex index aea6e6b5ba..ee0bb9c2a1 100644 --- a/source/uax31.tex +++ b/source/uax31.tex @@ -7,13 +7,13 @@ This Annex describes the choices made in application of \UAX{31} (``Unicode Identifier and Pattern Syntax'') to \Cpp{} in terms of the requirements from \UAX{31} and -how they do or do not apply to \Cpp{}. +how they do or do not apply to this document. In terms of \UAX{31}, -\Cpp{} conforms by meeting the requirements +this document conforms by meeting the requirements R1 ``Default Identifiers'' and -R4 ``Equivalent Normalized Identifiers''. -The other requirements, also listed below, -are either alternatives not taken or do not apply to \Cpp{}. +R4 ``Equivalent Normalized Identifiers'' from \UAX{31}. +The other requirements from \UAX{31}, also listed below, +are either alternatives not taken or do not apply to this document. \rSec1[uaxid.def]{R1 Default identifiers} @@ -91,7 +91,7 @@ during the processes of lexing and parsing. \pnum -\Cpp{} does not claim conformance with this requirement. +This document does not claim conformance with this requirement from \UAX{31}. \rSec1[uaxid.eqn]{R4 Equivalent normalized identifiers} @@ -100,16 +100,16 @@ how identifiers are compared and considered equivalent. \pnum -\Cpp{} requires that identifiers be in Normalization Form C and +This document requires that identifiers be in Normalization Form C and therefore identifiers that compare the same under NFC are equivalent. This is described in \ref{lex.name}. \rSec1[uaxid.eqci]{R5 Equivalent case-insensitive identifiers} \pnum -\Cpp{} considers case to be significant in identifier comparison, and +This document considers case to be significant in identifier comparison, and does not do any case folding. -This requirement does not apply to \Cpp{}. +This requirement from \UAX{31} does not apply to this document. \rSec1[uaxid.filter]{R6 Filtered normalized identifiers} @@ -118,15 +118,15 @@ \UAX{31} requires a precise specification of those exclusions. \pnum -\Cpp{} does not make any such exclusions. +This document does not make any such exclusions. \rSec1[uaxid.filterci]{R7 Filtered case-insensitive identifiers} \pnum \Cpp{} identifiers are case sensitive, and -therefore this requirement does not apply. +therefore this requirement from \UAX{31} does not apply. \rSec1[uaxid.hashtag]{R8 Hashtag identifiers} \pnum -There are no hashtags in \Cpp{}, so this requirement does not apply. +There are no hashtags in \Cpp{}, so this requirement from \UAX{31} does not apply. From 7c35cb057ef4885e091bf65c1103d64946e7c8d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 9 Jul 2024 14:47:10 +0100 Subject: [PATCH 066/162] [std] Make bibliography reference link colour more citely --- source/std.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/std.tex b/source/std.tex index f269c5e8f7..de1f338cc2 100644 --- a/source/std.tex +++ b/source/std.tex @@ -41,6 +41,7 @@ linktocpage=true, colorlinks=true, linkcolor=blue, + citecolor=blue, plainpages=false} \usepackage{memhfixc} % fix interactions between hyperref and memoir \usepackage[active,header=false,handles=false,copydocumentclass=false,generate=std-gram.ext,extract-cmdline={gramSec},extract-env={bnf,simplebnf}]{extract} % Grammar extraction From 8187cc1a30996154fc097693f5206c5d41c059af Mon Sep 17 00:00:00 2001 From: Hewill Kang <67143766+hewillk@users.noreply.github.com> Date: Wed, 17 Apr 2024 16:17:13 +0800 Subject: [PATCH 067/162] [range.concat.view] Use \exposid for is-const --- source/ranges.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 415826deeb..4ecb835455 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8658,12 +8658,12 @@ \begin{itemdescr} \pnum \effects -Let \tcode{is-const} be +Let \exposid{is-const} be \tcode{true} for the const-qualified overload, and \tcode{false} otherwise. Equivalent to: \begin{codeblock} -@\exposid{iterator}@ it(this, in_place_index<0>, ranges::begin(std::get<0>(@\exposid{views_}@))); +@\exposid{iterator}@<@\exposid{is-const}@> it(this, in_place_index<0>, ranges::begin(std::get<0>(@\exposid{views_}@))); it.template @\exposid{satisfy}@<0>(); return it; \end{codeblock} @@ -8679,14 +8679,14 @@ \begin{itemdescr} \pnum \effects -Let \tcode{is-const} be +Let \exposid{is-const} be \tcode{true} for the const-qualified overload, and \tcode{false} otherwise. Equivalent to: \begin{codeblock} constexpr auto N = sizeof...(Views); -if constexpr (@\libconcept{common_range}@<@\exposid{maybe-const}@>) { - return @\exposid{iterator}@(this, in_place_index, +if constexpr (@\libconcept{common_range}@<@\exposid{maybe-const}@<@\exposid{is-const}@, Views...[N - 1]>>) { + return @\exposid{iterator}@<@\exposid{is-const}@>(this, in_place_index, ranges::end(std::get(@\exposid{views_}@))); } else { return default_sentinel; From bc2c80c23133a0581a847bd7fcfaca621ca86ffe Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 13 May 2024 20:17:21 +0200 Subject: [PATCH 068/162] [dcl.init.list] Add commas and period for bulleted list Fixes ISO/CS comment (C++23 proof) --- source/declarations.tex | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index 4034565e2b..5a6bb65d57 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -5882,17 +5882,17 @@ \begin{note} List-initialization can be used \begin{itemize} -\item as the initializer in a variable definition\iref{dcl.init} -\item as the initializer in a \grammarterm{new-expression}\iref{expr.new} -\item in a \tcode{return} statement\iref{stmt.return} -\item as a \grammarterm{for-range-initializer}\iref{stmt.iter} -\item as a function argument\iref{expr.call} -\item as a template argument\iref{temp.arg.nontype} -\item as a subscript\iref{expr.sub} -\item as an argument to a constructor invocation\iref{dcl.init,expr.type.conv} -\item as an initializer for a non-static data member\iref{class.mem} -\item in a \grammarterm{mem-initializer}\iref{class.base.init} -\item on the right-hand side of an assignment\iref{expr.ass} +\item as the initializer in a variable definition\iref{dcl.init}, +\item as the initializer in a \grammarterm{new-expression}\iref{expr.new}, +\item in a \tcode{return} statement\iref{stmt.return}, +\item as a \grammarterm{for-range-initializer}\iref{stmt.iter}, +\item as a function argument\iref{expr.call}, +\item as a template argument\iref{temp.arg.nontype}, +\item as a subscript\iref{expr.sub}, +\item as an argument to a constructor invocation\iref{dcl.init,expr.type.conv}, +\item as an initializer for a non-static data member\iref{class.mem}, +\item in a \grammarterm{mem-initializer}\iref{class.base.init}, or +\item on the right-hand side of an assignment\iref{expr.ass}. \end{itemize} \begin{example} From 868db7356ad1490890391e8c82888de5c4d4aad4 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 13 May 2024 20:18:20 +0200 Subject: [PATCH 069/162] [facet.num.get.virtuals] Add missing punctuation Fixes ISO/CS comment (C++23 proof) --- source/locales.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/locales.tex b/source/locales.tex index 26ea841200..68c36b95ba 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -2212,12 +2212,12 @@ where \tcode{loc} is \tcode{str.getloc()}. \pnum -The details of this operation occur in three stages +The details of this operation occur in three stages: \begin{itemize} \item Stage 1: -Determine a conversion specifier +Determine a conversion specifier. \item Stage 2: Extract characters from \tcode{in} and @@ -2225,7 +2225,7 @@ the format expected by the conversion specification determined in stage 1. \item Stage 3: -Store results +Store results. \end{itemize} \pnum From 77ee6ed3b8865b2bb514cb8446488aa6fb032dda Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 13 May 2024 23:39:13 +0200 Subject: [PATCH 070/162] [lex.literal] Properly format table headings Fixes ISO/CS comment (C++23 proof) --- source/lex.tex | 10 +++++----- source/locales.tex | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/lex.tex b/source/lex.tex index 03d086d26a..9656489b70 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -1466,8 +1466,8 @@ \begin{floattable}{Character literals}{lex.ccon.literal} {l|l|l|l|l} \topline -Encoding & Kind & Type & Associated char- & Example \\ -prefix & & & acter encoding & \\ +\lhdr{Encoding} & \chdr{Kind} & \chdr{Type} & \chdr{Associated char-} & \rhdr{Example} \\ +\lhdr{prefix} & \chdr{} & \chdr{} & \chdr{acter encoding} & \\ \capsep none & \defnx{ordinary character literal}{literal!character!ordinary} & @@ -1805,9 +1805,9 @@ \begin{floattable}{String literals}{lex.string.literal} {llp{2.6cm}p{2.3cm}p{4.7cm}} \topline -Encoding & Kind & Type & Associated & Examples \\ -prefix & & & character & \\ - & & & encoding & \\ +\lhdr{Enco-} & \chdr{Kind} & \chdr{Type} & \chdr{Associated} & \rhdr{Examples} \\ +\lhdr{ding} & \chdr{} & \chdr{} & \chdr{character} & \rhdr{} \\ +\lhdr{prefix} & \chdr{} & \chdr{} & \chdr{encoding} & \rhdr{} \\ \capsep none & \defnx{ordinary string literal}{literal!string!ordinary} & diff --git a/source/locales.tex b/source/locales.tex index 68c36b95ba..8d7541ae7f 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -2250,7 +2250,7 @@ \begin{floattable}{Integer conversions}{facet.num.get.int} {lc} \topline -\lhdr{State} & \tcode{stdio} equivalent \\ \capsep +\lhdr{State} & \rhdr{\tcode{stdio} equivalent} \\ \capsep \tcode{basefield == oct} & \tcode{\%o} \\ \rowsep \tcode{basefield == hex} & \tcode{\%X} \\ \rowsep \tcode{basefield == 0} & \tcode{\%i} \\ \capsep @@ -2268,7 +2268,7 @@ \begin{floattable}{Length modifier}{facet.num.get.length} {lc} \topline -\lhdr{Type} & Length modifier \\ \capsep +\lhdr{Type} & \rhdr{Length modifier} \\ \capsep \tcode{short} & \tcode{h} \\ \rowsep \tcode{unsigned short} & \tcode{h} \\ \rowsep \tcode{long} & \tcode{l} \\ \rowsep @@ -2599,7 +2599,7 @@ \begin{floattable}{Integer conversions}{facet.num.put.int} {lc} \topline -\lhdr{State} & \tcode{stdio} equivalent \\ \capsep +\lhdr{State} & \rhdr{\tcode{stdio} equivalent} \\ \capsep \tcode{basefield == ios_base::oct} & \tcode{\%o} \\ \rowsep \tcode{(basefield == ios_base::hex) \&\& !uppercase} & \tcode{\%x} \\ \rowsep \tcode{(basefield == ios_base::hex)} & \tcode{\%X} \\ \rowsep @@ -2614,7 +2614,7 @@ \begin{floattable}{Floating-point conversions}{facet.num.put.fp} {lc} \topline -\lhdr{State} & \tcode{stdio} equivalent \\ \capsep +\lhdr{State} & \rhdr{\tcode{stdio} equivalent} \\ \capsep \tcode{floatfield == ios_base::fixed} & \tcode{\%f} \\ \rowsep \tcode{floatfield == ios_base::scientific \&\& !uppercase} & \tcode{\%e} \\ \rowsep \tcode{floatfield == ios_base::scientific} & \tcode{\%E} \\ \rowsep @@ -2631,7 +2631,7 @@ \begin{floattable}{Length modifier}{facet.num.put.length} {lc} \topline -\lhdr{Type} & Length modifier \\ \capsep +\lhdr{Type} & \rhdr{Length modifier} \\ \capsep \tcode{long} & \tcode{l} \\ \rowsep \tcode{long long} & \tcode{ll} \\ \rowsep \tcode{unsigned long} & \tcode{l} \\ \rowsep @@ -2646,7 +2646,7 @@ \begin{floattable}{Numeric conversions}{facet.num.put.conv} {llc} \topline -\lhdr{Type(s)} & \chdr{State} & \tcode{stdio} equivalent \\ \capsep +\lhdr{Type(s)} & \chdr{State} & \rhdr{\tcode{stdio} equivalent} \\ \capsep an integral type & \tcode{showpos} & \tcode{+} \\ & \tcode{showbase} & \tcode{\#} \\ \rowsep a floating-point type & \tcode{showpos} & \tcode{+} \\ From cb9850377b88a4d7da12d05bcdf11948c384f699 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 13 May 2024 23:47:55 +0200 Subject: [PATCH 071/162] [basic.fundamental] Center second column of "integer width" table Fixes ISO/CS comment (C++23 proof) --- source/basic.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index dac5bf7ea0..a781299962 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -5049,7 +5049,7 @@ the largest value of the corresponding unsigned type. \end{example} -\begin{floattable}{Minimum width}{basic.fundamental.width}{ll} +\begin{floattable}{Minimum width}{basic.fundamental.width}{lc} \topline \lhdr{Type} & \rhdr{Minimum width $N$} \\ \capsep From 2a2b8732e0d81dd9f5d3880b70bd451173e5f5fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 9 Jul 2024 15:41:56 +0100 Subject: [PATCH 072/162] [intro.defs] Minor rewording. Avoid sounding like a requirement. --- source/intro.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/intro.tex b/source/intro.tex index 8bfa905704..ca6009f3c9 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -292,7 +292,7 @@ \definition{format specifier}{defns.regex.format.specifier} \defncontext{regular expression} \indexdefn{format specifier}% -sequence of one or more \termref{defns.character}{character}{s} that is to be +sequence of one or more \termref{defns.character}{character}{s} that is expected to be replaced with some part of a \termref{defns.regex.regular.expression}{regular expression}{} match \definition{handler function}{defns.handler} @@ -303,7 +303,7 @@ \begin{defnote} A \Cpp{} program may designate a handler function at various points in its execution by supplying a pointer to the function when calling any of the library functions that install -handler functions\iref{support}. +handler functions (see \ref{support}). \end{defnote} \indexdefn{program!ill-formed}% From 4746925c7117015480542fd68ad5f595b78173d2 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 14 May 2024 14:11:53 +0200 Subject: [PATCH 073/162] [numeric.limits.members,bibliography] Remove LIA-1 abbreviation for ISO 10967 Fixes ISO/CS comment (C++23 proof) --- source/back.tex | 3 --- source/support.tex | 31 +++++++++++++++++-------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/source/back.tex b/source/back.tex index 4d9a27a1ec..76a454b4ce 100644 --- a/source/back.tex +++ b/source/back.tex @@ -68,9 +68,6 @@ ACM Trans.\ Math.\ Soft., Vol.\ 28, Issue 2, 2002. \end{thebibliography} -The arithmetic specification described in ISO/IEC 10967-1:2012 is -called \defn{LIA-1} in this document. - % FIXME: For unknown reasons, hanging paragraphs are not indented within our % glossaries by default. \let\realglossitem\glossitem diff --git a/source/support.tex b/source/support.tex index d0d4ca3ce7..19620a98a6 100644 --- a/source/support.tex +++ b/source/support.tex @@ -1012,6 +1012,11 @@ \pnum \indextext{signal-safe!\idxcode{numeric_limits} members}% Each member function defined in this subclause is signal-safe\iref{support.signal}. +\begin{note} +\indextext{LIA-1}% +The arithmetic specification described in ISO/IEC 10967-1:2012 is +commonly termed LIA-1. +\end{note} \indexlibrarymember{min}{numeric_limits}% \begin{itemdecl} @@ -1222,9 +1227,7 @@ \pnum Measure of the maximum rounding error. \begin{footnote} -Rounding error is described in -LIA-1 -Section 5.2.4 and +Rounding error is described in ISO/IEC 10967-1:2012 Section 5.2.4 and Annex C Rationale Section C.5.2.4 --- Rounding and rounding constants. \end{footnote} \end{itemdescr} @@ -1334,7 +1337,7 @@ \tcode{true} if the type has a representation for a quiet (non-signaling) ``Not a Number''. \begin{footnote} -Required by LIA-1. +Required by ISO/IEC 10967-1:2012. \end{footnote} \pnum @@ -1356,7 +1359,7 @@ \pnum \tcode{true} if the type has a representation for a signaling ``Not a Number''. \begin{footnote} -Required by LIA-1. +Required by ISO/IEC 10967-1:2012. \end{footnote} \pnum @@ -1378,7 +1381,7 @@ \pnum Representation of positive infinity, if available. \begin{footnote} -Required by LIA-1. +Required by ISO/IEC 10967-1:2012. \end{footnote} \pnum @@ -1397,7 +1400,7 @@ \pnum Representation of a quiet ``Not a Number'', if available. \begin{footnote} -Required by LIA-1. +Required by ISO/IEC 10967-1:2012. \end{footnote} \pnum @@ -1416,7 +1419,7 @@ \pnum Representation of a signaling ``Not a Number'', if available. \begin{footnote} -Required by LIA-1. +Required by ISO/IEC 10967-1:2012. \end{footnote} \pnum @@ -1436,7 +1439,7 @@ \pnum Minimum positive subnormal value, if available. \begin{footnote} -Required by LIA-1. +Required by ISO/IEC 10967-1:2012. \end{footnote} Otherwise, minimum positive normalized value. @@ -1474,7 +1477,7 @@ \pnum \tcode{true} if the set of values representable by the type is finite. \begin{footnote} -Required by LIA-1. +Required by ISO/IEC 10967-1:2012. \end{footnote} \begin{note} All fundamental types\iref{basic.fundamental} are bounded. This member would be \tcode{false} for arbitrary @@ -1494,7 +1497,7 @@ \pnum \tcode{true} if the type is modulo. \begin{footnote} -Required by LIA-1. +Required by ISO/IEC 10967-1:2012. \end{footnote} A type is modulo if, for any operation involving \tcode{+}, \tcode{-}, or \tcode{*} on values of that type whose result would fall outside the range @@ -1523,7 +1526,7 @@ if, at the start of the program, there exists a value of the type that would cause an arithmetic operation using that value to trap. \begin{footnote} -Required by LIA-1. +Required by ISO/IEC 10967-1:2012. \end{footnote} \pnum @@ -1542,7 +1545,7 @@ \begin{footnote} Refer to ISO/IEC/IEEE 60559. -Required by LIA-1. +Required by ISO/IEC 10967-1:2012. \end{footnote} \pnum @@ -1559,7 +1562,7 @@ The rounding style for the type. \begin{footnote} Equivalent to \tcode{FLT_ROUNDS}. -Required by LIA-1. +Required by ISO/IEC 10967-1:2012. \end{footnote} \pnum From c18d51ddf436abf39065ea86497161383bba11c0 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 15 May 2024 09:05:36 +0200 Subject: [PATCH 074/162] [intro.memory] Move footnote about Unicode trademark to [lex.phases] Fixes ISO/CS comment (C++23 proof) --- source/basic.tex | 5 ----- source/lex.tex | 8 +++++++- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index a781299962..08c08cc612 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -3086,11 +3086,6 @@ \indextext{character set!basic literal}% literal character set\iref{lex.charset} and the eight-bit code units of the Unicode -\begin{footnote} -Unicode\textregistered\ is a registered trademark of Unicode, Inc. -This information is given for the convenience of users of this document and -does not constitute an endorsement by ISO or IEC of this product. -\end{footnote} \indextext{UTF-8}% UTF-8 encoding form and is composed of a contiguous sequence of diff --git a/source/lex.tex b/source/lex.tex index 9656489b70..3c3be04db6 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -83,7 +83,13 @@ \end{note} If an input file is determined to be a UTF-8 file, then it shall be a well-formed UTF-8 code unit sequence and -it is decoded to produce a sequence of Unicode scalar values. +it is decoded to produce a sequence of Unicode +\begin{footnote} +Unicode\textregistered\ is a registered trademark of Unicode, Inc. +This information is given for the convenience of users of this document and +does not constitute an endorsement by ISO or IEC of this product. +\end{footnote} +scalar values. A sequence of translation character set elements is then formed by mapping each Unicode scalar value to the corresponding translation character set element. From 1f32f6aa8000f194f1b5c4daba94d271eea817fb Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 15 May 2024 16:28:34 +0200 Subject: [PATCH 075/162] [diff,bibliography] Move details of old C++ standards to the bibliography Fixes ISO/CS comment (C++23 proof) --- source/back.tex | 18 ++++++++++++++++++ source/compatibility.tex | 12 ++++++------ 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/source/back.tex b/source/back.tex index 76a454b4ce..e3cd10f17a 100644 --- a/source/back.tex +++ b/source/back.tex @@ -9,6 +9,24 @@ ISO/IEC 10967-1:2012, \doccite{Information technology --- Language independent arithmetic --- Part 1: Integer and floating point arithmetic} +\bibitem{iso14882:2023} + ISO/IEC 14882:2023, + \doccite{Programming Languages --- \Cpp{}} +\bibitem{iso14882:2020} + ISO/IEC 14882:2020, + \doccite{Programming Languages --- \Cpp{}} +\bibitem{iso14882:2017} + ISO/IEC 14882:2017, + \doccite{Programming Languages --- \Cpp{}} +\bibitem{iso14882:2014} + ISO/IEC 14882:2014, + \doccite{Information technology --- Programming Languages --- \Cpp{}} +\bibitem{iso14882:2011} + ISO/IEC 14882:2011, + \doccite{Information technology --- Programming Languages --- \Cpp{}} +\bibitem{iso14882:2003} + ISO/IEC 14882:2003, + \doccite{Programming Languages --- \Cpp{}} \bibitem{iso18661-3} ISO/IEC TS 18661-3:2015, \doccite{Information Technology --- diff --git a/source/compatibility.tex b/source/compatibility.tex index 9d7f7cd3bc..d80c3e5e9d 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -8,7 +8,7 @@ \pnum \indextext{summary!compatibility with ISO \CppXXIII{}}% Subclause \ref{diff.cpp23} lists the differences between \Cpp{} and -ISO \CppXXIII{} (ISO/IEC 14882:2023, \doccite{Programming Languages --- \Cpp{}}), +ISO \CppXXIII{}, by the chapters of this document. \rSec2[diff.cpp23.expr]{\ref{expr}: expressions} @@ -247,7 +247,7 @@ \pnum \indextext{summary!compatibility with ISO \CppXX{}}% Subclause \ref{diff.cpp20} lists the differences between \Cpp{} and -ISO \CppXX{} (ISO/IEC 14882:2020, \doccite{Programming Languages --- \Cpp{}}), +ISO \CppXX{}, by the chapters of this document. \rSec2[diff.cpp20.lex]{\ref{lex}: lexical conventions} @@ -617,7 +617,7 @@ \pnum \indextext{summary!compatibility with ISO \CppXVII{}}% Subclause \ref{diff.cpp17} lists the differences between \Cpp{} and -ISO \CppXVII{} (ISO/IEC 14882:2017, \doccite{Programming Languages --- \Cpp{}}), +ISO \CppXVII{}, by the chapters of this document. \rSec2[diff.cpp17.lex]{\ref{lex}: lexical conventions} @@ -1376,7 +1376,7 @@ \pnum \indextext{summary!compatibility with ISO \CppXIV{}}% Subclause \ref{diff.cpp14} lists the differences between \Cpp{} and -ISO \CppXIV{} (ISO/IEC 14882:2014, \doccite{Programming Languages --- \Cpp{}}), +ISO \CppXIV{}, in addition to those listed above, by the chapters of this document. @@ -1745,7 +1745,7 @@ \pnum \indextext{summary!compatibility with ISO \CppXI{}}% Subclause \ref{diff.cpp11} lists the differences between \Cpp{} and -ISO \CppXI{} (ISO/IEC 14882:2011, \doccite{Programming Languages --- \Cpp{}}), +ISO \CppXI{}, in addition to those listed above, by the chapters of this document. @@ -1902,7 +1902,7 @@ \pnum \indextext{summary!compatibility with ISO \CppIII{}}% Subclause \ref{diff.cpp03} lists the differences between \Cpp{} and -ISO \CppIII{} (ISO/IEC 14882:2003, \doccite{Programming Languages --- \Cpp{}}), +ISO \CppIII{}, in addition to those listed above, by the chapters of this document. From d5410b4035e3108d48a63434abfff7e377c996d2 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 15 May 2024 18:31:14 +0200 Subject: [PATCH 076/162] [diff.cpp20,diff.cpp17] Add missing inclusion clause --- source/compatibility.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/compatibility.tex b/source/compatibility.tex index d80c3e5e9d..e17c633129 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -248,6 +248,7 @@ \indextext{summary!compatibility with ISO \CppXX{}}% Subclause \ref{diff.cpp20} lists the differences between \Cpp{} and ISO \CppXX{}, +in addition to those listed above, by the chapters of this document. \rSec2[diff.cpp20.lex]{\ref{lex}: lexical conventions} @@ -618,6 +619,7 @@ \indextext{summary!compatibility with ISO \CppXVII{}}% Subclause \ref{diff.cpp17} lists the differences between \Cpp{} and ISO \CppXVII{}, +in addition to those listed above, by the chapters of this document. \rSec2[diff.cpp17.lex]{\ref{lex}: lexical conventions} From af4cf904c3d2df0675dbd456af2de2f1259e370c Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 16 May 2024 12:56:12 +0200 Subject: [PATCH 077/162] [std] Rename 'In general' headings to 'General' for consistency Fixes ISO/CS comment (C++23 proof) --- source/containers.tex | 8 ++++---- source/declarations.tex | 2 +- source/iterators.tex | 2 +- source/memory.tex | 4 ++-- source/meta.tex | 4 ++-- source/numerics.tex | 4 ++-- source/threads.tex | 4 ++-- source/time.tex | 4 ++-- source/utilities.tex | 14 +++++++------- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 6e38b932a0..946caa38f2 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -5952,7 +5952,7 @@ \rSec1[sequences]{Sequence containers} -\rSec2[sequences.general]{In general} +\rSec2[sequences.general]{General} \pnum The headers @@ -9454,7 +9454,7 @@ \rSec1[associative]{Associative containers} -\rSec2[associative.general]{In general} +\rSec2[associative.general]{General} \pnum The header \libheader{map} defines the class templates \tcode{map} and @@ -11383,7 +11383,7 @@ \rSec1[unord]{Unordered associative containers} -\rSec2[unord.general]{In general} +\rSec2[unord.general]{General} \pnum The header \libheader{unordered_map} defines the class templates @@ -13560,7 +13560,7 @@ \rSec1[container.adaptors]{Container adaptors} -\rSec2[container.adaptors.general]{In general} +\rSec2[container.adaptors.general]{General} \pnum The headers diff --git a/source/declarations.tex b/source/declarations.tex index 5a6bb65d57..e178c4ec0e 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -6323,7 +6323,7 @@ \rSec1[dcl.fct.def]{Function definitions}% \indextext{definition!function|(} -\rSec2[dcl.fct.def.general]{In general} +\rSec2[dcl.fct.def.general]{General} \pnum \indextext{body!function}% diff --git a/source/iterators.tex b/source/iterators.tex index c59e2264c3..854ed194e2 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -519,7 +519,7 @@ \rSec1[iterator.requirements]{Iterator requirements} -\rSec2[iterator.requirements.general]{In general} +\rSec2[iterator.requirements.general]{General} \pnum \indextext{requirements!iterator}% diff --git a/source/memory.tex b/source/memory.tex index 088382414a..4958d644ef 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -20,7 +20,7 @@ \rSec1[memory]{Memory} -\rSec2[memory.general]{In general} +\rSec2[memory.general]{General} \pnum Subclause~\ref{memory} describes the contents of the header @@ -1935,7 +1935,7 @@ \rSec3[unique.ptr.dltr]{Default deleters} -\rSec4[unique.ptr.dltr.general]{In general} +\rSec4[unique.ptr.dltr.general]{General} \pnum The class template \tcode{default_delete} serves as the default deleter (destruction policy) diff --git a/source/meta.tex b/source/meta.tex index 17cbbf91dd..93f156fdd6 100644 --- a/source/meta.tex +++ b/source/meta.tex @@ -15,7 +15,7 @@ \rSec1[intseq]{Compile-time integer sequences} -\rSec2[intseq.general]{In general} +\rSec2[intseq.general]{General} \pnum The library provides a class template that can represent an integer sequence. @@ -2520,7 +2520,7 @@ \rSec1[ratio]{Compile-time rational arithmetic} -\rSec2[ratio.general]{In general} +\rSec2[ratio.general]{General} \pnum \indexlibraryglobal{ratio}% diff --git a/source/numerics.tex b/source/numerics.tex index e08036998a..c9b7df4673 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -3073,7 +3073,7 @@ \rSec2[rand.adapt]{Random number engine adaptor class templates} -\rSec3[rand.adapt.general]{In general} +\rSec3[rand.adapt.general]{General} \pnum Each type instantiated @@ -4138,7 +4138,7 @@ \rSec2[rand.dist]{Random number distribution class templates}% \indextext{random number generation!distributions|(} -\rSec3[rand.dist.general]{In general} +\rSec3[rand.dist.general]{General} \pnum Each type instantiated diff --git a/source/threads.tex b/source/threads.tex index 354a99f6ba..a9fe8064f3 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -169,7 +169,7 @@ \rSec2[thread.req.lockable]{Requirements for \oldconcept{Lockable} types} -\rSec3[thread.req.lockable.general]{In general} +\rSec3[thread.req.lockable.general]{General} \pnum An \defn{execution agent} is an entity such as a thread that may perform work in parallel with @@ -6208,7 +6208,7 @@ \rSec2[thread.mutex.requirements]{Mutex requirements} -\rSec3[thread.mutex.requirements.general]{In general} +\rSec3[thread.mutex.requirements.general]{General} \pnum A mutex object facilitates protection against data races and allows safe synchronization of diff --git a/source/time.tex b/source/time.tex index aa4addb0fd..3f4ad38538 100644 --- a/source/time.tex +++ b/source/time.tex @@ -3921,7 +3921,7 @@ \rSec1[time.cal]{The civil calendar} -\rSec2[time.cal.general]{In general} +\rSec2[time.cal.general]{General} \pnum The types in \ref{time.cal} describe the civil (Gregorian) calendar @@ -8732,7 +8732,7 @@ \rSec1[time.zone]{Time zones} -\rSec2[time.zone.general]{In general} +\rSec2[time.zone.general]{General} \pnum \ref{time.zone} describes an interface for accessing diff --git a/source/utilities.tex b/source/utilities.tex index 78e28e7ab5..edd39a0764 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -711,7 +711,7 @@ \rSec1[pairs]{Pairs} -\rSec2[pairs.general]{In general} +\rSec2[pairs.general]{General} \pnum The library provides a template for heterogeneous pairs of values. @@ -1482,7 +1482,7 @@ \rSec1[tuple]{Tuples} -\rSec2[tuple.general]{In general} +\rSec2[tuple.general]{General} \pnum \indexlibraryglobal{tuple}% @@ -3144,7 +3144,7 @@ \rSec1[optional]{Optional objects} -\rSec2[optional.general]{In general} +\rSec2[optional.general]{General} \pnum Subclause~\ref{optional} describes class template \tcode{optional} that represents @@ -4864,7 +4864,7 @@ \rSec1[variant]{Variants} -\rSec2[variant.general]{In general} +\rSec2[variant.general]{General} \pnum A variant object holds and manages the lifetime of a value. @@ -6985,7 +6985,7 @@ \rSec1[expected]{Expected objects} \indexlibraryglobal{expected}% -\rSec2[expected.general]{In general} +\rSec2[expected.general]{General} \pnum Subclause \ref{expected} describes the class template \tcode{expected} @@ -15114,7 +15114,7 @@ \end{itemdescr} \rSec1[execpol]{Execution policies} -\rSec2[execpol.general]{In general} +\rSec2[execpol.general]{General} \pnum Subclause~\ref{execpol} describes classes that are \defn{execution policy} types. An @@ -15847,7 +15847,7 @@ \rSec2[format.string]{Format string} -\rSec3[format.string.general]{In general} +\rSec3[format.string.general]{General} \pnum A \defn{format string} for arguments \tcode{args} is From 9d3011b4224bb63636f4a117967e8ba8110f5ba4 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 17 May 2024 14:11:48 +0200 Subject: [PATCH 078/162] [implimits] Rephrase introductory sentence for list of quantities Fixes ISO/CS comment (C++23 proof) --- source/limits.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/limits.tex b/source/limits.tex index 60c9dc3b69..ca3953634b 100644 --- a/source/limits.tex +++ b/source/limits.tex @@ -12,8 +12,8 @@ or are unknown. \pnum -The limits may constrain quantities -that include those described below or others. +The following list describes quantities that, among others, may be +constrained by implementations. The bracketed number following each quantity is recommended as the minimum for that quantity. However, these quantities are only guidelines and do not determine compliance. From 260d3a0d0cde1431dd4221115e1b37979ee07e7d Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 16 May 2024 12:30:44 +0200 Subject: [PATCH 079/162] [class.copy.ctor] Remove reference to non-existing example Fixes ISO/CS comment (C++23 proof) --- source/classes.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/classes.tex b/source/classes.tex index 873bebee75..3230121c34 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -1594,7 +1594,7 @@ \tcode{X} performs a memberwise copy/move of its bases and members. \begin{note} -Default member initializers of non-static data members are ignored. See also the example in~\ref{class.base.init}. +Default member initializers of non-static data members are ignored. \end{note} The order of initialization is the same as the order of initialization of bases and members in a user-defined constructor (see~\ref{class.base.init}). From 0bc3e030be28ff2191af8e9c9c202bff6e23c320 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 16 May 2024 12:37:12 +0200 Subject: [PATCH 080/162] [class.conv.general] Remove vague reference to unhelpful examples Fixes ISO/CS comment (C++23 proof) --- source/classes.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index 3230121c34..347a6f85eb 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -2292,8 +2292,7 @@ \pnum \begin{note} -See~\ref{over.match} for a discussion of the use of conversions in function calls -as well as examples below. +See~\ref{over.match} for a discussion of the use of conversions in function calls. \end{note} \pnum From 861f07de24c5cfbd69840038d8589bc13b24b7e7 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 15 May 2024 21:58:36 +0200 Subject: [PATCH 081/162] [cpp.predefined,namespace.future,version.syn] Replace 'C++' with 'this document' Fixes ISO/CS comment (C++23 proof) --- source/preprocessor.tex | 4 ++-- source/support.tex | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 913fcc20fb..db4bce19d1 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -1704,7 +1704,7 @@ \xname{cplusplus}\\ The integer literal \tcode{\cppver}. \begin{note} -Future revisions of \Cpp{} will +Future revisions of this document will replace the value of this macro with a greater value. \end{note} @@ -1712,7 +1712,7 @@ The macros defined in \tref{cpp.predefined.ft} shall be defined to the corresponding integer literal. \begin{note} -Future revisions of \Cpp{} might replace +Future revisions of this document might replace the values of these macros with greater values. \end{note} diff --git a/source/support.tex b/source/support.tex index 19620a98a6..ffd0c43b11 100644 --- a/source/support.tex +++ b/source/support.tex @@ -546,7 +546,7 @@ after inclusion of any member of the set of library headers indicated in the corresponding comment in this synopsis. \begin{note} -Future revisions of \Cpp{} might replace +Future revisions of this document might replace the values of these macros with greater values. \end{note} From a7a2cbd10ea752d49ca286e3fea3e7cbbb9b6e9d Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 17 May 2024 00:44:32 +0200 Subject: [PATCH 082/162] [futures.state] Turn note into example Fixes ISO/CS comment (C++23 proof) --- source/threads.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index a9fe8064f3..b1f22c9fdc 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -10259,9 +10259,9 @@ state. The result of a shared state is set by respective functions on the asynchronous provider. -\begin{note} -Such as promises or tasks. -\end{note} +\begin{example} +Promises and tasks are examples of asynchronous providers. +\end{example} The means of setting the result of a shared state is specified in the description of those classes and functions that create such a state object. From 88c48bb78815576fb20db42b89f381c580d28b0e Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 14 May 2024 22:41:24 +0200 Subject: [PATCH 083/162] [std] Remove colons in front of bulleted lists --- source/algorithms.tex | 4 ++-- source/basic.tex | 26 +++++++++++++------------- source/classes.tex | 14 +++++++------- source/concepts.tex | 8 ++++---- source/declarations.tex | 2 +- source/expressions.tex | 4 ++-- source/iostreams.tex | 8 ++++---- source/iterators.tex | 8 ++++---- source/lib-intro.tex | 6 +++--- source/meta.tex | 4 ++-- source/modules.tex | 2 +- source/ranges.tex | 2 +- source/regex.tex | 2 +- source/support.tex | 8 ++++---- source/templates.tex | 4 ++-- source/threads.tex | 14 +++++++------- source/time.tex | 2 +- 17 files changed, 59 insertions(+), 59 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index ed658e1650..52a3c74c02 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -4403,7 +4403,7 @@ \pnum \complexity -No applications of the corresponding predicate and projections if: +No applications of the corresponding predicate and projections if \begin{itemize} \item for the first overload, @@ -6608,7 +6608,7 @@ from position \tcode{first + i} into position \tcode{first + n + i} for each non-negative integer \tcode{i < (last - first) - n}. Does so in order starting -from \tcode{i = (last - first) - n - 1} and proceeding to \tcode{i = 0} if: +from \tcode{i = (last - first) - n - 1} and proceeding to \tcode{i = 0} if \begin{itemize} \item for the overload in namespace \tcode{std} diff --git a/source/basic.tex b/source/basic.tex index 08c08cc612..886d90ac97 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -497,7 +497,7 @@ \pnum A local entity\iref{basic.pre} -is \defn{odr-usable} in a scope\iref{basic.scope.scope} if: +is \defn{odr-usable} in a scope\iref{basic.scope.scope} if \begin{itemize} \item either the local entity is not \tcode{*\keyword{this}}, or an enclosing class or non-lambda function parameter scope exists and, @@ -607,7 +607,7 @@ \begin{note} The rules for declarations and expressions describe in which contexts complete class types are required. A class -type \tcode{T} must be complete if: +type \tcode{T} must be complete if \begin{itemize} \item an object of type \tcode{T} is defined\iref{basic.def}, or \item a non-static class data member of type \tcode{T} is @@ -909,7 +909,7 @@ \pnum Two non-static member functions have -\defnadjx{corresponding}{object parameters}{object parameter} if: +\defnadjx{corresponding}{object parameters}{object parameter} if \begin{itemize} \item exactly one is an implicit object member function @@ -922,7 +922,7 @@ \end{itemize} \indextext{template!function!corresponding object parameter}% Two non-static member function templates have -\defnadjx{corresponding}{object parameters}{object parameter} if: +\defnadjx{corresponding}{object parameters}{object parameter} if \begin{itemize} \item exactly one is an implicit object member function @@ -963,7 +963,7 @@ and they do not declare corresponding overloads. \end{itemize} Two function or function template declarations declare -\defn{corresponding overloads} if: +\defn{corresponding overloads} if \begin{itemize} \item both declare functions with the same non-object-parameter-type-list, @@ -3201,7 +3201,7 @@ in storage associated with a member subobject or array element \placeholder{e} (which may or may not be within its lifetime), the created object -is a subobject of \placeholder{e}'s containing object if: +is a subobject of \placeholder{e}'s containing object if \begin{itemize} \item the lifetime of \placeholder{e}'s containing object has begun and not ended, and @@ -3218,7 +3218,7 @@ of type ``array of $N$ \tcode{\keyword{unsigned} \keyword{char}}'' or of type ``array of $N$ \tcode{std::byte}''\iref{cstddef.syn}, that array \defn{provides storage} -for the created object if: +for the created object if \begin{itemize} \item the lifetime of \placeholder{e} has begun and not ended, and @@ -3261,7 +3261,7 @@ \pnum \indextext{object!nested within}% -An object \placeholder{a} is \defn{nested within} another object \placeholder{b} if: +An object \placeholder{a} is \defn{nested within} another object \placeholder{b} if \begin{itemize} \item \placeholder{a} is a subobject of \placeholder{b}, or @@ -3546,7 +3546,7 @@ if the pointer were of type \tcode{\keyword{void}*} is well-defined. Indirection through such a pointer is permitted but the resulting lvalue may only be used in limited ways, as described below. The -program has undefined behavior if: +program has undefined behavior if \begin{itemize} \item the pointer is used as the operand of a \grammarterm{delete-expression}, @@ -3609,7 +3609,7 @@ a glvalue refers to allocated storage\iref{basic.stc.dynamic.allocation}, and using the properties of the glvalue that do not depend on its value is -well-defined. The program has undefined behavior if: +well-defined. The program has undefined behavior if \begin{itemize} \item the glvalue is used to access the object, or \item the glvalue is used to call a non-static member function of the object, or @@ -3620,7 +3620,7 @@ \end{itemize} \pnum -An object $o_1$ is \defn{transparently replaceable} by an object $o_2$ if: +An object $o_1$ is \defn{transparently replaceable} by an object $o_2$ if \begin{itemize} \item the storage that $o_2$ occupies exactly overlays the storage that $o_1$ occupied, and @@ -5520,7 +5520,7 @@ \end{note} \pnum -Two objects \placeholder{a} and \placeholder{b} are \defn{pointer-interconvertible} if: +Two objects \placeholder{a} and \placeholder{b} are \defn{pointer-interconvertible} if \begin{itemize} \item they are the same object, or @@ -6297,7 +6297,7 @@ \pnum An evaluation $A$ \defn{happens before} an evaluation $B$ -(or, equivalently, $B$ \defn{happens after} $A$) if: +(or, equivalently, $B$ \defn{happens after} $A$) if \begin{itemize} \item $A$ is sequenced before $B$, or \item $A$ inter-thread happens before $B$. diff --git a/source/classes.tex b/source/classes.tex index 347a6f85eb..9076cd6f88 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -1058,7 +1058,7 @@ \end{example} \pnum -Two special member functions are of the same kind if: +Two special member functions are of the same kind if \begin{itemize} \item they are both default constructors, \item they are both copy or move constructors @@ -1224,7 +1224,7 @@ inline public member of its class. \pnum -A defaulted default constructor for class \tcode{X} is defined as deleted if: +A defaulted default constructor for class \tcode{X} is defined as deleted if \begin{itemize} \item any non-static data member with no default member initializer\iref{class.mem} is of reference type, @@ -1260,7 +1260,7 @@ \pnum A default constructor is \defnx{trivial}{constructor!default!trivial} -if it is not user-provided and if: +if it is not user-provided and if \begin{itemize} \item its class has no virtual functions\iref{class.virtual} and no virtual base @@ -1547,7 +1547,7 @@ \tcode{X} is trivial -if it is not user-provided and if: +if it is not user-provided and if \begin{itemize} \item class @@ -1831,7 +1831,7 @@ \tcode{X} is trivial -if it is not user-provided and if: +if it is not user-provided and if \begin{itemize} \item class @@ -2029,7 +2029,7 @@ \pnum A defaulted destructor for a class - \tcode{X} is defined as deleted if: + \tcode{X} is defined as deleted if \begin{itemize} \item any potentially constructed subobject has class type \tcode{M} (or possibly multi-dimensional array thereof) and @@ -2043,7 +2043,7 @@ \end{itemize} \pnum -A destructor is trivial if it is not user-provided and if: +A destructor is trivial if it is not user-provided and if \begin{itemize} \item the destructor is not virtual, diff --git a/source/concepts.tex b/source/concepts.tex index 0508cb542b..fe54447105 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -420,7 +420,7 @@ let \tcode{u1} and \tcode{u2} be equality-preserving expressions such that \tcode{decltype((u1))} and \tcode{decltype((u2))} are each \tcode{U}. \tcode{T} and \tcode{U} model \tcode{\libconcept{common_reference_with}} -only if: +only if \begin{itemize} \item \tcode{C(t1)} equals \tcode{C(t2)} if and only if \tcode{t1} equals \tcode{t2}, and @@ -473,7 +473,7 @@ let \tcode{u1} and \tcode{u2} be equality-preserving expressions such that \tcode{decltype((u1))} and \tcode{decltype((u2))} are each \tcode{U}. \tcode{T} and \tcode{U} model \tcode{\libconcept{common_with}} -only if: +only if \begin{itemize} \item \tcode{C(t1)} equals \tcode{C(t2)} if and only if \tcode{t1} equals \tcode{t2}, and @@ -881,7 +881,7 @@ \pnum Let \tcode{e} be an expression such that \tcode{decltype((e))} is \tcode{T}. -\tcode{T} models \exposconcept{boolean-testable-impl} only if: +\tcode{T} models \exposconcept{boolean-testable-impl} only if \begin{itemize} \item @@ -1024,7 +1024,7 @@ let \tcode{u1} and \tcode{u2} be equality-preserving expressions that are lvalues of type \tcode{remove_cvref_t}. \tcode{T} and \tcode{U} model -\tcode{\exposconcept{comparison-common-type-with}} only if: +\tcode{\exposconcept{comparison-common-type-with}} only if \begin{itemize} \item \tcode{\exposid{CONVERT_TO_LVALUE}(t1)} equals diff --git a/source/declarations.tex b/source/declarations.tex index e178c4ec0e..220d944f1c 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -888,7 +888,7 @@ \pnum \indextext{specifier!\idxcode{constexpr}!function}% \indextext{constexpr function}% -A function is \defn{constexpr-suitable} if: +A function is \defn{constexpr-suitable} if \begin{itemize} \item it is not a coroutine\iref{dcl.fct.def.coroutine}, and diff --git a/source/expressions.tex b/source/expressions.tex index 683b30137f..5115189f95 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -5301,7 +5301,7 @@ If the \grammarterm{expression} in a \grammarterm{noptr-new-declarator} is present, it is implicitly converted to \tcode{std::size_t}. \indextext{function!allocation}% -The value of the \grammarterm{expression} is invalid if: +The value of the \grammarterm{expression} is invalid if \begin{itemize} \item the expression is of non-class type and its value before converting to @@ -7842,7 +7842,7 @@ \end{example} \pnum -An object \tcode{a} is said to have \defnadj{constant}{destruction} if: +An object \tcode{a} is said to have \defnadj{constant}{destruction} if \begin{itemize} \item it is not of class type nor (possibly multidimensional) array thereof, or diff --git a/source/iostreams.tex b/source/iostreams.tex index 5684e8802f..de2ea952e3 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -17301,7 +17301,7 @@ \impldef{effect of \tcode{filesystem::copy}}. \item -Otherwise, an error is reported as specified in~\ref{fs.err.report} if: +Otherwise, an error is reported as specified in~\ref{fs.err.report} if \begin{itemize} \item \tcode{exists(f)} is \tcode{false}, or \item \tcode{equivalent(from, to)} is \tcode{true}, or @@ -17459,7 +17459,7 @@ As follows: \begin{itemize} \item -Report an error as specified in~\ref{fs.err.report} if: +Report an error as specified in~\ref{fs.err.report} if \begin{itemize} \item \tcode{is_regular_file(from)} is \tcode{false}, or \item \tcode{exists(to)} is \tcode{true} and \tcode{is_regular_file(to)} is \tcode{false}, or @@ -17474,7 +17474,7 @@ \item Otherwise, copy the contents and attributes of the file \tcode{from} - resolves to, to the file \tcode{to} resolves to, if: + resolves to, to the file \tcode{to} resolves to, if \begin{itemize} \item \tcode{exists(to)} is \tcode{false}, or \item \tcode{(options \& copy_options::overwrite_existing) != copy_options::none}, or @@ -18598,7 +18598,7 @@ \begin{itemdescr} \pnum \effects -As if: +As if by: \begin{codeblock} error_code ec; file_status result = status(p, ec); diff --git a/source/iterators.tex b/source/iterators.tex index 854ed194e2..ae3c8c39c4 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1829,7 +1829,7 @@ \pnum Two dereferenceable iterators \tcode{a} and \tcode{b} of type \tcode{X} -offer the \defn{multi-pass guarantee} if: +offer the \defn{multi-pass guarantee} if \begin{itemize} \item \tcode{a == b} implies \tcode{++a == ++b} and \item the expression @@ -1872,7 +1872,7 @@ \pnum Let \tcode{a} and \tcode{b} be equal objects of type \tcode{I}. -\tcode{I} models \libconcept{bidirectional_iterator} only if: +\tcode{I} models \libconcept{bidirectional_iterator} only if \begin{itemize} \item If \tcode{a} and \tcode{b} are decrementable, then all of the following are \tcode{true}: @@ -2021,7 +2021,7 @@ bidirectional.iterators,random.access.iterators}. \pnum -A type \tcode{X} meets the \defnoldconcept{Iterator} requirements if: +A type \tcode{X} meets the \defnoldconcept{Iterator} requirements if \begin{itemize} \item \tcode{X} meets the \oldconcept{CopyConstructible}, \oldconcept{CopyAssignable}, \oldconcept{Swappable}, and \oldconcept{Destructible} requirements\iref{utility.arg.requirements,swappable.requirements}, and @@ -2246,7 +2246,7 @@ \pnum Two dereferenceable iterators \tcode{a} and \tcode{b} of type \tcode{X} offer the -\defn{multi-pass guarantee} if: +\defn{multi-pass guarantee} if \begin{itemize} \item \tcode{a == b} implies \tcode{++a == ++b} and \item \tcode{X} is a pointer type or the expression diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 9e575b57d1..1422d19a57 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1822,7 +1822,7 @@ denote an expression of type \tcode{U}. \pnum -An object \tcode{t} is \defn{swappable with} an object \tcode{u} if and only if: +An object \tcode{t} is \defn{swappable with} an object \tcode{u} if and only if \begin{itemize} \item the expressions \tcode{swap(t, u)} and \tcode{swap(u, t)} are valid when evaluated in the context described below, and @@ -1924,7 +1924,7 @@ \pnum A \oldconcept{NullablePointer} type is a pointer-like type that supports null values. -A type \tcode{P} meets the \oldconcept{\-Nullable\-Pointer} requirements if: +A type \tcode{P} meets the \oldconcept{\-Nullable\-Pointer} requirements if \begin{itemize} \item \tcode{P} meets the \oldconcept{EqualityComparable}, \oldconcept{DefaultConstructible}, \oldconcept{CopyConstructible}, \oldconcept{\-Copy\-Assign\-able}, @@ -2000,7 +2000,7 @@ \rSec3[hash.requirements]{\oldconcept{Hash} requirements} \pnum -A type \tcode{H} meets the \defnoldconcept{Hash} requirements if: +A type \tcode{H} meets the \defnoldconcept{Hash} requirements if \begin{itemize} \item it is a function object type\iref{function.objects}, \item it meets the \oldconcept{CopyConstructible} (\tref{cpp17.copyconstructible}) and diff --git a/source/meta.tex b/source/meta.tex index 93f156fdd6..773c047dfa 100644 --- a/source/meta.tex +++ b/source/meta.tex @@ -138,7 +138,7 @@ \pnum Unless otherwise specified, an incomplete type may be used to instantiate a template specified in \ref{type.traits}. -The behavior of a program is undefined if: +The behavior of a program is undefined if \begin{itemize} \item an instantiation of a template specified in \ref{type.traits} @@ -1341,7 +1341,7 @@ \pnum The predicate condition for a template specialization \tcode{has_unique_object_representations} -shall be satisfied if and only if: +shall be satisfied if and only if \begin{itemize} \item \tcode{T} is trivially copyable, and \item any two objects of type \tcode{T} with the same value diff --git a/source/modules.tex b/source/modules.tex index 52873a37ae..2ed009a3b6 100644 --- a/source/modules.tex +++ b/source/modules.tex @@ -593,7 +593,7 @@ \pnum A declaration $D$ is \defn{decl-reachable} from a declaration $S$ -in the same translation unit if: +in the same translation unit if \begin{itemize} \item $D$ does not declare a function or function template and diff --git a/source/ranges.tex b/source/ranges.tex index 4ecb835455..9f0f281290 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1433,7 +1433,7 @@ \begin{itemdescr} \pnum -\tcode{T} models \libconcept{view} only if: +\tcode{T} models \libconcept{view} only if \begin{itemize} \item \tcode{T} has \bigoh{1} move construction; and diff --git a/source/regex.tex b/source/regex.tex index bbec2e9f78..495a9ac354 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -2701,7 +2701,7 @@ \pnum \returns \tcode{true} if neither match result is ready, \tcode{false} if one match result is ready and the -other is not. If both match results are ready, returns \tcode{true} only if: +other is not. If both match results are ready, returns \tcode{true} only if \begin{itemize} \item \tcode{m1.empty() \&\& m2.empty()}, or diff --git a/source/support.tex b/source/support.tex index ffd0c43b11..e8b47cd3ee 100644 --- a/source/support.tex +++ b/source/support.tex @@ -4787,7 +4787,7 @@ lvalues of types \tcode{const remove_reference_t} and \tcode{const remove_reference_t}, respectively. \tcode{T} and \tcode{U} model -\tcode{\exposconcept{partially-ordered-with}} only if: +\tcode{\exposconcept{partially-ordered-with}} only if \begin{itemize} \item \tcode{t < u}, @@ -4798,7 +4798,7 @@ \tcode{u <= t}, \tcode{u > t}, and \tcode{u >= t} - have the same domain. + have the same domain, \item \tcode{bool(t < u) == bool(u > t)} is \tcode{true}, \item @@ -4823,7 +4823,7 @@ Let \tcode{a} and \tcode{b} be lvalues of type \tcode{const remove_reference_t}. \tcode{T} and \tcode{Cat} -model \tcode{\libconcept{three_way_comparable}} only if: +model \tcode{\libconcept{three_way_comparable}} only if \begin{itemize} \item \tcode{(a <=> b == 0) == bool(a == b)} is \tcode{true}, @@ -4873,7 +4873,7 @@ Let \tcode{\exposid{CONVERT_TO_LVALUE}(E)} be defined as in \ref{concepts.compare.general}. \tcode{T}, \tcode{U}, and \tcode{Cat} -model \tcode{\libconcept{three_way_comparable_with}} only if: +model \tcode{\libconcept{three_way_comparable_with}} only if \begin{itemize} \item \tcode{t <=> u} and \tcode{u <=> t} have the same domain, diff --git a/source/templates.tex b/source/templates.tex index be31e19615..480f6dc0e5 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -4504,7 +4504,7 @@ Knowing which names are type names allows the syntax of every template to be checked in this way. \end{note} -The program is ill-formed, no diagnostic required, if: +The program is ill-formed, no diagnostic required, if \begin{itemize} \item no valid specialization, @@ -5310,7 +5310,7 @@ \pnum An \grammarterm{id-expression} -is value-dependent if: +is value-dependent if \begin{itemize} \item it is a concept-id and any of its arguments are dependent, diff --git a/source/threads.tex b/source/threads.tex index b1f22c9fdc..b5b4b54001 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -673,7 +673,7 @@ \begin{itemdescr} \pnum \returns -\tcode{false} if: +\tcode{false} if \begin{itemize} \item \tcode{*this} does not have ownership of a stop state, or \item a stop request was not made @@ -6485,7 +6485,7 @@ released may ownership be acquired by another thread. \pnum -The behavior of a program is undefined if: +The behavior of a program is undefined if \begin{itemize} \item it destroys a \tcode{recursive_mutex} object owned by any thread or \item a thread terminates while owning a \tcode{recursive_mutex} object. @@ -6636,7 +6636,7 @@ It is a standard-layout class\iref{class.prop}. \pnum -The behavior of a program is undefined if: +The behavior of a program is undefined if \begin{itemize} \item it destroys a \tcode{timed_mutex} object owned by any thread, \item a thread that owns a \tcode{timed_mutex} object calls \tcode{lock()}, @@ -6701,7 +6701,7 @@ may ownership of the object be acquired by another thread. \pnum -The behavior of a program is undefined if: +The behavior of a program is undefined if \begin{itemize} \item it destroys a \tcode{recursive_timed_mutex} object owned by any thread, or \item a thread terminates while owning a \tcode{recursive_timed_mutex} object. @@ -6873,7 +6873,7 @@ It is a standard-layout class\iref{class.prop}. \pnum -The behavior of a program is undefined if: +The behavior of a program is undefined if \begin{itemize} \item it destroys a \tcode{shared_mutex} object owned by any thread, \item a thread attempts to recursively gain any ownership of a \tcode{shared_mutex}, or @@ -7035,7 +7035,7 @@ It is a standard-layout class\iref{class.prop}. \pnum -The behavior of a program is undefined if: +The behavior of a program is undefined if \begin{itemize} \item it destroys a \tcode{shared_timed_mutex} object owned by any thread, \item a thread attempts to recursively gain any ownership of a \tcode{shared_timed_mutex}, or @@ -12232,7 +12232,7 @@ \pnum A hazard-protectable object \tcode{x} is \defn{possibly-reclaimable} -with respect to an evaluation $A$ if: +with respect to an evaluation $A$ if \begin{itemize} \item \tcode{x} is not reclaimed; and diff --git a/source/time.tex b/source/time.tex index 3f4ad38538..dd353f9904 100644 --- a/source/time.tex +++ b/source/time.tex @@ -1036,7 +1036,7 @@ \end{note} \pnum -A type \tcode{TC} meets the \defnoldconcept{TrivialClock} requirements if: +A type \tcode{TC} meets the \defnoldconcept{TrivialClock} requirements if \begin{itemize} \item \tcode{TC} meets the \oldconcept{Clock} requirements, From 9d7aa6108b84a09117463d0b13bc24cf61926897 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 14 May 2024 22:47:38 +0200 Subject: [PATCH 084/162] [iterators] Add colon after 'model ... only if' when complete sentences follow --- source/iterators.tex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index ae3c8c39c4..2da91d8319 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1338,7 +1338,7 @@ \pnum Let \tcode{E} be an expression such that \tcode{decltype((E))} is \tcode{T}, and let \tcode{o} be a dereferenceable object of type \tcode{Out}. -\tcode{Out} and \tcode{T} model \tcode{\libconcept{indirectly_writable}} only if +\tcode{Out} and \tcode{T} model \tcode{\libconcept{indirectly_writable}} only if: \begin{itemize} \item If \tcode{Out} and \tcode{T} model \tcode{\libconcept{indirectly_readable} \&\& \libconcept{same_as}, decay_t>}, @@ -1544,7 +1544,7 @@ \pnum Let \tcode{i} be an object of type \tcode{I}. When \tcode{i} is in the domain of both pre- and post-increment, \tcode{i} is said to be \defn{incrementable}. -\tcode{I} models \tcode{\libconcept{weakly_incrementable}} only if +\tcode{I} models \tcode{\libconcept{weakly_incrementable}} only if: \begin{itemize} \item The expressions \tcode{++i} and \tcode{i++} have the same domain. \item If \tcode{i} is incrementable, then both \tcode{++i} @@ -1591,7 +1591,7 @@ \pnum Let \tcode{a} and \tcode{b} be incrementable objects of type \tcode{I}. -\tcode{I} models \libconcept{incrementable} only if +\tcode{I} models \libconcept{incrementable} only if: \begin{itemize} \item If \tcode{bool(a == b)} then \tcode{bool(a++ == b)}. \item If \tcode{bool(a == b)} then \tcode{bool(((void)a++, a) == ++b)}. @@ -1654,7 +1654,7 @@ \pnum Let \tcode{s} and \tcode{i} be values of type \tcode{S} and \tcode{I} such that \range{i}{s} denotes a range. Types -\tcode{S} and \tcode{I} model \tcode{\libconcept{sentinel_for}} only if +\tcode{S} and \tcode{I} model \tcode{\libconcept{sentinel_for}} only if: \begin{itemize} \item \tcode{i == s} is well-defined. @@ -1699,7 +1699,7 @@ a sentinel of type \tcode{S} such that \range{i}{s} denotes a range. Let $N$ be the smallest number of applications of \tcode{++i} necessary to make \tcode{bool(i == s)} be \tcode{true}. -\tcode{S} and \tcode{I} model \tcode{\libconcept{sized_sentinel_for}} only if +\tcode{S} and \tcode{I} model \tcode{\libconcept{sized_sentinel_for}} only if: \begin{itemize} \item If $N$ is representable by \tcode{iter_difference_t}, then \tcode{s - i} is well-defined and equals $N$. @@ -1872,7 +1872,7 @@ \pnum Let \tcode{a} and \tcode{b} be equal objects of type \tcode{I}. -\tcode{I} models \libconcept{bidirectional_iterator} only if +\tcode{I} models \libconcept{bidirectional_iterator} only if: \begin{itemize} \item If \tcode{a} and \tcode{b} are decrementable, then all of the following are \tcode{true}: @@ -1918,7 +1918,7 @@ after \tcode{n} applications of \tcode{++a}, let \tcode{D} be \tcode{iter_difference_t}, and let \tcode{n} denote a value of type \tcode{D}. -\tcode{I} models \libconcept{random_access_iterator} only if +\tcode{I} models \libconcept{random_access_iterator} only if: \begin{itemize} \item \tcode{(a += n)} is equal to \tcode{b}. \item \tcode{addressof(a += n)} is equal to \tcode{addressof(a)}. From 79ac47f7053da4ef20c117e282377591d028e7a5 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 15 May 2024 21:42:09 +0200 Subject: [PATCH 085/162] [basic.fundamental,cstdarg.syn] Use full reference for ISO C sections Fixes ISO/CS comment (C++23) --- source/basic.tex | 4 ++-- source/support.tex | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 886d90ac97..24342733c4 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -5065,11 +5065,11 @@ alternative representations of the value specified by the value representation. \begin{note} Padding bits have unspecified value, but cannot cause traps. -In contrast, see ISO C 6.2.6.2. +In contrast, see \IsoC{} 6.2.6.2. \end{note} \begin{note} The signed and unsigned integer types satisfy -the constraints given in ISO C 5.2.4.2.1. +the constraints given in \IsoC{} 5.2.4.2.1. \end{note} Except as specified above, the width of a signed or unsigned integer type is diff --git a/source/support.tex b/source/support.tex index e8b47cd3ee..755e9b27c6 100644 --- a/source/support.tex +++ b/source/support.tex @@ -5805,7 +5805,7 @@ standard library header \libheader{stdarg.h}, with the following changes: \begin{itemize} \item -In lieu of the default argument promotions specified in ISO C 6.5.2.2, +In lieu of the default argument promotions specified in \IsoC{} 6.5.2.2, the definition in~\ref{expr.call} applies. \item The restrictions that ISO C places on the second parameter to the From 2bbf136502811925250b09fd73909b78e0236091 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 16 May 2024 12:51:32 +0200 Subject: [PATCH 086/162] [execpol.general] Use 'this document', not 'this standard' Fixes ISO/CS comment (C++23 proof) --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index edd39a0764..575f4019e3 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -15141,7 +15141,7 @@ \end{example} \begin{note} Implementations can provide additional execution policies -to those described in this standard as extensions +to those described in this document as extensions to address parallel architectures that require idiosyncratic parameters for efficient execution. \end{note} From e65393f3c87d323258e38c498b849dc57404a20b Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 15 May 2024 22:13:14 +0200 Subject: [PATCH 087/162] [format.string.std] Add (R) symbol after Windows Fixes ISO/CS comment (C++23 proof) --- source/utilities.tex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 575f4019e3..bf4f91d468 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -16260,14 +16260,13 @@ Implementations should use either UTF-8, UTF-16, or UTF-32, on platforms capable of displaying Unicode text in a terminal. \begin{note} -This is the case for Windows +This is the case for Windows\textregistered{}-based \begin{footnote} Windows\textregistered\ is a registered trademark of Microsoft Corporation. This information is given for the convenience of users of this document and does not constitute an endorsement by ISO or IEC of this product. -\end{footnote}% --based and -many POSIX-based operating systems. +\end{footnote} +and many POSIX-based operating systems. \end{note} \pnum From dafefea895de358b8edcb6780e3c7b71d209b458 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 14 May 2024 19:12:57 +0200 Subject: [PATCH 088/162] [rand.req] Replace 'that Table' with a precise reference Fixes ISO/CS comment (C++23 proof) --- source/numerics.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index c9b7df4673..91907ac4bd 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -1660,7 +1660,7 @@ are valid and have the indicated semantics, and if \tcode{S} also meets all other requirements of this subclause \ref{rand.req.seedseq}. -In that Table and throughout this subclause: +In \tref{rand.req.seedseq} and throughout this subclause: \begin{itemize} \item \tcode{T} is the type named by @@ -1876,7 +1876,7 @@ are valid and have the indicated semantics, and if \tcode{E} also meets all other requirements of this subclause \ref{rand.req.eng}. -In that Table and throughout this subclause: +In \tref{rand.req.eng} and throughout this subclause: \begin{itemize} \item \tcode{T} is the type named by @@ -2255,7 +2255,7 @@ and if \tcode{D} and its associated types also meet all other requirements of this subclause \ref{rand.req.dist}. -In that Table and throughout this subclause, +In \tref{rand.req.dist} and throughout this subclause, \begin{itemize} \item \tcode{T} is the type named by From 361e7769a245aad263574bbe83b9266d8da3b01b Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 17 May 2024 09:42:22 +0200 Subject: [PATCH 089/162] [std] Replace 'this standard' with 'this document' Fixes ISO/CS comment (C++23 proof) --- source/compatibility.tex | 4 ++-- source/future.tex | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index e17c633129..2bee70ddbc 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -190,7 +190,7 @@ \change Remove header \libnoheader{codecvt} and all its contents. \rationale -The header has been deprecated for the previous three editions of this standard +The header has been deprecated for the previous three editions of this document and no longer implements the current Unicode standard, supporting only the obsolete UCS-2 encoding. Ongoing support is at implementer's discretion, @@ -234,7 +234,7 @@ \tcode{wbuffer_convert}. \rationale These features were underspecified with no clear error reporting mechanism and -were deprecated for the last three editions of this standard. +were deprecated for the last three editions of this document. Ongoing support is at implementer's discretion, exercising freedoms granted by \ref{zombie.names}. \effect diff --git a/source/future.tex b/source/future.tex index 90e689171a..40752abc23 100644 --- a/source/future.tex +++ b/source/future.tex @@ -4,8 +4,8 @@ \rSec1[depr.general]{General} \pnum -This Annex describes features of the \Cpp{} Standard that are specified for compatibility with -existing implementations. +This Annex describes features of this document +that are specified for compatibility with existing implementations. \pnum These are deprecated features, where From e86031dd14e052956fc23ec4dbc1510b7438ba5b Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 13 May 2024 23:19:57 +0200 Subject: [PATCH 090/162] [time.format,time.parse] Fix references to ISO week calendar Fixes ISO/CS comment (C++23 proof) --- source/time.tex | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/source/time.tex b/source/time.tex index dd353f9904..3bb888e5fd 100644 --- a/source/time.tex +++ b/source/time.tex @@ -10652,11 +10652,13 @@ Equivalent to \tcode{\%Y-\%m-\%d}. \\ \rowsep \tcode{\%g} & -The last two decimal digits of the ISO week-based year. +The last two decimal digits of the calendar year +as specified in ISO 8601-1:2019 for the week calendar. If the result is a single digit it is prefixed by \tcode{0}. \\ \rowsep \tcode{\%G} & -The ISO week-based year as a decimal number. +The calendar year as a decimal number, +as specified in ISO 8601-1:2019 for the week calendar. If the result is less than four digits it is left-padded with \tcode{0} to four digits. \\ \rowsep @@ -10682,7 +10684,7 @@ the decimal number of \tcode{days} without padding. Otherwise, the day of the year as a decimal number. -Jan 1 is \tcode{001}. +January 1 is \tcode{001}. If the result is less than three digits, it is left-padded with \tcode{0} to three digits. \\ \rowsep @@ -10736,7 +10738,8 @@ Equivalent to \tcode{\%H:\%M:\%S}. \\ \rowsep \tcode{\%u} & -The ISO weekday as a decimal number (\tcode{1}-\tcode{7}), +The calendar day of week as a decimal number (\tcode{1}-\tcode{7}), +as specified in ISO 8601-1:2019, where Monday is \tcode{1}. The modified command \tcode{\%Ou} produces the locale's alternative representation. @@ -10750,7 +10753,8 @@ the locale's alternative representation. \\ \rowsep \tcode{\%V} & -The ISO week-based week number as a decimal number. +The calendar week of year as a decimal number, +as specified in ISO 8601-1:2019 for the week calendar. If the result is a single digit, it is prefixed with \tcode{0}. The modified command \tcode{\%OV} produces the locale's alternative representation. @@ -11268,14 +11272,16 @@ the width is applied to only \tcode{\%Y}. \\ \rowsep \tcode{\%g} & -The last two decimal digits of the ISO week-based year. +The last two decimal digits of the calendar year, +as specified in ISO 8601-1:2019 for the week calendar. The modified command \tcode{\%\placeholder{N}g} specifies the maximum number of characters to read. If \tcode{\placeholder{N}} is not specified, the default is 2. Leading zeroes are permitted but not required. \\ \rowsep \tcode{\%G} & -The ISO week-based year as a decimal number. +The calendar year as a decimal number, +as specified in ISO 8601-1:2019 for the week calendar. The modified command \tcode{\%\placeholder{N}G} specifies the maximum number of characters to read. If \tcode{\placeholder{N}} is not specified, the default is 4. @@ -11307,7 +11313,7 @@ a decimal number of \tcode{days}. Otherwise, the day of the year as a decimal number. -Jan 1 is \tcode{1}. +January 1 is \tcode{1}. In either case, the modified command \tcode{\%\placeholder{N}j} specifies the maximum number of characters to read. @@ -11316,7 +11322,7 @@ \\ \rowsep \tcode{\%m} & The month as a decimal number. -Jan is \tcode{1}. +January is \tcode{1}. The modified command \tcode{\%\placeholder{N}m} specifies the maximum number of characters to read. If \tcode{\placeholder{N}} is not specified, the default is 2. @@ -11373,7 +11379,9 @@ Equivalent to \tcode{\%H:\%M:\%S}. \\ \rowsep \tcode{\%u} & -The ISO weekday as a decimal number (\tcode{1}-\tcode{7}), where Monday is \tcode{1}. +The calendar day of week as a decimal number (\tcode{1}-\tcode{7}), +as specified in ISO 8601-1:2019, +where Monday is \tcode{1}. The modified command \tcode{\%\placeholder{N}u} specifies the maximum number of characters to read. If \tcode{\placeholder{N}} is not specified, the default is \tcode{1}. @@ -11391,7 +11399,8 @@ the locale's alternative representation. \\ \rowsep \tcode{\%V} & -The ISO week-based week number as a decimal number. +The calendar week of year as a decimal number, +as specified in ISO 8601-1:2019 for the week calendar. The modified command \tcode{\%\placeholder{N}V} specifies the maximum number of characters to read. If \tcode{\placeholder{N}} is not specified, the default is 2. From 868b0b29ac16370ed8792442a0ab41be91c5d575 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 13 May 2024 19:01:05 +0200 Subject: [PATCH 091/162] [std] Avoid hanging paragraphs by introducing "General" subclauses Fixes ISO/CS comment (C++23 proof) --- source/expressions.tex | 2 ++ source/iostreams.tex | 2 ++ source/iterators.tex | 6 ++++++ source/locales.tex | 6 ++++++ source/support.tex | 2 ++ 5 files changed, 18 insertions(+) diff --git a/source/expressions.tex b/source/expressions.tex index 5115189f95..66825a2c1b 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -1207,6 +1207,8 @@ \rSec1[expr.prim]{Primary expressions}% \indextext{expression!primary|(} +\rSec2[expr.prim.grammar]{Grammar} + \begin{bnf} \nontermdef{primary-expression}\br literal\br diff --git a/source/iostreams.tex b/source/iostreams.tex index de2ea952e3..acfab66c8a 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -1645,6 +1645,8 @@ \rSec2[fpos]{Class template \tcode{fpos}} +\rSec3[fpos.general]{General} + \indexlibraryglobal{fpos}% \begin{codeblock} namespace std { diff --git a/source/iterators.tex b/source/iterators.tex index 2da91d8319..754c2632b7 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -3842,6 +3842,8 @@ \rSec3[back.insert.iterator]{Class template \tcode{back_insert_iterator}} +\rSec4[back.insert.iter.general]{General} + \indexlibraryglobal{back_insert_iterator}% \begin{codeblock} namespace std { @@ -3953,6 +3955,8 @@ \rSec3[front.insert.iterator]{Class template \tcode{front_insert_iterator}} +\rSec4[front.insert.iter.general]{General} + \indexlibraryglobal{front_insert_iterator}% \begin{codeblock} namespace std { @@ -4064,6 +4068,8 @@ \rSec3[insert.iterator]{Class template \tcode{insert_iterator}} +\rSec4[insert.iter.general]{General} + \indexlibraryglobal{insert_iterator}% \begin{codeblock} namespace std { diff --git a/source/locales.tex b/source/locales.tex index 8d7541ae7f..960ddf5169 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -3614,6 +3614,8 @@ \rSec3[locale.time.put]{Class template \tcode{time_put}} +\rSec4[locale.time.put.general]{General} + \indexlibraryglobal{time_put}% \begin{codeblock} namespace std { @@ -3778,6 +3780,8 @@ \rSec3[locale.money.get]{Class template \tcode{money_get}} +\rSec4[locale.money.get.general]{General} + \indexlibraryglobal{money_get}% \begin{codeblock} namespace std { @@ -3945,6 +3949,8 @@ \rSec3[locale.money.put]{Class template \tcode{money_put}} +\rSec4[locale.money.put.general]{General} + \indexlibraryglobal{money_put}% \begin{codeblock} namespace std { diff --git a/source/support.tex b/source/support.tex index 755e9b27c6..a0c8036c83 100644 --- a/source/support.tex +++ b/source/support.tex @@ -5569,6 +5569,8 @@ \rSec3[coroutine.handle.noop]{Class \tcode{coroutine_handle}} +\rSec4[coroutine.handle.noop.general]{General} + \indexlibraryglobal{coroutine_handle}% \begin{codeblock} namespace std { From f0580700cf0e8e920ceb3a078b6872a4c16fa225 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 15 May 2024 21:49:31 +0200 Subject: [PATCH 092/162] [std] Remove ISO from any mention of 'C' Fixes ISO/CS comment (C++23 proof) --- source/algorithms.tex | 2 +- source/compatibility.tex | 20 ++++++++++---------- source/expressions.tex | 2 +- source/iostreams.tex | 2 +- source/lex.tex | 5 ++--- source/lib-intro.tex | 4 ++-- source/locales.tex | 2 +- source/support.tex | 8 ++++---- 8 files changed, 22 insertions(+), 23 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 52a3c74c02..a64ccb1efa 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -12,7 +12,7 @@ non-modifying sequence operations, mutating sequence operations, sorting and related operations, -and algorithms from the ISO C library, +and algorithms from the C library, as summarized in \tref{algorithms.summary}. \begin{libsumtab}{Algorithms library summary}{algorithms.summary} diff --git a/source/compatibility.tex b/source/compatibility.tex index 2bee70ddbc..46fb8d7557 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -2469,13 +2469,13 @@ \end{codeblock} \end{example} -\rSec1[diff.iso]{\Cpp{} and ISO C} +\rSec1[diff.iso]{\Cpp{} and C} \rSec2[diff.iso.general]{General} \pnum -\indextext{summary!compatibility with ISO C}% -Subclause \ref{diff.iso} lists the differences between \Cpp{} and ISO C, +\indextext{summary!compatibility with C}% +Subclause \ref{diff.iso} lists the differences between \Cpp{} and C, in addition to those listed above, by the chapters of this document. @@ -2491,7 +2491,7 @@ semantics of \Cpp{}. \effect Change to semantics of well-defined feature. -Any ISO C programs that used any of these keywords as identifiers +Any C programs that used any of these keywords as identifiers are not valid \Cpp{} programs. \difficulty Syntactic transformation. @@ -2519,7 +2519,7 @@ \end{example} \effect Change to semantics of well-defined feature. -ISO C programs which depend on +C programs which depend on \begin{codeblock} sizeof('x') == sizeof(int) \end{codeblock} @@ -2713,7 +2713,7 @@ } \end{codeblock} -ISO C accepts this usage of pointer to \keyword{void} being assigned +C accepts this usage of pointer to \keyword{void} being assigned to a pointer to object type. \Cpp{} does not. \end{example} @@ -2734,7 +2734,7 @@ \howwide This is fairly widely used but it is good programming practice to add the cast when assigning pointer-to-void to pointer-to-object. -Some ISO C translators will give a warning +Some C translators will give a warning if the cast is not used. \diffref{expr.arith.conv} @@ -2774,7 +2774,7 @@ \rationale Feature with surprising semantics. \effect -A valid ISO C expression utilizing the decrement operator on +A valid C expression utilizing the decrement operator on a \keyword{bool} lvalue (for instance, via the C typedef in \libheaderref{stdbool.h}) is ill-formed in \Cpp{}. @@ -3242,7 +3242,7 @@ implicitly-declared copy assignment operator cannot make a copy of a volatile lvalue. \begin{example} -The following is valid in ISO C: +The following is valid in C: \begin{codeblock} struct X { int i; }; volatile struct X x1 = {0}; @@ -3377,7 +3377,7 @@ Whether \mname{STDC} is defined and if so, what its value is, are \impldef{definition and meaning of \mname{STDC}}. \rationale -\Cpp{} is not identical to ISO C\@. +\Cpp{} is not identical to C\@. Mandating that \mname{STDC} be defined would require that translators make an incorrect claim. \effect diff --git a/source/expressions.tex b/source/expressions.tex index 66825a2c1b..12f2226fc0 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -622,7 +622,7 @@ prvalue is \tcode{T}. \begin{footnote} In \Cpp{} class and array prvalues can have cv-qualified types. -This differs from ISO C, in which non-lvalues never have +This differs from C, in which non-lvalues never have cv-qualified types. \end{footnote} diff --git a/source/iostreams.tex b/source/iostreams.tex index acfab66c8a..a439db5e0f 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -86,7 +86,7 @@ It is used to represent the number of characters transferred in an I/O operation, or the size of I/O buffers. \begin{footnote} -Most places where \tcode{streamsize} is used would use \tcode{size_t} in ISO C, +Most places where \tcode{streamsize} is used would use \tcode{size_t} in C, or \tcode{ssize_t} in POSIX. \end{footnote} \end{itemdescr} diff --git a/source/lex.tex b/source/lex.tex index 3c3be04db6..f7a1b606b4 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -1086,8 +1086,7 @@ There are several kinds of literals. \begin{footnote} The term ``literal'' generally designates, in this -document, those tokens that are called ``constants'' in -ISO C. +document, those tokens that are called ``constants'' in C. \end{footnote} \begin{bnf} @@ -1574,7 +1573,7 @@ is specified in \tref{lex.ccon.esc}. \begin{note} Using an escape sequence for a question mark -is supported for compatibility with ISO \CppXIV{} and ISO C. +is supported for compatibility with ISO \CppXIV{} and C. \end{note} \begin{floattable}{Simple escape sequences}{lex.ccon.esc} diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 1422d19a57..25b12168f5 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -144,8 +144,8 @@ may be different from the signatures in the C standard library, and additional overloads may be declared in this document, but the behavior and the preconditions -(including any preconditions implied by the use of an -ISO C \tcode{restrict} qualifier) +(including any preconditions implied by the use of +a C \tcode{restrict} qualifier) are the same unless otherwise stated. \pnum diff --git a/source/locales.tex b/source/locales.tex index 960ddf5169..1d8ccc6b84 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -16,7 +16,7 @@ The following subclauses describe components for locales themselves, the standard facets, and -facilities from the ISO C library, +facilities from the C library, as summarized in \tref{localization.summary}. \begin{libsumtab}{Localization library summary}{localization.summary} diff --git a/source/support.tex b/source/support.tex index a0c8036c83..4716407e88 100644 --- a/source/support.tex +++ b/source/support.tex @@ -5810,7 +5810,7 @@ In lieu of the default argument promotions specified in \IsoC{} 6.5.2.2, the definition in~\ref{expr.call} applies. \item -The restrictions that ISO C places on the second parameter to the +The restrictions that C places on the second parameter to the \indexlibraryglobal{va_start}% \tcode{va_start} macro in header \libheader{stdarg.h} are different in this document. @@ -6004,8 +6004,8 @@ the \defnx{C headers}{headers!C library} shown in \tref{c.headers}. The intended use of these headers is for interoperability only. It is possible that \Cpp{} source files need to include -one of these headers in order to be valid ISO C. -Source files that are not intended to also be valid ISO C +one of these headers in order to be valid C. +Source files that are not intended to also be valid C should not use any of the C headers. \begin{note} @@ -6016,7 +6016,7 @@ assuredly defines them in namespace \tcode{std}. \end{note} \begin{example} -The following source file is both valid \Cpp{} and valid ISO C. +The following source file is both valid \Cpp{} and valid C. Viewed as \Cpp{}, it declares a function with C language linkage; viewed as C it simply declares a function (and provides a prototype). \begin{codeblock} From 5269d41a1c08af58ca5988de12e7fd8fb446a683 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 16 May 2024 13:12:03 +0200 Subject: [PATCH 093/162] [macros,regex] Pass an argument to the \xref macro --- source/macros.tex | 4 ++-- source/regex.tex | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/macros.tex b/source/macros.tex index bff719918e..f04ac68774 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -371,8 +371,8 @@ \newcommand{\templalias}{\Fundesc{Alias template}} %% Cross-reference -\newcommand{\xref}{\textsc{See also:}\space} -\newcommand{\xrefc}[1]{\xref{} \IsoC{}, #1} +\newcommand{\xref}[1]{\textsc{See also:}\space #1} +\newcommand{\xrefc}[1]{\xref{\IsoC{}, #1}} \newcommand{\termref}[3]{\textit{#2}{#3}\iref{#1}} % in Clause 3 %% Inline comma-separated parenthesized references diff --git a/source/regex.tex b/source/regex.tex index 495a9ac354..8d02a0f01d 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -686,7 +686,7 @@ \tcode{ECMAScript} & Specifies that the grammar recognized by the regular expression engine shall be that used by ECMAScript in ECMA-262, as modified in~\ref{re.grammar}. -\newline \xref ECMA-262 15.10 +\newline \xref{ECMA-262 15.10} \indextext{ECMAScript}% \indexlibrarymember{syntax_option_type}{ECMAScript}% \\ \rowsep @@ -694,7 +694,7 @@ \tcode{basic} & Specifies that the grammar recognized by the regular expression engine shall be that used by basic regular expressions in POSIX. -\newline \xref POSIX, Base Definitions and Headers, Section 9.3 +\newline \xref{POSIX, Base Definitions and Headers, Section 9.3} \indextext{POSIX!regular expressions}% \indexlibrarymember{syntax_option_type}{basic}% \\ \rowsep @@ -702,7 +702,7 @@ \tcode{extended} & Specifies that the grammar recognized by the regular expression engine shall be that used by extended regular expressions in POSIX. -\newline \xref POSIX, Base Definitions and Headers, Section 9.4 +\newline \xref{POSIX, Base Definitions and Headers, Section 9.4} \indextext{POSIX!extended regular expressions}% \indexlibrarymember{syntax_option_type}{extended}% \\ \rowsep @@ -3997,5 +3997,5 @@ iterator range \range{first}{last} if \tcode{traits_inst.isctype(c, traits_inst.lookup_classname(first, last, flags() \& icase))} is \tcode{true}. \end{itemize} -\xref ECMA-262 15.10 +\xref{ECMA-262 15.10} \indextext{regular expression|)} From 69f184ea599635dac4cd9dc06a3303bed93b26f7 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 13 May 2024 19:30:38 +0200 Subject: [PATCH 094/162] [std] Remove mid-sentence 'subclause' introducer Fixes ISO/CS comment (C++23 proof) --- source/concepts.tex | 2 +- source/containers.tex | 12 ++++++------ source/expressions.tex | 2 +- source/iostreams.tex | 2 +- source/lib-intro.tex | 2 +- source/locales.tex | 2 +- source/memory.tex | 2 +- source/preface.tex | 2 +- source/ranges.tex | 4 ++-- source/support.tex | 2 +- source/utilities.tex | 6 +++--- 11 files changed, 19 insertions(+), 19 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index fe54447105..4d848e8fd6 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -1222,7 +1222,7 @@ \rSec2[concepts.callable.general]{General} \pnum -The concepts in subclause \ref{concepts.callable} describe the requirements on function +The concepts in \ref{concepts.callable} describe the requirements on function objects\iref{function.objects} and their arguments. \rSec2[concept.invocable]{Concept \cname{invocable}} diff --git a/source/containers.tex b/source/containers.tex index 946caa38f2..76f5cea891 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -74,7 +74,7 @@ \rSec3[container.intro.reqmts]{Introduction} \pnum -In subclause \ref{container.requirements.general}, +In \ref{container.requirements.general}, \begin{itemize} \item \tcode{X} denotes a container class containing objects of type \tcode{T}, @@ -19108,7 +19108,7 @@ The class template \tcode{extents} represents a multidimensional index space of rank equal to \tcode{sizeof...(Extents)}. -In subclause \iref{views}, +In \iref{views}, \tcode{extents} is used synonymously with multidimensional index space. \begin{codeblock} @@ -19519,7 +19519,7 @@ \rSec4[mdspan.layout.general]{General} \pnum -In subclauses \ref{mdspan.layout.reqmts} and \ref{mdspan.layout.policy.reqmts}: +In \ref{mdspan.layout.reqmts} and \ref{mdspan.layout.policy.reqmts}: \begin{itemize} \item @@ -19546,7 +19546,7 @@ \end{itemize} \pnum -In subclauses \ref{mdspan.layout.reqmts} through \ref{mdspan.layout.stride}: +In \ref{mdspan.layout.reqmts} through \ref{mdspan.layout.stride}: \begin{itemize} \item Let \exposid{is-mapping-of} be the exposition-only variable template defined as follows: @@ -22205,7 +22205,7 @@ the accessor policy's \tcode{access} function produces a valid reference to an object. \pnum -In subclause \ref{mdspan.accessor.reqmts}, +In \ref{mdspan.accessor.reqmts}, \begin{itemize} \item @@ -22996,7 +22996,7 @@ the \tcode{SliceSpecifier} arguments. \pnum -For each function defined in subclause \ref{mdspan.sub} that +For each function defined in \ref{mdspan.sub} that takes a parameter pack named \tcode{slices} as an argument: \begin{itemize} diff --git a/source/expressions.tex b/source/expressions.tex index 12f2226fc0..38a715e0d7 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -53,7 +53,7 @@ considered where necessary to convert the operands to types appropriate for the built-in operator. If a built-in operator is selected, such conversions will be applied to the operands before the operation is -considered further according to the rules in subclause \ref{expr.compound}; +considered further according to the rules in \ref{expr.compound}; see~\ref{over.match.oper}, \ref{over.built}. \pnum diff --git a/source/iostreams.tex b/source/iostreams.tex index a439db5e0f..db5609b2f4 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -10024,7 +10024,7 @@ \begin{note} A user of these classes is responsible for ensuring that the character sequence represented by the given \tcode{span} -outlives the use of the sequence by objects of the classes in subclause \ref{span.streams}. +outlives the use of the sequence by objects of the classes in \ref{span.streams}. Using multiple \tcode{basic_spanbuf} objects referring to overlapping underlying sequences from different threads, where at least one \tcode{basic_spanbuf} object is used diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 25b12168f5..fb0a13a5df 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -2054,7 +2054,7 @@ allocators. \pnum -In subclause \ref{allocator.requirements}, +In \ref{allocator.requirements}, \begin{itemize} \item \tcode{T}, \tcode{U}, \tcode{C} denote diff --git a/source/locales.tex b/source/locales.tex index 1d8ccc6b84..eda8bc1043 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -959,7 +959,7 @@ but set to \tcode{ios_base::failbit} in case of a parse error. \pnum -Within subclause \ref{locale.categories} it is unspecified whether +Within \ref{locale.categories} it is unspecified whether one virtual function calls another virtual function. \rSec2[category.ctype]{The \tcode{ctype} category} diff --git a/source/memory.tex b/source/memory.tex index 4958d644ef..1408fecd5b 100644 --- a/source/memory.tex +++ b/source/memory.tex @@ -3275,7 +3275,7 @@ reflect modifications that can introduce data races. \pnum -For the purposes of subclause \ref{smartptr}, +For the purposes of \ref{smartptr}, a pointer type \tcode{Y*} is said to be \defnx{compatible with}{compatible with!\idxcode{shared_ptr}} a pointer type \tcode{T*} when either diff --git a/source/preface.tex b/source/preface.tex index b77caca873..6e0b3fa036 100644 --- a/source/preface.tex +++ b/source/preface.tex @@ -9,7 +9,7 @@ \chapter{Introduction} Clauses and subclauses in this document are annotated with a so-called stable name, presented in square brackets next to the (sub)clause heading -(such as ``[lex.token]'' for subclause \ref{lex.token}, ``Tokens''). +(such as ``[lex.token]'' for \ref{lex.token}, ``Tokens''). Stable names aid in the discussion and evolution of this document by serving as stable references to subclauses across editions that are unaffected by changes of subclause numbering. diff --git a/source/ranges.tex b/source/ranges.tex index 9f0f281290..928d3aa180 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1627,7 +1627,7 @@ \rSec2[range.utility.helpers]{Helper concepts} \pnum -Many of the types in subclause~\ref{range.utility} are specified in terms of +Many of the types in \ref{range.utility} are specified in terms of the following exposition-only concepts: \begin{codeblock} @@ -4233,7 +4233,7 @@ \rSec2[range.nonprop.cache]{Non-propagating cache} \pnum -Some types in subclause \ref{range.adaptors} are specified in terms of +Some types in \ref{range.adaptors} are specified in terms of an exposition-only class template \exposid{non-propagating-\brk{}cache}. \tcode{\exposid{non-propagating-cache}} behaves exactly like \tcode{optional} with the following differences: diff --git a/source/support.tex b/source/support.tex index 4716407e88..bb6969020e 100644 --- a/source/support.tex +++ b/source/support.tex @@ -4335,7 +4335,7 @@ an argument other than a literal \tcode{0} is undefined. \pnum -For the purposes of subclause \ref{cmp.categories}, +For the purposes of \ref{cmp.categories}, \defn{substitutability} is the property that \tcode{f(a) == f(b)} is \tcode{true} whenever \tcode{a == b} is \tcode{true}, where \tcode{f} denotes a function that reads only comparison-salient state diff --git a/source/utilities.tex b/source/utilities.tex index bf4f91d468..6cf616bfab 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -4873,7 +4873,7 @@ These template arguments are called alternatives. \pnum -In subclause \ref{variant}, +In \ref{variant}, \exposid{GET} denotes a set of exposition-only function templates\iref{variant.get}. @@ -11026,7 +11026,7 @@ The template parameter \tcode{T} of \tcode{reference_wrapper} may be an incomplete type. \begin{note} -Using the comparison operators described in subclause \ref{refwrap.comparisons} +Using the comparison operators described in \ref{refwrap.comparisons} with \tcode{T} being an incomplete type can lead to an ill-formed program with no diagnostic required\iref{temp.point,temp.constr.atomic}. @@ -14312,7 +14312,7 @@ that models \libconcept{copyable}. \pnum -Within subclause \ref{func.wrap.ref}, +Within \ref{func.wrap.ref}, \tcode{\placeholder{call-args}} is an argument pack with elements such that \tcode{decltype((\placeholder{call-args}\linebreak{}))...} denote \tcode{Args\&\&...} respectively. From ecb071672b02a4b7bc829f87433d98785d9dd701 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 13 May 2024 19:44:40 +0200 Subject: [PATCH 095/162] [std] Remove incorrect or duplicative 'this subclause' introducers Fixes ISO/CS comment (C++23 proof) --- source/numerics.tex | 32 ++++++++++++++++---------------- source/strings.tex | 2 +- source/threads.tex | 2 +- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index 91907ac4bd..4d63e2199a 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -1556,7 +1556,7 @@ \rSec3[rand.req.genl]{General requirements}% \pnum -Throughout this subclause \ref{rand}, +Throughout \ref{rand}, the effect of instantiating a template: \begin{itemize} \item @@ -1616,7 +1616,7 @@ \end{itemize} \pnum -Throughout this subclause \ref{rand}, +Throughout \ref{rand}, phrases of the form ``\tcode{x} is an iterator of a specific kind'' shall be interpreted as equivalent to the more formal requirement that ``\tcode{x} is a value @@ -1624,7 +1624,7 @@ of the specified iterator type''. \pnum -Throughout this subclause \ref{rand}, +Throughout \ref{rand}, any constructor that can be called with a single argument and that meets a requirement specified in this subclause shall be declared \keyword{explicit}. @@ -1659,7 +1659,7 @@ in \tref{rand.req.seedseq} are valid and have the indicated semantics, and if \tcode{S} also meets all other requirements -of this subclause \ref{rand.req.seedseq}. +of \ref{rand.req.seedseq}. In \tref{rand.req.seedseq} and throughout this subclause: \begin{itemize} \item @@ -1875,7 +1875,7 @@ in \tref{rand.req.eng} are valid and have the indicated semantics, and if \tcode{E} also meets all other requirements -of this subclause \ref{rand.req.eng}. +of \ref{rand.req.eng}. In \tref{rand.req.eng} and throughout this subclause: \begin{itemize} \item @@ -2254,7 +2254,7 @@ are valid and have the indicated semantics, and if \tcode{D} and its associated types also meet all other requirements -of this subclause \ref{rand.req.dist}. +of \ref{rand.req.dist}. In \tref{rand.req.dist} and throughout this subclause, \begin{itemize} \item @@ -2465,7 +2465,7 @@ It is unspecified whether \tcode{D::param_type} is declared as a (nested) \keyword{class} or via a \keyword{typedef}. -In this subclause \ref{rand}, +In \ref{rand}, declarations of \tcode{D::param_type} are in the form of \keyword{typedef}s for convenience of exposition only. @@ -2650,7 +2650,7 @@ If the template parameter \tcode{m} is $0$, the modulus $m$ -used throughout this subclause~\ref{rand.eng.lcong} +used throughout \ref{rand.eng.lcong} is \tcode{numeric_limits::max()} plus $1$. \begin{note} $m$ need not be representable @@ -3077,30 +3077,30 @@ \pnum Each type instantiated -from a class template specified in this subclause~\ref{rand.adapt} +from a class template specified in \ref{rand.adapt} meets the requirements of a random number engine adaptor\iref{rand.req.adapt} type. \pnum Except where specified otherwise, the complexity of each function -specified in this subclause~\ref{rand.adapt} +specified in \ref{rand.adapt} is constant. \pnum Except where specified otherwise, -no function described in this subclause~\ref{rand.adapt} +no function described in \ref{rand.adapt} throws an exception. \pnum -Every function described in this subclause~\ref{rand.adapt} +Every function described in \ref{rand.adapt} that has a function parameter \tcode{q} of type \tcode{Sseq\&} for a template type parameter named \tcode{Sseq} that is different from type \tcode{seed_seq} throws what and when the invocation of \tcode{q.generate} throws. \pnum -Descriptions are provided in this subclause~\ref{rand.adapt} +Descriptions are provided in \ref{rand.adapt} only for adaptor operations that are not described in subclause~\ref{rand.req.adapt} or for operations where there is additional semantic information. @@ -3112,7 +3112,7 @@ are not shown in the synopses. \pnum -Each template specified in this subclause~\ref{rand.adapt} +Each template specified in \ref{rand.adapt} requires one or more relationships, involving the value(s) of its non-type template parameter(s), to hold. A program instantiating any of these templates @@ -4142,12 +4142,12 @@ \pnum Each type instantiated -from a class template specified in this subclause~\ref{rand.dist} +from a class template specified in \ref{rand.dist} meets the requirements of a random number distribution\iref{rand.req.dist} type. \pnum -Descriptions are provided in this subclause~\ref{rand.dist} +Descriptions are provided in \ref{rand.dist} only for distribution operations that are not described in \ref{rand.req.dist} or for operations where there is additional semantic information. diff --git a/source/strings.tex b/source/strings.tex index 4493b5d463..a3db2e8255 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -108,7 +108,7 @@ denotes an lvalue of type \tcode{C}. No expression which is part of the character traits requirements -specified in this subclause \ref{char.traits.require} +specified in \ref{char.traits.require} shall exit via an exception. \begin{libreqtab4d} diff --git a/source/threads.tex b/source/threads.tex index b5b4b54001..8fa6711bba 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -8919,7 +8919,7 @@ \rSec3[thread.condition.condvarany.general]{General} \pnum -In this subclause \ref{thread.condition.condvarany}, +In \ref{thread.condition.condvarany}, template arguments for template parameters named \tcode{Lock} shall meet the \oldconcept{Basic\-Lockable} requirements\iref{thread.req.lockable.basic}. From a249f9f37531fe79e768f19a45f1b1a70685c2c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 9 Jul 2024 22:48:20 +0100 Subject: [PATCH 096/162] [classes] Turn ad-hoc examples into proper examples (#7125) --- source/classes.tex | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index 9076cd6f88..65b11793d9 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -431,7 +431,8 @@ \begin{note} The declaration of a class name takes effect immediately after the \grammarterm{identifier} is seen in the class definition or -\grammarterm{elaborated-type-specifier}. For example, +\grammarterm{elaborated-type-specifier}. +\begin{example} \begin{codeblock} class A * A; \end{codeblock} @@ -439,6 +440,7 @@ it as the name of a pointer to an object of that class. This means that the elaborated form \keyword{class} \tcode{A} must be used to refer to the class. Such artistry with names can be confusing and is best avoided. +\end{example} \end{note} \pnum @@ -948,8 +950,8 @@ A member function can be declared (but not defined) using a typedef for a function type. The resulting member function has exactly the same type as it would have if the function declarator were provided explicitly, -see~\ref{dcl.fct}. For example, - +see~\ref{dcl.fct} and \ref{temp.arg}. +\begin{example} \begin{codeblock} typedef void fv(); typedef void fvc() const; @@ -962,8 +964,7 @@ fv S::* pmfv2 = &S::memfunc2; fvc S::* pmfv3 = &S::memfunc3; \end{codeblock} - -Also see~\ref{temp.arg}. +\end{example} \end{note} \rSec2[class.mfct.non.static]{Non-static member functions}% @@ -2221,7 +2222,7 @@ Such use of explicit placement and destruction of objects can be necessary to cope with dedicated hardware resources and for writing memory management facilities. -For example, +\begin{example} \begin{codeblock} void* operator new(std::size_t, void* p) { return p; } struct X { @@ -2237,6 +2238,7 @@ p->X::~X(); // cleanup } \end{codeblock} +\end{example} \end{note} \pnum @@ -2866,7 +2868,7 @@ refers to an object of class type with a virtual destructor, because the deallocation function is chosen by the destructor of the dynamic type of the object, the effect is the same in that case. -For example, +\begin{example} \begin{codeblock} struct B { virtual ~B(); @@ -2902,6 +2904,7 @@ and its storage is deallocated by \tcode{E::operator delete()}, due to the virtual destructor. +\end{example} \end{note} \begin{note} Virtual destructors have no effect on the deallocation function actually @@ -2910,7 +2913,7 @@ of a \grammarterm{delete-expression} refers to an array of objects of class type. -For example, +\begin{example} \begin{codeblock} struct B { virtual ~B(); @@ -2928,6 +2931,7 @@ delete[] bp; // undefined behavior } \end{codeblock} +\end{example} \end{note} \pnum @@ -4242,8 +4246,7 @@ Because access control applies to the declarations named, if access control is applied to a \grammarterm{typedef-name}, only the accessibility of the typedef or alias declaration itself is considered. The accessibility of the entity referred to by the \grammarterm{typedef-name} is not considered. -For example, - +\begin{example} \begin{codeblock} class A { class B { }; @@ -4256,6 +4259,7 @@ A::B y; // access error, \tcode{A::B} is private } \end{codeblock} +\end{example} \end{note} \pnum @@ -4520,8 +4524,7 @@ a conversion from a pointer to a derived class to a pointer to an inaccessible base class can be ill-formed if an implicit conversion is used, but well-formed if an explicit cast is used. -For example, - +\begin{example} \begin{codeblock} class B { public: @@ -4546,6 +4549,7 @@ bp2->mi = 3; // OK, access through a pointer to \tcode{B}. } \end{codeblock} +\end{example} \end{note} \pnum From eade3851e174ac014b478b8d4f097103d3b996ae Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 16 May 2024 12:44:01 +0200 Subject: [PATCH 097/162] [lex.ccon,expr.prim.lambda.capture] Excise 'ISO' prefix Fixes ISO/CS comment (C++23 proof) --- source/expressions.tex | 2 +- source/lex.tex | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 38a715e0d7..f259fa68d3 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -2345,7 +2345,7 @@ or ``\tcode{* \keyword{this}}''. \begin{note} The form \tcode{[\&,\keyword{this}]} is redundant but accepted -for compatibility with ISO \CppXIV{}. +for compatibility with \CppXIV{}. \end{note} Ignoring appearances in \grammarterm{initializer}{s} of \grammarterm{init-capture}{s}, an identifier or diff --git a/source/lex.tex b/source/lex.tex index f7a1b606b4..e2941c83df 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -1573,7 +1573,7 @@ is specified in \tref{lex.ccon.esc}. \begin{note} Using an escape sequence for a question mark -is supported for compatibility with ISO \CppXIV{} and C. +is supported for compatibility with \CppXIV{} and C. \end{note} \begin{floattable}{Simple escape sequences}{lex.ccon.esc} From 5383169856690cf05d946f058ed861119405d126 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 16 May 2024 14:32:49 +0200 Subject: [PATCH 098/162] [fs.class.path.general] Defuse cross-reference to POSIX Fixes ISO/CS comment (C++23 proof) --- source/iostreams.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index db5609b2f4..dc23d3c5f2 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -13627,7 +13627,8 @@ a pathname to a particular file in a file hierarchy. There may be multiple pathnames that resolve to the same file. \begin{example} -POSIX specifies the mechanism in section 4.12, Pathname resolution. +For POSIX-based operating systems, +this mechanism is specified in POSIX, section 4.12, Pathname resolution. \end{example} \begin{codeblock} From 5731ab6a9122763bf6193d1382a05c7bebe82b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 9 Jul 2024 23:24:09 +0100 Subject: [PATCH 099/162] [time.format] Remove mid-sentence 'subclause' introducer from external reference --- source/time.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/time.tex b/source/time.tex index 3bb888e5fd..6d0d2b398f 100644 --- a/source/time.tex +++ b/source/time.tex @@ -10797,7 +10797,7 @@ the locale's alternative full year representation. \\ \rowsep \tcode{\%z} & -The offset from UTC as specified in ISO 8601-1:2019, subclause 5.3.4.1. +The offset from UTC as specified in ISO 8601-1:2019, 5.3.4.1. For example \tcode{-0430} refers to 4 hours 30 minutes behind UTC\@. If the offset is zero, \tcode{+0000} is used. The modified commands \tcode{\%Ez} and \tcode{\%Oz} From 856d175973d343d8e16d641221f47357672d9959 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 17 May 2024 14:26:54 +0200 Subject: [PATCH 100/162] [lib] Excise Note A, Note B, etc. designations Fixes ISO/CS comment (C++23 proof) --- source/meta.tex | 15 +++++++-------- source/utilities.tex | 12 ++++++------ 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/source/meta.tex b/source/meta.tex index 773c047dfa..139eddb0df 100644 --- a/source/meta.tex +++ b/source/meta.tex @@ -1934,8 +1934,8 @@ \tcode{template} \tcode{struct common_type;} & - Unless this trait is specialized (as specified in Note B, below), - the member \tcode{type} is defined or omitted as specified in Note A, below. + Unless this trait is specialized, + the member \tcode{type} is defined or omitted as specified below. If it is omitted, there shall be no member \tcode{type}. Each type in the template parameter pack \tcode{T} shall be complete, \cv{}~\keyword{void}, or an array of unknown bound. \\ \rowsep @@ -1947,14 +1947,14 @@ \keyword{struct} \hspace*{2ex}\tcode{basic_common_reference;} & - Unless this trait is specialized (as specified in Note D, below), + Unless this trait is specialized, there shall be no member \tcode{type}. \\ \rowsep \indexlibraryglobal{common_reference}% \tcode{template} \tcode{struct common_reference;} & The member \grammarterm{typedef-name} \tcode{type} is defined or omitted - as specified in Note C, below. Each type in the parameter pack \tcode{T} shall + as specified below. Each type in the parameter pack \tcode{T} shall be complete or \cv{} \keyword{void}. \\ \rowsep \indexlibraryglobal{underlying_type}% @@ -2066,7 +2066,6 @@ \tcode{\placeholdernc{COMMON-REF}(A, B)} is ill-formed. \pnum -Note A: For the \tcode{common_type} trait applied to a template parameter pack \tcode{T} of types, the member \tcode{type} shall be either defined or not present as follows: @@ -2120,7 +2119,7 @@ \end{itemize} \pnum -Note B: Notwithstanding the provisions of \ref{meta.type.synop}, and +Notwithstanding the provisions of \ref{meta.type.synop}, and pursuant to \ref{namespace.std}, a program may specialize \tcode{common_type} for types \tcode{T1} and \tcode{T2} such that @@ -2140,7 +2139,7 @@ No diagnostic is required for a violation of this Note's rules. \pnum -Note C: For the \tcode{common_reference} trait applied to a parameter pack +For the \tcode{common_reference} trait applied to a parameter pack \tcode{T} of types, the member \tcode{type} shall be either defined or not present as follows: \begin{itemize} @@ -2186,7 +2185,7 @@ \end{itemize} \pnum -Note D: Notwithstanding the provisions of \ref{meta.type.synop}, and +Notwithstanding the provisions of \ref{meta.type.synop}, and pursuant to \ref{namespace.std}, a program may partially specialize \tcode{basic_common_reference} for types \tcode{T} and \tcode{U} such that diff --git a/source/utilities.tex b/source/utilities.tex index 6cf616bfab..3ab7583ff9 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -2840,10 +2840,10 @@ get(tuple& t) noexcept; template constexpr tuple_element_t>&& - get(tuple&& t) noexcept; // Note A + get(tuple&& t) noexcept; // \#1 template constexpr const tuple_element_t>& - get(const tuple& t) noexcept; // Note B + get(const tuple& t) noexcept; // \#2 template constexpr const tuple_element_t>&& get(const tuple&& t) noexcept; \end{itemdecl} @@ -2860,8 +2860,8 @@ \pnum \begin{note} -[Note A] -If a type \tcode{T} in \tcode{Types} is some reference type \tcode{X\&}, +For the overload marked \#1, +if a type \tcode{T} in \tcode{Types} is some reference type \tcode{X\&}, the return type is \tcode{X\&}, not \tcode{X\&\&}. However, if the element type is a non-reference type \tcode{T}, the return type is \tcode{T\&\&}. @@ -2869,9 +2869,9 @@ \pnum \begin{note} -[Note B] Constness is shallow. -If a type \tcode{T} in \tcode{Types} is some reference type \tcode{X\&}, +For the overload marked \#2, +if a type \tcode{T} in \tcode{Types} is some reference type \tcode{X\&}, the return type is \tcode{X\&}, not \tcode{const X\&}. However, if the element type is a non-reference type \tcode{T}, the return type is \tcode{const T\&}. From 5508a007540d790a8f5cd30f863f4d329edf2694 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 16 May 2024 15:07:27 +0200 Subject: [PATCH 101/162] [macros,numerics] Add and use numbered 'formula' environment Fixes ISO/CS comment (C++23 proof) --- source/macros.tex | 11 ++ source/numerics.tex | 378 +++++++++++++++++++++++++----------------- tools/check-output.sh | 2 +- 3 files changed, 239 insertions(+), 152 deletions(-) diff --git a/source/macros.tex b/source/macros.tex index f04ac68774..5e146135b0 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -614,6 +614,17 @@ \newcommand{\atsign}{@} \makeatother +%%-------------------------------------------------- +%% Formulae +%%-------------------------------------------------- + +% usage: \begin{formula}{XREF} +\newenvironment{formula}[1] +{\begin{equation}\label{eq:#1}} +{\end{equation}} + +\renewcommand{\eqref}[1]{Formula \nolinebreak[3] \hyperref[eq:#1]{\ref*{eq:#1}}} + %%-------------------------------------------------- %% Indented text %%-------------------------------------------------- diff --git a/source/numerics.tex b/source/numerics.tex index 4d63e2199a..997a947499 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -4074,11 +4074,10 @@ \end{itemize} An \defn{attempt} is $k$ invocations of \tcode{g()} to obtain values $g_0, \dotsc, g_{k-1}$, respectively, -and the calculation of a quantity - \[ - S = \sum_{i=0}^{k-1} (g_i - \tcode{g.min()}) - \cdot R^i - \] +and the calculation of a quantity $S$ given by \eqref{rand.gencanonical}: +\begin{formula}{rand.gencanonical} +S = \sum_{i=0}^{k-1} (g_i - \tcode{g.min()}) \cdot R^i +\end{formula} \pnum \effects @@ -4191,8 +4190,11 @@ produces random integers $i$, $a \leq i \leq b$, distributed according to -the constant discrete probability function% -\[ P(i\,|\,a,b) = 1 / (b - a + 1) \text{ .} \] +the constant discrete probability function in \eqref{rand.dist.uni.int}. + +\begin{formula}{rand.dist.uni.int} +P(i\,|\,a,b) = 1 / (b - a + 1) +\end{formula} \indexlibraryglobal{uniform_int_distribution}% \indexlibrarymember{result_type}{uniform_int_distribution}% @@ -4291,8 +4293,10 @@ produces random numbers $x$, $a \leq x < b$, distributed according to -the constant probability density function% -\[ p(x\,|\,a,b) = 1 / (b - a) \text{ .} \] +the constant probability density function in \eqref{rand.dist.uni.real}. +\begin{formula}{rand.dist.uni.real} +p(x\,|\,a,b) = 1 / (b - a) +\end{formula} \begin{note} This implies that $p(x\,|\,a,b)$ is undefined when \tcode{a == b}. \end{note} @@ -4409,12 +4413,13 @@ A \tcode{bernoulli_distribution} random number distribution produces \tcode{bool} values $b$ distributed according to -the discrete probability function -\[ P(b\,|\,p) = \left\{ \begin{array}{ll} +the discrete probability function in \eqref{rand.dist.bern.bernoulli}. +\begin{formula}{rand.dist.bern.bernoulli} +P(b\,|\,p) = \left\{ \begin{array}{ll} p & \text{ if $b = \tcode{true}$, or} \\ 1 - p & \text{ if $b = \tcode{false}$.} \end{array}\right. -\] +\end{formula} \indexlibraryglobal{bernoulli_distribution}% \indexlibrarymember{result_type}{bernoulli_distribution}% @@ -4498,8 +4503,11 @@ A \tcode{binomial_distribution} random number distribution produces integer values $i \geq 0$ distributed according to -the discrete probability function% -\[ P(i\,|\,t,p) = \binom{t}{i} \cdot p^i \cdot (1-p)^{t-i} \text{ .} \] +the discrete probability function in \eqref{rand.dist.bern.bin}. + +\begin{formula}{rand.dist.bern.bin} +P(i\,|\,t,p) = \binom{t}{i} \cdot p^i \cdot (1-p)^{t-i} +\end{formula} \indexlibraryglobal{binomial_distribution}% \indexlibrarymember{result_type}{binomial_distribution}% @@ -4596,8 +4604,10 @@ A \tcode{geometric_distribution} random number distribution produces integer values $i \geq 0$ distributed according to -the discrete probability function -\[ P(i\,|\,p) = p \cdot (1-p)^{i} \text{ .} \] +the discrete probability function in \eqref{rand.dist.bern.geo}. +\begin{formula}{rand.dist.bern.geo} +P(i\,|\,p) = p \cdot (1-p)^{i} +\end{formula} \indexlibraryglobal{geometric_distribution}% \indexlibrarymember{result_type}{geometric_distribution}% @@ -4683,8 +4693,10 @@ A \tcode{negative_binomial_distribution} random number distribution produces random integers $i \geq 0$ distributed according to -the discrete probability function -\[ P(i\,|\,k,p) = \binom{k+i-1}{i} \cdot p^k \cdot (1-p)^i \text{ .} \] +the discrete probability function in \eqref{rand.dist.bern.negbin}. +\begin{formula}{rand.dist.bern.negbin} +P(i\,|\,k,p) = \binom{k+i-1}{i} \cdot p^k \cdot (1-p)^i +\end{formula} \begin{note} This implies that $P(i\,|\,k,p)$ is undefined when \tcode{p == 1}. \end{note} @@ -4800,11 +4812,12 @@ A \tcode{poisson_distribution} random number distribution produces integer values $i \geq 0$ distributed according to -the discrete probability function -\[ P(i\,|\,\mu) = \frac{e^{-\mu} \mu^{i}}{i\,!} \text{ .} \] +the discrete probability function in \eqref{rand.dist.pois.poisson}. +\begin{formula}{rand.dist.pois.poisson} +P(i\,|\,\mu) = \frac{e^{-\mu} \mu^{i}}{i\,!} +\end{formula} The distribution parameter $\mu$ -is also known as this distribution's \term{mean}% -. +is also known as this distribution's \term{mean}. \indexlibraryglobal{poisson_distribution}% \indexlibrarymember{result_type}{poisson_distribution}% @@ -4887,8 +4900,10 @@ An \tcode{exponential_distribution} random number distribution produces random numbers $x > 0$ distributed according to -the probability density function% -\[ p(x\,|\,\lambda) = \lambda e^{-\lambda x} \text{ .} \] +the probability density function in \eqref{rand.dist.pois.exp}. +\begin{formula}{rand.dist.pois.exp} +p(x\,|\,\lambda) = \lambda e^{-\lambda x} +\end{formula} \indexlibraryglobal{exponential_distribution}% \indexlibrarymember{result_type}{exponential_distribution}% @@ -4972,10 +4987,11 @@ A \tcode{gamma_distribution} random number distribution produces random numbers $x > 0$ distributed according to -the probability density function% -\[ p(x\,|\,\alpha,\beta) = +the probability density function in \eqref{rand.dist.pois.gamma}. +\begin{formula}{rand.dist.pois.gamma} +p(x\,|\,\alpha,\beta) = \frac{e^{-x/\beta}}{\beta^{\alpha} \cdot \Gamma(\alpha)} \, \cdot \, x^{\, \alpha-1} - \text{ .} \] +\end{formula} \indexlibraryglobal{gamma_distribution}% \indexlibrarymember{result_type}{gamma_distribution}% @@ -5074,11 +5090,12 @@ A \tcode{weibull_distribution} random number distribution produces random numbers $x \geq 0$ distributed according to -the probability density function% -\[ p(x\,|\,a,b) = \frac{a}{b} +the probability density function in \eqref{rand.dist.pois.weibull}. +\begin{formula}{rand.dist.pois.weibull} +p(x\,|\,a,b) = \frac{a}{b} \cdot \left(\frac{x}{b}\right)^{a-1} \cdot \, \exp\left( -\left(\frac{x}{b}\right)^a\right) - \text{ .} \] +\end{formula} \indexlibraryglobal{weibull_distribution}% \indexlibrarymember{result_type}{weibull_distribution}% @@ -5176,7 +5193,7 @@ An \tcode{extreme_value_distribution} random number distribution produces random numbers $x$ distributed according to -the probability density function +the probability density function in \eqref{rand.dist.pois.extreme}. \begin{footnote} The distribution corresponding to this probability density function @@ -5187,9 +5204,10 @@ or the Fisher-Tippett Type I distribution. \end{footnote} -\[ p(x\,|\,a,b) = \frac{1}{b} +\begin{formula}{rand.dist.pois.extreme} +p(x\,|\,a,b) = \frac{1}{b} \cdot \exp\left(\frac{a-x}{b} - \exp\left(\frac{a-x}{b}\right)\right) - \text{ .} \] +\end{formula} \indexlibraryglobal{extreme_value_distribution}% \indexlibrarymember{result_type}{extreme_value_distribution}% @@ -5301,8 +5319,8 @@ A \tcode{normal_distribution} random number distribution produces random numbers $x$ distributed according to -the probability density function% -\[% +the probability density function in \eqref{rand.dist.norm.normal}. +\begin{formula}{rand.dist.norm.normal} p(x\,|\,\mu,\sigma) = \frac{1}{\sigma \sqrt{2\pi}} \cdot @@ -5311,8 +5329,7 @@ {2 \sigma^2} \right) } - \text{ .} -\] +\end{formula} The distribution parameters $\mu$ and $\sigma$ are also known as this distribution's \term{mean} and \term{standard deviation}. @@ -5414,10 +5431,11 @@ A \tcode{lognormal_distribution} random number distribution produces random numbers $x > 0$ distributed according to -the probability density function% -\[ p(x\,|\,m,s) = \frac{1}{s x \sqrt{2 \pi}} +the probability density function in \eqref{rand.dist.norm.lognormal}. +\begin{formula}{rand.dist.norm.lognormal} +p(x\,|\,m,s) = \frac{1}{s x \sqrt{2 \pi}} \cdot \exp{\left(-\frac{(\ln{x} - m)^2}{2 s^2}\right)} - \text{ .} \] +\end{formula} \indexlibraryglobal{lognormal_distribution}% \indexlibrarymember{result_type}{lognormal_distribution}% @@ -5516,8 +5534,10 @@ A \tcode{chi_squared_distribution} random number distribution produces random numbers $x > 0$ distributed according to -the probability density function% -\[ p(x\,|\,n) = \frac{x^{(n/2)-1} \cdot e^{-x/2}}{\Gamma(n/2) \cdot 2^{n/2}} \text{ .} \] +the probability density function in \eqref{rand.dist.norm.chisq}. +\begin{formula}{rand.dist.norm.chisq} +p(x\,|\,n) = \frac{x^{(n/2)-1} \cdot e^{-x/2}}{\Gamma(n/2) \cdot 2^{n/2}} +\end{formula} \indexlibraryglobal{chi_squared_distribution}% \indexlibrarymember{result_type}{chi_squared_distribution}% @@ -5602,8 +5622,10 @@ A \tcode{cauchy_distribution} random number distribution produces random numbers $x$ distributed according to -the probability density function% -\[ p(x\,|\,a,b) = \left(\pi b \left(1 + \left(\frac{x-a}{b} \right)^2 \, \right)\right)^{-1} \text{ .} \] +the probability density function in \eqref{rand.dist.norm.cauchy}. +\begin{formula}{rand.dist.norm.cauchy} +p(x\,|\,a,b) = \left(\pi b \left(1 + \left(\frac{x-a}{b} \right)^2 \, \right)\right)^{-1} +\end{formula} \indexlibraryglobal{cauchy_distribution}% \indexlibrarymember{result_type}{cauchy_distribution}% @@ -5702,12 +5724,13 @@ A \tcode{fisher_f_distribution} random number distribution produces random numbers $x \ge 0$ distributed according to -the probability density function% -\[ p(x\,|\,m,n) = \frac{\Gamma\big((m+n)/2\big)}{\Gamma(m/2) \; \Gamma(n/2)} +the probability density function in \eqref{rand.dist.norm.f}. +\begin{formula}{rand.dist.norm.f} +p(x\,|\,m,n) = \frac{\Gamma\big((m+n)/2\big)}{\Gamma(m/2) \; \Gamma(n/2)} \cdot \left(\frac{m}{n}\right)^{m/2} \cdot x^{(m/2)-1} \cdot \left(1 + \frac{m x}{n}\right)^{-(m + n)/2} - \text{ .} \] +\end{formula} \indexlibraryglobal{fisher_f_distribution}% \indexlibrarymember{result_type}{fisher_distribution}% @@ -5806,11 +5829,12 @@ A \tcode{student_t_distribution} random number distribution produces random numbers $x$ distributed according to -the probability density function% -\[ p(x\,|\,n) = \frac{1}{\sqrt{n \pi}} +the probability density function in \eqref{rand.dist.norm.t}. +\begin{formula}{rand.dist.norm.t} +p(x\,|\,n) = \frac{1}{\sqrt{n \pi}} \cdot \frac{\Gamma\big((n+1)/2\big)}{\Gamma(n/2)} \cdot \left(1 + \frac{x^2}{n} \right)^{-(n+1)/2} - \text{ .} \] +\end{formula} \indexlibraryglobal{student_t_distribution}% \indexlibrarymember{result_type}{student_t_distribution}% @@ -5909,8 +5933,10 @@ A \tcode{discrete_distribution} random number distribution produces random integers $i$, $0 \leq i < n$, distributed according to -the discrete probability function% -\[ P(i \,|\, p_0, \dotsc, p_{n-1}) = p_i \text{ .} \] +the discrete probability function in \eqref{rand.dist.samp.discrete}. +\begin{formula}{rand.dist.samp.discrete} +P(i \,|\, p_0, \dotsc, p_{n-1}) = p_i +\end{formula} \pnum Unless specified otherwise, @@ -6011,7 +6037,7 @@ \pnum \effects Constructs a \tcode{discrete_distribution} object -with probabilities given by the formula above. +with probabilities given by the \eqref{rand.dist.samp.discrete}. \end{itemdescr} @@ -6088,9 +6114,11 @@ $b_0 \leq x < b_n$, uniformly distributed over each subinterval $[ b_i, b_{i+1} )$ -according to the probability density function -\[ p(x \,|\, b_0, \dotsc, b_n, \; \rho_0, \dotsc, \rho_{n-1}) = \rho_i - \text{ , for $b_i \le x < b_{i+1}$.} \] +according to the probability density function in \eqref{rand.dist.samp.pconst}. +\begin{formula}{rand.dist.samp.pconst} +p(x \,|\, b_0, \dotsc, b_n, \; \rho_0, \dotsc, \rho_{n-1}) = \rho_i + \text{ , for $b_i \le x < b_{i+1}$.} +\end{formula} \pnum The $n + 1$ distribution parameters $b_i$, @@ -6324,11 +6352,13 @@ $b_0 \leq x < b_n$, distributed over each subinterval $[b_i, b_{i+1})$ -according to the probability density function -\[ p(x \,|\, b_0, \dotsc, b_n, \; \rho_0, \dotsc, \rho_n) +according to the probability density function in \eqref{rand.dist.samp.plinear}. +\begin{formula}{rand.dist.samp.plinear} +p(x \,|\, b_0, \dotsc, b_n, \; \rho_0, \dotsc, \rho_n) = \rho_{i} \cdot {\frac{b_{i+1} - x}{b_{i+1} - b_i}} + \rho_{i+1} \cdot {\frac{x - b_i}{b_{i+1} - b_i}} - \text{ , for $b_i \le x < b_{i+1}$.} \] + \text{ , for $b_i \le x < b_{i+1}$.} +\end{formula} \pnum The $n + 1$ distribution parameters $b_i$, @@ -9648,13 +9678,16 @@ \pnum \returns -\[ \mathsf{L}_n^m(x) = - (-1)^m \frac{\mathsf{d} ^ m}{\mathsf{d}x ^ m} \, \mathsf{L}_{n+m}(x) - \text{ ,\quad for $x \ge 0$,} \] -where +$\mathsf{L}_n^m(x)$, +where $\mathsf{L}_n^m$ is given by \eqref{sf.cmath.assoc.laguerre}, $n$ is \tcode{n}, $m$ is \tcode{m}, and $x$ is \tcode{x}. +\begin{formula}{sf.cmath.assoc.laguerre} +\mathsf{L}_n^m(x) = + (-1)^m \frac{\mathsf{d} ^ m}{\mathsf{d}x ^ m} \, \mathsf{L}_{n+m}(x) + \text{ ,\quad for $x \ge 0$} +\end{formula} \pnum \remarks @@ -9686,13 +9719,16 @@ \pnum \returns -\[ \mathsf{P}_\ell^m(x) = (1 - x^2) ^ {m/2} \: - \frac{\mathsf{d} ^ m}{\mathsf{d}x ^ m} \, \mathsf{P}_\ell(x) - \text{ ,\quad for $|x| \le 1$,} \] -where +$\mathsf{P}_\ell^m(x)$, +where $\mathsf{P}_\ell^m$ is given by \eqref{sf.cmath.assoc.legendre}, $l$ is \tcode{l}, $m$ is \tcode{m}, and $x$ is \tcode{x}. +\begin{formula}{sf.cmath.assoc.legendre} +\mathsf{P}_\ell^m(x) = (1 - x^2) ^ {m/2} \: + \frac{\mathsf{d} ^ m}{\mathsf{d}x ^ m} \, \mathsf{P}_\ell(x) + \text{ ,\quad for $|x| \le 1$} +\end{formula} \pnum \remarks @@ -9723,11 +9759,14 @@ \pnum \returns -\[ \mathsf{B}(x, y) = \frac{\Gamma(x) \, \Gamma(y)}{\Gamma(x + y)} - \text{ ,\quad for $x > 0$,\, $y > 0$,} \] -where +$\mathsf{B}(x, y)$, +where $\mathsf{B}$ is given by \eqref{sf.cmath.beta}, $x$ is \tcode{x} and $y$ is \tcode{y}. +\begin{formula}{sf.cmath.beta} +\mathsf{B}(x, y) = \frac{\Gamma(x) \, \Gamma(y)}{\Gamma(x + y)} + \text{ ,\quad for $x > 0$,\, $y > 0$} +\end{formula} \end{itemdescr} \rSec3[sf.cmath.comp.ellint.1]{Complete elliptic integral of the first kind}% @@ -9752,9 +9791,12 @@ \pnum \returns -\[ \mathsf{K}(k) = \mathsf{F}(k, \pi / 2) \text{ ,\quad for $|k| \le 1$,} \] -where +$\mathsf{K}(k)$, +where $\mathsf{K}$ is given by \eqref{sf.cmath.comp.ellint.1} and $k$ is \tcode{k}. +\begin{formula}{sf.cmath.comp.ellint.1} +\mathsf{K}(k) = \mathsf{F}(k, \pi / 2) \text{ ,\quad for $|k| \le 1$} +\end{formula} \pnum See also \ref{sf.cmath.ellint.1}. @@ -9782,9 +9824,12 @@ \pnum \returns -\[ \mathsf{E}(k) = \mathsf{E}(k, \pi / 2) \text{ ,\quad for $|k| \le 1$,} \] -where +$\mathsf{E}(k)$, +where $\mathsf{E}$ is given by \eqref{sf.cmath.comp.ellint.2} and $k$ is \tcode{k}. +\begin{formula}{sf.cmath.comp.ellint.2} +\mathsf{E}(k) = \mathsf{E}(k, \pi / 2) \text{ ,\quad for $|k| \le 1$} +\end{formula} \pnum See also \ref{sf.cmath.ellint.2}. @@ -9812,10 +9857,13 @@ \pnum \returns -\[ \mathsf{\Pi}(\nu, k) = \mathsf{\Pi}(\nu, k, \pi / 2) \text{ ,\quad for $|k| \le 1$,} \] -where -$k$ is \tcode{k} and +$\mathsf{\Pi}(\nu, k)$, +where $\mathsf{\Pi}$ is given by \eqref{sf.cmath.comp.ellint.3}, +$k$ is \tcode{k}, and $\nu$ is \tcode{nu}. +\begin{formula}{sf.cmath.comp.ellint.3} +\mathsf{\Pi}(\nu, k) = \mathsf{\Pi}(\nu, k, \pi / 2) \text{ ,\quad for $|k| \le 1$} +\end{formula} \pnum See also \ref{sf.cmath.ellint.3}. @@ -9843,13 +9891,16 @@ \pnum \returns -\[ \mathsf{I}_\nu(x) = +$\mathsf{I}_\nu(x)$, +where $\mathsf{I}_\nu$ is given by \eqref{sf.cmath.cyl.bessel.i}, +$\nu$ is \tcode{nu}, and +$x$ is \tcode{x}. +\begin{formula}{sf.cmath.cyl.bessel.i} +\mathsf{I}_\nu(x) = \mathrm{i}^{-\nu} \mathsf{J}_\nu(\mathrm{i}x) = \sum_{k=0}^\infty \frac{(x/2)^{\nu+2k}}{k! \: \Gamma(\nu+k+1)} - \text{ ,\quad for $x \ge 0$,} \] -where -$\nu$ is \tcode{nu} and -$x$ is \tcode{x}. + \text{ ,\quad for $x \ge 0$} +\end{formula} \pnum \remarks @@ -9884,12 +9935,15 @@ \pnum \returns -\[ \mathsf{J}_\nu(x) = - \sum_{k=0}^\infty \frac{(-1)^k (x/2)^{\nu+2k}}{k! \: \Gamma(\nu+k+1)} - \text{ ,\quad for $x \ge 0$,} \] -where -$\nu$ is \tcode{nu} and +$\mathsf{J}_\nu(x)$, +where $\mathsf{J}_\nu$ is given by \eqref{sf.cmath.cyl.bessel.j}, +$\nu$ is \tcode{nu}, and $x$ is \tcode{x}. +\begin{formula}{sf.cmath.cyl.bessel.j} +\mathsf{J}_\nu(x) = + \sum_{k=0}^\infty \frac{(-1)^k (x/2)^{\nu+2k}}{k! \: \Gamma(\nu+k+1)} + \text{ ,\quad for $x \ge 0$} +\end{formula} \pnum \remarks @@ -9921,7 +9975,11 @@ \pnum \returns -\[% +$\mathsf{K}_\nu(x)$, +where $\mathsf{K}_\nu$ is given by \eqref{sf.cmath.cyl.bessel.k}, +$\nu$ is \tcode{nu}, and +$x$ is \tcode{x}. +\begin{formula}{sf.cmath.cyl.bessel.k} \mathsf{K}_\nu(x) = (\pi/2)\mathrm{i}^{\nu+1} ( \mathsf{J}_\nu(\mathrm{i}x) + \mathrm{i} \mathsf{N}_\nu(\mathrm{i}x) @@ -9943,10 +10001,7 @@ & \mbox{for $x \ge 0$ and integral $\nu$} \end{array} \right. -\] -where -$\nu$ is \tcode{nu} and -$x$ is \tcode{x}. +\end{formula} \pnum \remarks @@ -9982,7 +10037,11 @@ \pnum \returns -\[% +$\mathsf{N}_\nu(x)$, +where $\mathsf{N}_\nu$ is given by \eqref{sf.cmath.cyl.neumann}, +$\nu$ is \tcode{nu}, and +$x$ is \tcode{x}. +\begin{formula}{sf.cmath.cyl.neumann} \mathsf{N}_\nu(x) = \left\{ \begin{array}{cl} @@ -9998,10 +10057,7 @@ & \mbox{for $x \ge 0$ and integral $\nu$} \end{array} \right. -\] -where -$\nu$ is \tcode{nu} and -$x$ is \tcode{x}. +\end{formula} \pnum \remarks @@ -10035,12 +10091,15 @@ \pnum \returns -\[ \mathsf{F}(k, \phi) = - \int_0^\phi \! \frac{\mathsf{d}\theta}{\sqrt{1 - k^2 \sin^2 \theta}} - \text{ ,\quad for $|k| \le 1$,} \] -where -$k$ is \tcode{k} and +$\mathsf{F}(k, \phi)$, +where $\mathsf{F}$ is given by \eqref{sf.cmath.ellint.1}, +$k$ is \tcode{k}, and $\phi$ is \tcode{phi}. +\begin{formula}{sf.cmath.ellint.1} +\mathsf{F}(k, \phi) = + \int_0^\phi \! \frac{\mathsf{d}\theta}{\sqrt{1 - k^2 \sin^2 \theta}} + \text{ ,\quad for $|k| \le 1$} +\end{formula} \end{itemdescr} \rSec3[sf.cmath.ellint.2]{Incomplete elliptic integral of the second kind}% @@ -10065,11 +10124,14 @@ \pnum \returns -\[ \mathsf{E}(k, \phi) = \int_0^\phi \! \sqrt{1 - k^2 \sin^2 \theta} \, \mathsf{d}\theta - \text{ ,\quad for $|k| \le 1$,} \] -where -$k$ is \tcode{k} and +$\mathsf{E}(k, \phi)$, +where $\mathsf{E}$ is given by \eqref{sf.cmath.ellint.2}, +$k$ is \tcode{k}, and $\phi$ is \tcode{phi}. +\begin{formula}{sf.cmath.ellint.2} +\mathsf{E}(k, \phi) = \int_0^\phi \! \sqrt{1 - k^2 \sin^2 \theta} \, \mathsf{d}\theta + \text{ ,\quad for $|k| \le 1$} +\end{formula} \end{itemdescr} \rSec3[sf.cmath.ellint.3]{Incomplete elliptic integral of the third kind}% @@ -10096,12 +10158,15 @@ \pnum \returns -\[ \mathsf{\Pi}(\nu, k, \phi) = \int_0^\phi \! - \frac{ \mathsf{d}\theta }{ (1 - \nu \, \sin^2 \theta) \sqrt{1 - k^2 \sin^2 \theta} } \text{ ,\quad for $|k| \le 1$,} \] -where +$\mathsf{\Pi}(\nu, k, \phi)$, +where $\mathsf{\Pi}$ is given by \eqref{sf.cmath.ellint.3}, $\nu$ is \tcode{nu}, $k$ is \tcode{k}, and $\phi$ is \tcode{phi}. +\begin{formula}{sf.cmath.ellint.3} +\mathsf{\Pi}(\nu, k, \phi) = \int_0^\phi \! + \frac{ \mathsf{d}\theta }{ (1 - \nu \, \sin^2 \theta) \sqrt{1 - k^2 \sin^2 \theta} } \text{ ,\quad for $|k| \le 1$} +\end{formula} \end{itemdescr} \rSec3[sf.cmath.expint]{Exponential integral}% @@ -10126,15 +10191,14 @@ \pnum \returns -\[% +$\mathsf{Ei}(x)$, +where $\mathsf{Ei}$ is given by \eqref{sf.cmath.expint} and +$x$ is \tcode{x}. +\begin{formula}{sf.cmath.expint} \mathsf{Ei}(x) = - \int_{-x}^\infty \frac{e^{-t}} {t } \, \mathsf{d}t -\; -\] -where -$x$ is \tcode{x}. - +\end{formula} \end{itemdescr} \rSec3[sf.cmath.hermite]{Hermite polynomials}% @@ -10158,15 +10222,15 @@ \pnum \returns -\[% +$\mathsf{H}_n(x)$, +where $\mathsf{H}_n$ is given by \eqref{sf.cmath.hermite}, +$n$ is \tcode{n}, and +$x$ is \tcode{x}. +\begin{formula}{sf.cmath.hermite} \mathsf{H}_n(x) = (-1)^n e^{x^2} \frac{ \mathsf{d} ^n} { \mathsf{d}x^n} \, e^{-x^2} -\; -\] -where -$n$ is \tcode{n} and -$x$ is \tcode{x}. +\end{formula} \pnum \remarks @@ -10196,12 +10260,15 @@ \pnum \returns -\[ \mathsf{L}_n(x) = - \frac{e^x}{n!} \frac{\mathsf{d}^n}{\mathsf{d}x^n} \, (x^n e^{-x}) - \text{ ,\quad for $x \ge 0$,} \] -where -$n$ is \tcode{n} and +$\mathsf{L}_n(x)$, +where $\mathsf{L}_n$ is given by \eqref{sf.cmath.laguerre}, +$n$ is \tcode{n}, and $x$ is \tcode{x}. +\begin{formula}{sf.cmath.laguerre} +\mathsf{L}_n(x) = + \frac{e^x}{n!} \frac{\mathsf{d}^n}{\mathsf{d}x^n} \, (x^n e^{-x}) + \text{ ,\quad for $x \ge 0$} +\end{formula} \pnum \remarks @@ -10231,13 +10298,16 @@ \pnum \returns -\[ \mathsf{P}_\ell(x) = +$\mathsf{P}_\ell(x)$, +where $\mathsf{P}_\ell$ is given by \eqref{sf.cmath.legendre}, +$l$ is \tcode{l}, and +$x$ is \tcode{x}. +\begin{formula}{sf.cmath.legendre} +\mathsf{P}_\ell(x) = \frac{1}{2^\ell \, \ell!} \frac{\mathsf{d}^\ell}{\mathsf{d}x^\ell} \, (x^2 - 1) ^ \ell - \text{ ,\quad for $|x| \le 1$,} \] -where -$l$ is \tcode{l} and -$x$ is \tcode{x}. + \text{ ,\quad for $|x| \le 1$} +\end{formula} \pnum \remarks @@ -10267,7 +10337,10 @@ \pnum \returns -\[% +$\mathsf{\zeta}(x)$, +where $\mathsf{\zeta}$ is given by \eqref{sf.cmath.riemann.zeta} and +$x$ is \tcode{x}. +\begin{formula}{sf.cmath.riemann.zeta} \mathsf{\zeta}(x) = \left\{ \begin{array}{cl} @@ -10288,10 +10361,7 @@ & \mbox{for $x < 0$} \end{array} \right. -\; -\] -where -$x$ is \tcode{x}. +\end{formula} \end{itemdescr} \rSec3[sf.cmath.sph.bessel]{Spherical Bessel functions of the first kind}% @@ -10316,10 +10386,13 @@ \pnum \returns -\[ \mathsf{j}_n(x) = (\pi/2x)^{1\!/\!2} \mathsf{J}_{n + 1\!/\!2}(x) \text{ ,\quad for $x \ge 0$,} \] -where -$n$ is \tcode{n} and +$\mathsf{j}_n(x)$, +where $\mathsf{j}_n$ is given by \eqref{sf.cmath.sph.bessel}, +$n$ is \tcode{n}, and $x$ is \tcode{x}. +\begin{formula}{sf.cmath.sph.bessel} +\mathsf{j}_n(x) = (\pi/2x)^{1\!/\!2} \mathsf{J}_{n + 1\!/\!2}(x) \text{ ,\quad for $x \ge 0$} +\end{formula} \pnum \remarks @@ -10353,17 +10426,17 @@ \pnum \returns -\[ \mathsf{Y}_\ell^m(\theta, 0) \] -where -\[ \mathsf{Y}_\ell^m(\theta, \phi) = - (-1)^m \left[\frac{(2 \ell + 1)}{4 \pi} \frac{(\ell - m)!}{(\ell + m)!}\right]^{1/2} - \mathsf{P}_\ell^m (\cos\theta) e^{i m \phi} - \text{ ,\quad for $|m| \le \ell$,} -\] -and +$\mathsf{Y}_\ell^m(\theta, 0)$, +where $\mathsf{Y}_\ell^m$ is given by \eqref{sf.cmath.sph.legendre}, $l$ is \tcode{l}, $m$ is \tcode{m}, and $\theta$ is \tcode{theta}. +\begin{formula}{sf.cmath.sph.legendre} +\mathsf{Y}_\ell^m(\theta, \phi) = + (-1)^m \left[\frac{(2 \ell + 1)}{4 \pi} \frac{(\ell - m)!}{(\ell + m)!}\right]^{1/2} + \mathsf{P}_\ell^m (\cos\theta) e^{i m \phi} + \text{ ,\quad for $|m| \le \ell$} +\end{formula} \pnum \remarks @@ -10398,11 +10471,14 @@ \pnum \returns -\[ \mathsf{n}_n(x) = (\pi/2x)^{1\!/\!2} \mathsf{N}_{n + 1\!/\!2}(x) - \text{ ,\quad for $x \ge 0$,} \] -where -$n$ is \tcode{n} and +$\mathsf{n}_n(x)$, +where $\mathsf{n}_n$ is given by \eqref{sf.cmath.sph.neumann}, +$n$ is \tcode{n}, and $x$ is \tcode{x}. +\begin{formula}{sf.cmath.sph.neumann} +\mathsf{n}_n(x) = (\pi/2x)^{1\!/\!2} \mathsf{N}_{n + 1\!/\!2}(x) + \text{ ,\quad for $x \ge 0$} +\end{formula} \pnum \remarks diff --git a/tools/check-output.sh b/tools/check-output.sh index 867e38e661..bfd2a370b6 100755 --- a/tools/check-output.sh +++ b/tools/check-output.sh @@ -36,7 +36,7 @@ rm -f tmp.txt # Find bad labels grep newlabel `ls *.aux | grep -v std.aux` | awk -F '{' '{ print $2 }' | - sed 's/}//g' | sed 's/^tab://;s/fig://;s/idx.*\..//' | + sed 's/}//g' | sed 's/^tab://;s/fig://;s/eq://;s/idx.*\..//' | grep -v '^[a-z.0-9]*$' | sed 's/^\(.*\)$/bad label \1/' | fail || failed=1 From 2b0ff8d6bd285bbe8b27fdab47e268b115a3f930 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Wed, 10 Jul 2024 11:33:23 +0100 Subject: [PATCH 102/162] [lex.string] Replace colon with full stop to end the sentence. On request of ISO/CS, for otherwise we should have made the next 'if' lowercase, because: "Grammatically this is the same sentence, as there is no full stop, so the 'if' should be lowercase." If a colon really doesn't end a sentence, then we should make it so that the sentence really does end. --- source/lex.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/lex.tex b/source/lex.tex index e2941c83df..8ac924c910 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -1901,7 +1901,7 @@ \indextext{concatenation!string}% The common \grammarterm{encoding-prefix} for a sequence of adjacent \grammarterm{string-literal}s -is determined pairwise as follows: +is determined pairwise as follows. If two \grammarterm{string-literal}{s} have the same \grammarterm{encoding-prefix}, the common \grammarterm{encoding-prefix} is that \grammarterm{encoding-prefix}. From 064fb0b34eb8cbb14f52dc966c833ef7c749c82c Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 14 May 2024 08:23:07 +0200 Subject: [PATCH 103/162] [macros] Prefer page break above 'note' or 'example' introducers Fixes ISO/CS comment (C++23 proof) --- source/macros.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/macros.tex b/source/macros.tex index 5e146135b0..9eb20bf1eb 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -318,7 +318,7 @@ \newcommand{\newnoteenvironment}[3]{ \newsubclausecounter{#1} \newenvironment{tail#1} -{\par\small\stepcounter{#1}\noteintro{#2}} +{\par\small\penalty -200\stepcounter{#1}\noteintro{#2}} {\noteoutro{#3}} \newenvironment{#1} {\begin{tail#1}} @@ -570,7 +570,7 @@ % surrounded by @ signs. \newcommand{\CodeBlockSetup}{% \lstset{escapechar=@, aboveskip=\parskip, belowskip=0pt, - midpenalty=500, endpenalty=-50, + beginpenalty=200, midpenalty=500, endpenalty=-50, emptylinepenalty=-250, semicolonpenalty=0,upquote=true}% \renewcommand{\tcode}[1]{\textup{\CodeStylex{##1}}} \renewcommand{\term}[1]{\textit{##1}}% From 13b08d0f58dfea7ae2e19b1d931094d4523a52d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Thu, 11 Jul 2024 01:41:29 +0100 Subject: [PATCH 104/162] [layout, styles] New ISO header and footer layout. The footer now takes up two lines, one for the copyright and one for the page number. --- source/layout.tex | 2 +- source/styles.tex | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/layout.tex b/source/layout.tex index b74849dd00..1f82bd20d9 100644 --- a/source/layout.tex +++ b/source/layout.tex @@ -10,7 +10,7 @@ %%-------------------------------------------------- %% set header and footer positions and sizes -\setheadfoot{\onelineskip}{2\onelineskip} +\setheadfoot{\onelineskip}{4\onelineskip} \setheaderspaces{*}{2\onelineskip}{*} %%-------------------------------------------------- diff --git a/source/styles.tex b/source/styles.tex index 76541f69a8..e6372565cd 100644 --- a/source/styles.tex +++ b/source/styles.tex @@ -31,10 +31,10 @@ %% create page styles \makepagestyle{cpppage} -\makeevenhead{cpppage}{\copyright\,\textsc{ISO/IEC}}{}{\textbf{\docno}} -\makeoddhead{cpppage}{\copyright\,\textsc{ISO/IEC}}{}{\textbf{\docno}} -\makeevenfoot{cpppage}{\leftmark}{}{\thepage} -\makeoddfoot{cpppage}{\leftmark}{}{\thepage} +\makeevenhead{cpppage}{}{\textbf{\docno}}{} + \makeoddhead{cpppage}{}{\textbf{\docno}}{} +\makeevenfoot{cpppage}{\leftmark\\\mbox{}}{}{\copyright\,\textsc{ISO/IEC}\\\thepage} + \makeoddfoot{cpppage}{\leftmark\\\mbox{}}{}{\copyright\,\textsc{ISO/IEC}\\\thepage} \makeatletter \makepsmarks{cpppage}{% From 7f6069c794abb56e51affdc2923e3d33b3a547a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Thu, 11 Jul 2024 12:27:28 +0100 Subject: [PATCH 105/162] [cover-reg] Update regular cover --- source/assets/iso-logo-caution.png | Bin 0 -> 5465 bytes source/cover-reg.tex | 26 ++++++++++++++------------ 2 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 source/assets/iso-logo-caution.png diff --git a/source/assets/iso-logo-caution.png b/source/assets/iso-logo-caution.png new file mode 100644 index 0000000000000000000000000000000000000000..49b12792b88e3f2979d3a7fdbbc64eb958c5577c GIT binary patch literal 5465 zcmV-f6{hNmP)%xKL7v~3rR#lRCr$PodvKQMG%Ie3U_yRcXxMpC%C&5PH>0dQn))5?mXNn z3POShmjn$EoFU&-`qJBPWbeJZcY9Q}YHIiP_I76bpZ1=;k(_fQjcC;W@8Pf5?4?p;Q?)o-py_^Du6K%Eq`RAYRv(G+r_uhN2yX2Bf+&Sl* z<1V}GGWXzv54r&Z2DqVs4_V~#n- zee%gC?w^1D$=$AMTYCb7i0ad)kDG74`8*h7jWt%GjXCC+en0u-le??0zS@2L_1C#u zR&8rfV4i;ZX}95q8@dT5n81TD_Sj<=0Fh%jXN@)1a8Eq(M7wcKdjSKd{Px>#?$ARI zb+gPeiyLE%F+3;&jBRk!WRp$ijz9i*_rV7ryKEV9__uuZLk3Moc?X;8E9dL_?EI4MF zWtMS=9d?*oYpt~kpusg0PB@|4V~;)j@7rW+A7Fm`@ke+6{r7v$u=-@;i6?d^oph3W z?z!h&@7}%Lj5E&YIYq=A#|td5fHxT0WNRN_UViyyxB2Fq*Eog7@kA3%{kH=ipUORF|85bn0yZgVTIymCP-aSXTYw%cy*$tR!m+=3_r7!heWl~`g^ zO*K_P*T8A`Ko}DEL>1kt3k;wP9z3{U9t*bs41r1_%CEfgN(~Ubry&BDUV3RS!sPb? z&aS)e>Rx*3rQ9%DwN)1wX7d$ST;Ud4XrWFHBLPapk?0l+h=?=@k8guW)8;k6&OZC> z-k<>d3U1W|1`iz_u-`B1)gCL!tu8*JdNyY4zKvIGc#vEcCiU3cB(Hri+-H_0TE z6u4%bamI05Zn>owc@^BM2@KI-5?*kIwyGd1Ar}<>V~;)No`3%NPQd8KdAR1p6Hj!D zF1l#Jssmum=cA84+I|21_qieU^j1A!;1&pu)5xsWiW?7~*^lD3+!6za>+ZYnKDYbs zyVtlzM-En5Wfc!{#VoYy0rT<4AG4t%D@x>Q=LtvCq zMyY`pDZ(p^vK(&B@ICtNDw_9qdrM!~Y${G;{0pS3x@GZB5L>nAP9RU6iT&MjS z03s@lE+QURk*!+5y#4mu?x2GX^2F1M8Yhv^J=sWf1{PNeh!6+y8@O%NRaY%UpXrDG zFev)>@9(4771*i+47vq{k2kNKNeD;W3&5E95IDsxAy9;C&?Tpyda9dYh8b$03qV+Z zmtTIl`|`^#b3^TktvbN;>(|e1yY03t>n2wo3peXcG$tk%U*o(#ULGRJ& zf2Z&~8OMG0*~dNbzyqDQ1yG2SU3Ae!KJNmzkvhgm;9f+dIZrH1qR$#sK64&}f=IJX zs8Q?z*e!HATMG>4DWynS)=NTb;e{9WB8A+F%zDu!C~$NEg%_g4r4mz!%z3=}^UgcZ zbCnHt!ZlZ2b(N1KNQ6PSh6n)(IJl-oY3SAgLk97dTW;}DUajyU5a#TD`|Vfb4z1J? zPk8YXvJoIePw3PDmez91E$2DQibH?`^wUl|&CNXX%>H@}4&x#Mfz#On&S@Pm5SW~Z z^;zH+L=jve>0)hpA=cm&9W53xY~i065=0Dcz4g{wd`)x?_aY6=_Zk@XIH6c>6mPV^ zd~OXeLxv3Tr9_y*I$g{$3jc^Bj_{%;G{djF@=7=N+;bO{cB~Rp?n#~>(TByRb(N%{ z5ot5cG*dyONzfF-8PWQ@?eL|XDqlq_uR8nnt?sW1nX~p{`u$JV>NQ?SzwUWlnxz!_~AYmV#OHN z5Frypj&&FX7|M@Az{DE*3t*V}0HYmF;TraL-g&3jTUdiOHE_TI2e>!hcq8|Cjof+` z7-ThdUj!trB}A+W^O(Xts|y4eev26kp+nqZ4FCZKQ<}(v6=fQn*I$3#9dgJa-sIM` zYZwsXPxW9Ly61p_TfY15JGbMGJ9>{>$HT;WLe@h(X4q1bAWUH z`R9AlYK;?&j=lHZ+Z!-V=A7mOLr9;v6lSpX@F6a_5v;8ow}=6Nk|yFz&{Ic-L*PJ6 zIE$DVVicms#F(51Jc>Q2M}uoD$mloj)nr4U`M?l8ChRfA6jKytAjCtK^PP1jEjSh! z!ZkMd7z2i43nI=;j!>l8fdxMGnVUZ5RrySQb&Hb&3W?e3*03J-47=LLyA>CDVEK*=KuTtp;vZ4mK~hZT zbaG9A;Wzj{fNP%tLx%4@|NQeD8M?AH2N-e~++y`e3>0bn247;+O*bw0G9gjM%qG%6Xun=yq)|tJ$R&6M?=F)vR7?FxNC57+zCFc@Usz51%~`hP+3qTHO)@CPY9C0CW_~#x*dO zW0(k-%9O`i=hgOSCx9LY{gDS^QfXi$RY64K+i$;ZBsh%)25!NFhwUXJDBOY{!vjeE z-TEyt5JKk=FF1gRO6{~-t|4NL7-CG;hlzm{nix2yI_01(Od5$h`e|U!rm?`h`|i7b zhT5D4+=F?`tb;(dC_L6;z=$tH>Q@7!xdniT4iE~m#Lx9@`{fu>NO1_xrAPpobZ`xY zA8)<&miztp-*aRtvo#JF21FSvxvE~*Y0MB1?Eg>Ssh+>H& zp8*&XmG3lJnAk)}O%Q!vd>ayK#QB(X zdJ=L>3Y&VlZf@NN28EAqp>WP-{unSa84;)bh}i5c1B%RCDl}QXCmd>lAr^=DWQJ>C zQXs_ov)~{~_u6YOFVb}1h*c&hK3q3Tp1KbV?-1k7N62&Sg~Kf@&7-)&n#Yz1_I!$y zgg979aH95QG%&>HsEk1`gn&u4)VS!INyf{Bh(3f8f4l6mOLyNP&^=%P1-*fjCETK| zB3_n?C zT?dBrD$6HWj*Y*dxrG=OYh75OMgBgwkkt|_1cW6JU_*F{216z@`5L0iwx~Qb2HSUR zZ2CI-CxRi1t>pOuiRb4PT$tEhOhb1a7%UGg5Q;0rDv{Yr3<(*GGpQ}2&;y1ZJk~Vf z5EWE&qJ#lP_m5I$)?$&R`c8pW791kX=oQVi9OH-*#(_><0H^D~Pyk0*gc+iVBF-dX z5C)%0g2ey|&0_l*q7b2`FoP(vp0SL9N*Y-y5b8GsKny5*EPFVDDot`uw!D_lIKW(k z$ggwj8ZgLCsUg-gg#nQ`82~rk}}CCj1i`Pi$=VdvQAH4@*!_QVbvhw@e^{oONvV14HSKn8)Hw3NXl82B=?E z6`OS_U~*h9tuj5UCvPbxi0(Dm)xx9}>) z*ceiPl)2tMi$nxA+iWu*b&!Yv4dVn6Pr|O`Rvs7>KISp6m$FI@Zx@A63@H_t$~|0& zFew7k7k&!<68#f`VdXM!{*&)hK~sBQ3rJ{8sWD0#df8={thNHbMl#9HLtU6yzt~KS4#UY|9e39$+*m zSVHtW@4WMRu>lci924?qO$#z#)^etRiG7y>C3G!&^eY@oC6JCpFfO>JSFc`vl4q(o z^T1GwL}!H9wKFN^F_s7-ER-rvJzNZwGS_1UBfjue7>CWtFh;^6IGIc+Z8Ddg6!thY zwh%CqP@@tE4z_+C5eafrnK)V=7`TNQAPP;-0?bo_bquP^tPDMD?BQdLYmwyy5a~aa z^JmPAUB~M}V1y<>4w%q$>G3fkNQLNP5$K0LCi6<1G4T$8JTO=iROH)qF&R8wQovwh z>Ehf&*yFMU;K9)?=o9Tr2?6Ao;35e;y~HC#@K8S~kYZz&^Yn#Lg6WP<*7}%6L?Dxf zP6NX`^^xONkVi&={Pz(kh`Biy2sbeQ!RCHy879tsgVG_DkA zvF89BCN%E?kwg`G53aD$ zWzl~uStkMz3(KU&93y<$CLBsOlL)wdR}O(z5_$Mvfh`OSp##c3c~Oq7J*M%NaH*gV zJz%}S#J-OK#Oz0J;O+Ak4XW{_YK1-44{{v+A||sXT&mA9z{G&o$ABYm0HIPya}AS; zC_KOgqR(MqcuP1{C<`vQV5jUH;sKvJog~={!a4m^4BC3eGp9Kyk4PP=Dw+GLZI36vG3Wx_S$Q{a#UVuq^pRS zOhm}Dz_5G*r5;+yN~J#E>3^U|J!I&7=wa=i=dcDD$`j6hBPP-g~es#VaRcoWs|YXfl_ARsfQ1>)IDiZ^A!rg z#QL|#p=)CVkBuuecGjCBYVGPe%zikElBZ$d6oKKzX(yk2a;HjtK669#jwm#F_2GzC zt`PwzLP89WNv@?478`jaXgVw+FdUenXmuc;2>{A#*5!v-Ip`LaQDd9a0h}|U)z`=q zVa?jtdWpkM@y4(?+Hhb74jkA)J_Y;V#&?MMAP0GgC)JOH*QMFdx%1trhotb9b^FYJH(`M4tB#z(+v@)_x615Ts_~{ zbMLbE3f)Iq>b(A(>MQm=w1lQQk|H9F3~=AReTM@xV8DP5!W{bD$2!!ZZxCym%evZf zzfXPNo!^%EzDz4~4@+114O~Q|qF=v$!+{yfJ{|Z0IBMt^9pbkH*XL5_yLz3yzRd4( z-`9K3)c5tA&-Fu-I3(4p7z%?14Juk?7shj=Znx4Hq+2|MXhNDR;gZBm$ zls~`_Bjb;vN%G+N6OtiA_v**tSKwN~s!V(I3 zu^W5av?Ha@g??kNOI;iLUD>{J{fF)m8&{~so+owQUIT5h!UFFJ@WA{BPKOfqvzCe5 P00000NkvXXu0mjfbEP~G literal 0 HcmV?d00001 diff --git a/source/cover-reg.tex b/source/cover-reg.tex index 91e968e150..04eeb51d7f 100644 --- a/source/cover-reg.tex +++ b/source/cover-reg.tex @@ -59,15 +59,16 @@ \thispagestyle{cpppage} -\fbox{% -\begin{minipage}{\copyboxwidth} +\vspace*{\fill} + \vspace{1ex} -\begin{center} -\textbf{Copyright notice} -\end{center} +\raisebox{-1ex}{\includegraphics{assets/iso-logo-caution.png}}\qquad\Large{\textbf{COPYRIGHT PROTECTED DOCUMENT}} \vspace{2ex} +\isocopyright + All rights reserved. Unless otherwise specified, +or required in the context of its implementation, no part of this publication may be reproduced or utilized otherwise in any form or by any means, electronic or mechanical, including photocopying, @@ -75,17 +76,18 @@ without prior written permission. Permission can be requested from either ISO at the address below -or ISO's member body in the country of the requester.\\\\ +or ISO's member body in the country of the requester. \begin{indented} \microtypesetup{activate=false}% ISO copyright office\\ -Case postale 56, CH-1211 Geneva 20\\ -\rlap{Tel.}\hphantom{Fax} + 41 22 749 01 11\\ -Fax + 41 22 749 09 47\\ -E-mail \texttt{copyright@iso.org}\\ -Web \url{www.iso.org} +CP 401 \textbullet{} Ch.\ de Blandonnet 8\\ +CH-1214 Vernier, Geneva\\ +Phone: +41 22 749 01 11\\ +Email: \texttt{copyright@iso.org}\\ +Website: \url{www.iso.org} \end{indented} -\end{minipage}} + +Published in Switzerland \newpage From f41a619cf852ae638bfe4792ec78ac1f214a7d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Fri, 12 Jul 2024 01:28:38 +0100 Subject: [PATCH 106/162] [impldefindex] Reinstate full page mark As of 13b08d0f58dfea7ae2e19b1d931094d4523a52d2 we have space for it. --- source/back.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/source/back.tex b/source/back.tex index e3cd10f17a..0f9119f51e 100644 --- a/source/back.tex +++ b/source/back.tex @@ -159,7 +159,6 @@ \clearpage \renewcommand{\preindexhook}{The entries in this index are rough descriptions; exact specifications are at the indicated page in the general text.\\} -\renewcommand{\leftmark}{Index of impl.-def. behavior} { \raggedright \printindex[impldefindex] From b2870b5c87765946f5c4a644da508adcc483045e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Fri, 12 Jul 2024 01:30:06 +0100 Subject: [PATCH 107/162] [macros, std] Create macros for ISO/IEC 60559 and ISO/IEC/IEEE 9945. As a side effect, this corrects the title of ISO/IEC 60559(:2020), whose previous version was ISO/IEC/IEEE 60559:2011. --- source/basic.tex | 18 +++++++++--------- source/intro.tex | 8 ++++---- source/lib-intro.tex | 4 ++-- source/macros.tex | 2 ++ source/preprocessor.tex | 8 ++++---- source/support.tex | 8 ++++---- source/threads.tex | 2 +- 7 files changed, 26 insertions(+), 24 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 24342733c4..b7e04d53fb 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -5229,9 +5229,9 @@ the range of that type is extended to all positive real numbers. \begin{note} Since negative and positive infinity are representable -in ISO/IEC/IEEE 60559 formats, +in \IsoFloatUndated{} formats, all real numbers lie within the range of representable values of -a floating-point type adhering to ISO/IEC/IEEE 60559. +a floating-point type adhering to \IsoFloatUndated{}. \end{note} \pnum @@ -5284,7 +5284,7 @@ \pnum If the implementation supports an extended floating-point type\iref{basic.fundamental} whose properties are specified by -the ISO/IEC/IEEE 60559 floating-point interchange format binary16, +the \IsoFloatUndated{} floating-point interchange format binary16, then the \grammarterm{typedef-name} \tcode{std::float16_t} is defined in the header \libheaderref{stdfloat} and names such a type, the macro \mname{STDCPP_FLOAT16_T} is defined\iref{cpp.predefined}, and @@ -5294,7 +5294,7 @@ \pnum If the implementation supports an extended floating-point type whose properties are specified by -the ISO/IEC/IEEE 60559 floating-point interchange format binary32, +the \IsoFloatUndated{} floating-point interchange format binary32, then the \grammarterm{typedef-name} \tcode{std::float32_t} is defined in the header \libheader{stdfloat} and names such a type, the macro \mname{STDCPP_FLOAT32_T} is defined, and @@ -5303,7 +5303,7 @@ \pnum If the implementation supports an extended floating-point type whose properties are specified by -the ISO/IEC/IEEE 60559 floating-point interchange format binary64, +the \IsoFloatUndated{} floating-point interchange format binary64, then the \grammarterm{typedef-name} \tcode{std::float64_t} is defined in the header \libheader{stdfloat} and names such a type, the macro \mname{STDCPP_FLOAT64_T} is defined, and @@ -5312,7 +5312,7 @@ \pnum If the implementation supports an extended floating-point type whose properties are specified by -the ISO/IEC/IEEE 60559 floating-point interchange format binary128, +the \IsoFloatUndated{} floating-point interchange format binary128, then the \grammarterm{typedef-name} \tcode{std::float128_t} is defined in the header \libheader{stdfloat} and names such a type, the macro \mname{STDCPP_FLOAT128_T} is defined, and @@ -5320,7 +5320,7 @@ \pnum If the implementation supports an extended floating-point type -with the properties, as specified by ISO/IEC/IEEE 60559, of +with the properties, as specified by \IsoFloatUndated{}, of radix ($b$) of 2, storage width in bits ($k$) of 16, precision in bits ($p$) of 8, @@ -5336,7 +5336,7 @@ A summary of the parameters for each type is given in \tref{basic.extended.fp}. The precision $p$ includes the implicit 1 bit at the beginning of the significand, so the storage used for the significand is $p-1$ bits. -ISO/IEC/IEEE 60559 does not assign a name for a type +\IsoFloatUndated{} does not assign a name for a type having the parameters specified for \tcode{std::bfloat16_t}. \end{note} \begin{floattable} @@ -5346,7 +5346,7 @@ \chdr{\tcode{float64_t}} & \chdr{\tcode{float128_t}} & \rhdr{\tcode{bfloat16_t}} \\ \capsep -ISO/IEC/IEEE 60559 name & binary16 & binary32 & binary64 & binary128 & \\ +\IsoFloatUndated{} name & binary16 & binary32 & binary64 & binary128 & \\ $k$, storage width in bits & 16 & 32 & 64 & 128 & 16 \\ $p$, precision in bits & 11 & 24 & 53 & 113 & 8 \\ $emax$, maximum exponent & 15 & 127 & 1023 & 16383 & 127 \\ diff --git a/source/intro.tex b/source/intro.tex index ca6009f3c9..b50e88eeab 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -36,18 +36,18 @@ \item ISO/IEC 2382, \doccite{Information technology --- Vocabulary} \item ISO 8601-1:2019, \doccite{Date and time --- Representations for information interchange --- Part 1: Basic rules} \item \IsoC{}, \doccite{Information technology --- Programming languages --- C} -\item ISO/IEC/IEEE 9945:2009, \doccite{Information Technology --- Portable Operating System Interface\begin{footnote} +\item \IsoPosixUndated{}:2009, \doccite{Information Technology --- Portable Operating System Interface\begin{footnote} POSIX\textregistered\ is a registered trademark of the Institute of Electrical and Electronic Engineers, Inc. This information is given for the convenience of users of this document and does not constitute an endorsement by ISO or IEC of this product. \end{footnote}% (POSIX\textregistered) Base Specifications, Issue 7} -\item ISO/IEC/IEEE 9945:2009/Cor 1:2013, \doccite{Information Technology --- Portable Operating System Interface +\item \IsoPosixUndated{}:2009/Cor 1:2013, \doccite{Information Technology --- Portable Operating System Interface (POSIX\textregistered) Base Specifications, Issue 7 --- Technical Corrigendum 1} -\item ISO/IEC/IEEE 9945:2009/Cor 2:2017, \doccite{Information Technology --- Portable Operating System Interface +\item \IsoPosixUndated{}:2009/Cor 2:2017, \doccite{Information Technology --- Portable Operating System Interface (POSIX\textregistered) Base Specifications, Issue 7 --- Technical Corrigendum 2} -\item ISO/IEC 60559:2020, \doccite{Information technology --- Microprocessor Systems --- Floating-Point arithmetic} +\item \IsoFloatUndated{}:2020, \doccite{Information technology --- Microprocessor Systems --- Floating-Point arithmetic} \item ISO 80000-2:2019, \doccite{Quantities and units --- Part 2: Mathematics} % Other international standards. \item Ecma International, \doccite{ECMAScript diff --git a/source/lib-intro.tex b/source/lib-intro.tex index fb0a13a5df..61e3ad1204 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -46,7 +46,7 @@ \end{floattable} \pnum -The operating system interface described in ISO/IEC/IEEE 9945:2009 is +The operating system interface described in \IsoPosixUndated{}:2009 is hereinafter called \defn{POSIX}. \pnum @@ -2981,7 +2981,7 @@ or to a namespace within namespace \tcode{posix} unless otherwise specified. The namespace \tcode{posix} is reserved for use by -ISO/IEC/IEEE 9945 and other POSIX standards. +\IsoPosixUndated{} and other POSIX standards. \rSec4[namespace.future]{Namespaces for future standardization} diff --git a/source/macros.tex b/source/macros.tex index 9eb20bf1eb..8b4821fdf3 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -286,6 +286,8 @@ \newcommand{\CppXXVI}{\Cpp{} 2026} \newcommand{\IsoCUndated}{ISO/IEC 9899} \newcommand{\IsoC}{\IsoCUndated{}:2018} +\newcommand{\IsoFloatUndated}{ISO/IEC 60559} +\newcommand{\IsoPosixUndated}{ISO/IEC/IEEE 9945} \newcommand{\opt}[1]{#1\ensuremath{_\mathit{\color{black}opt}}} \newcommand{\bigoh}[1]{\ensuremath{\mathscr{O}(#1)}} diff --git a/source/preprocessor.tex b/source/preprocessor.tex index db4bce19d1..920520bbff 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -1778,7 +1778,7 @@ \mname{STDCPP_FLOAT16_T}\\ Defined as the integer literal \tcode{1} if and only if the implementation supports -the ISO/IEC/IEEE 60559 floating-point interchange format binary16 +the \IsoFloatUndated{} floating-point interchange format binary16 as an extended floating-point type\iref{basic.extended.fp}. \item @@ -1786,7 +1786,7 @@ \mname{STDCPP_FLOAT32_T}\\ Defined as the integer literal \tcode{1} if and only if the implementation supports -the ISO/IEC/IEEE 60559 floating-point interchange format binary32 +the \IsoFloatUndated{} floating-point interchange format binary32 as an extended floating-point type. \item @@ -1794,7 +1794,7 @@ \mname{STDCPP_FLOAT64_T}\\ Defined as the integer literal \tcode{1} if and only if the implementation supports -the ISO/IEC/IEEE 60559 floating-point interchange format binary64 +the \IsoFloatUndated{} floating-point interchange format binary64 as an extended floating-point type. \item @@ -1802,7 +1802,7 @@ \mname{STDCPP_FLOAT128_T}\\ Defined as the integer literal \tcode{1} if and only if the implementation supports -the ISO/IEC/IEEE 60559 floating-point interchange format binary128 +the \IsoFloatUndated{} floating-point interchange format binary128 as an extended floating-point type. \item diff --git a/source/support.tex b/source/support.tex index bb6969020e..ff9103f67c 100644 --- a/source/support.tex +++ b/source/support.tex @@ -1454,9 +1454,9 @@ \begin{itemdescr} \pnum -\tcode{true} if and only if the type adheres to ISO/IEC/IEEE 60559. +\tcode{true} if and only if the type adheres to \IsoFloatUndated{}. \begin{footnote} -ISO/IEC/IEEE 60559:2020 is the same as IEEE 754-2019. +\IsoFloatUndated{}:2020 is the same as IEEE 754-2019. \end{footnote} \begin{note} The value is \tcode{true} for any of the types @@ -1544,7 +1544,7 @@ if tinyness is detected before rounding. \begin{footnote} Refer to -ISO/IEC/IEEE 60559. +\IsoFloatUndated{}. Required by ISO/IEC 10967-1:2012. \end{footnote} @@ -4945,7 +4945,7 @@ observed by \tcode{T}'s comparison operators, and if \tcode{numeric_limits::is_iec559} is \tcode{true}, is additionally consistent with the \tcode{totalOrder} operation - as specified in ISO/IEC/IEEE 60559. + as specified in \IsoFloatUndated{}. \item Otherwise, \tcode{strong_ordering(compare_three_way()(E, F))} if it is a well-formed expression. diff --git a/source/threads.tex b/source/threads.tex index 8fa6711bba..4cf733c55b 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -4140,7 +4140,7 @@ operations apply, the comparisons can fail for values that compare equal with \tcode{operator==} if the value representation has trap bits or alternate representations of the same value. Notably, on implementations conforming to -ISO/IEC/IEEE 60559, floating-point \tcode{-0.0} and \tcode{+0.0} +\IsoFloatUndated{}, floating-point \tcode{-0.0} and \tcode{+0.0} will not compare equal with \tcode{memcmp} but will compare equal with \tcode{operator==}, and NaNs with the same payload will compare equal with \tcode{memcmp} but will not compare equal with \tcode{operator==}. From 2e188e5c76b74913340c2f1b365a6f571522ec14 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 14:10:18 -0700 Subject: [PATCH 108/162] CWG233 References vs pointers in UDC overload resolution Editorial notes: * The reference wording in the paper was from before CWG2803 (8fb93183e4f00820a9407ac1d94969087e5020d8). * [over.ics.rank] Fix punctuation in bullet 3.2.5. --- source/overloading.tex | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) diff --git a/source/overloading.tex b/source/overloading.tex index 9e1292a793..d7cac76f7c 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -1734,10 +1734,10 @@ (see~\ref{dcl.init}, \ref{over.match.conv}, and~\ref{over.match.ref}) and the standard conversion sequence -from the return type of $\tcode{F}_1$ to the destination type +from the result of $\tcode{F}_1$ to the destination type (i.e., the type of the entity being initialized) is a better conversion sequence than the standard conversion sequence -from the return type of $\tcode{F}_2$ to the destination type +from the result of $\tcode{F}_2$ to the destination type \begin{example} \begin{codeblock} struct A { @@ -2792,7 +2792,7 @@ (where a standard conversion sequence that is a reference binding is considered to yield the cv-unqualified referenced type), where \tcode{T1} and \tcode{T2} are not the same type, and -\tcode{const T2} is reference-compatible with \tcode{T1}\iref{dcl.init.ref}. +\tcode{const T2} is reference-compatible with \tcode{T1}\iref{dcl.init.ref} \begin{example} \begin{codeblock} int f(const volatile int *); @@ -2806,6 +2806,7 @@ \end{codeblock} \end{example} or, if not that, + \item \tcode{S1} and @@ -2813,7 +2814,7 @@ bind ``reference to \tcode{T1}'' and ``reference to \tcode{T2}'', respectively\iref{dcl.init.ref}, where \tcode{T1} and \tcode{T2} are not the same type, and -\tcode{T2} is reference-compatible with \tcode{T1}. +\tcode{T2} is reference-compatible with \tcode{T1} \begin{example} \begin{codeblock} int f(const int &); @@ -2846,6 +2847,32 @@ } \end{codeblock} \end{example} +or, if not that, + +\item +\tcode{S1} and \tcode{S2} +bind the same reference type ``reference to \tcode{T}'' and +have source types \tcode{V1} and \tcode{V2}, respectively, +where the standard conversion sequence from \tcode{V1*} to \tcode{T*} +is better than the standard conversion sequence from \tcode{V2*} to \tcode{T*}. +\begin{example} +\begin{codeblock} +struct Z {}; + +struct A { + operator Z&(); + operator const Z&(); // \#1 +}; + +struct B { + operator Z(); + operator const Z&&(); // \#2 +}; + +const Z& r1 = A(); // OK, uses \#1 +const Z&& r2 = B(); // OK, uses \#2 +\end{codeblock} +\end{example} \end{itemize} \item From 4596a87af91800a8c9c3e87fdbd11df1c7874819 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 14:25:21 -0700 Subject: [PATCH 109/162] CWG2561 Conversion to function pointer for lambda with explicit object parameter --- source/expressions.tex | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index f259fa68d3..4f5bac0858 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -1903,8 +1903,9 @@ if the lambda has a \grammarterm{template-parameter-list}. \begin{example} \begin{codeblock} -int i = [](int i, auto a) { return i; }(3, 4); // OK, a generic lambda -int j = [](T t, int i) { return i; }(3, 4); // OK, a generic lambda +auto x = [](int i, auto a) { return i; }; // OK, a generic lambda +auto y = [](this auto self, int i) { return i; }; // OK, a generic lambda +auto z = [](int i) { return i; }; // OK, a generic lambda \end{codeblock} \end{example} @@ -2116,6 +2117,7 @@ \pnum The closure type for a non-generic \grammarterm{lambda-expression} with no \grammarterm{lambda-capture} +and no explicit object parameter\iref{dcl.fct} whose constraints (if any) are satisfied has a conversion function to pointer to function with \Cpp{} language linkage\iref{dcl.link} having @@ -2136,7 +2138,9 @@ if the function call operator is an immediate function. \pnum -For a generic lambda with no \grammarterm{lambda-capture}, the closure type has a +For a generic lambda with no \grammarterm{lambda-capture} +and no explicit object parameter\iref{dcl.fct}, +the closure type has a conversion function template to pointer to function. The conversion function template has the same invented template parameter list, and the pointer to function has the same From 0c6f5bc882a70183a9598859e3344355b9a860ec Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 14:47:02 -0700 Subject: [PATCH 110/162] CWG2588 friend declarations and module linkage --- source/basic.tex | 18 ++++++++++++++++++ source/classes.tex | 6 ------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index b7e04d53fb..8307393fbe 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -2746,6 +2746,24 @@ has its linkage determined as follows: \begin{itemize} \item +\indextext{friend function!linkage of}% +if the entity is a function or function template +first declared in a friend declaration and +that declaration is a definition and +the enclosing class is defined within an \grammarterm{export-declaration}, +the name has the same linkage, if any, +as the name of the enclosing class\iref{class.friend}; +\item +otherwise, +\indextext{friend function!linkage of}% +if the entity is a function or function template +declared in a friend declaration and +a corresponding non-friend declaration is reachable, +%FIXME: Which declaration is "that prior declaration"? +%FIXME: "prior" with respect to what? And what about dependent lookup? +the name has the linkage determined from that prior declaration, +\item +otherwise, if the enclosing namespace has internal linkage, the name has internal linkage; \item diff --git a/source/classes.tex b/source/classes.tex index 65b11793d9..3a09dc8bcf 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -4860,12 +4860,6 @@ \end{codeblock} \end{example} -\pnum -\indextext{friend function!linkage of}% -A function first declared in a friend declaration -has the linkage of the namespace of which it is a member\iref{basic.link}. -Otherwise, the function retains its previous linkage\iref{dcl.stc}. - \pnum \indextext{declaration!overloaded name and \tcode{friend}}% \begin{note} From f47cbe4f845248578edece34785123cfc9dba594 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 15:05:35 -0700 Subject: [PATCH 111/162] CWG2728 Evaluation of conversions in a delete-expression --- source/expressions.tex | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 4f5bac0858..2e1b432eb7 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -5780,22 +5780,15 @@ If the operand is of class type, it is contextually implicitly converted\iref{conv} to a pointer to object -type. -\begin{footnote} -This implies that an object -cannot be deleted using a pointer of type -\tcode{\keyword{void}*} because \keyword{void} is not an object type. -\end{footnote} +type +and the converted operand is used in place of the original operand +for the remainder of this subclause. Otherwise, it shall be a prvalue of pointer to object type. The \grammarterm{delete-expression} has type \keyword{void}. \pnum \indextext{\idxcode{delete}!single-object}% -If the operand has a class type, the operand is converted to a pointer -type by calling the above-mentioned conversion function, and the -converted operand is used in place of the original operand for the -remainder of this subclause. In a single-object delete expression, the value of the operand of \keyword{delete} may be a null pointer value, a pointer value @@ -5839,10 +5832,6 @@ expression, if the dynamic type of the object to be deleted is not similar to its static type, the behavior is undefined. -\pnum -The \grammarterm{cast-expression} in a \grammarterm{delete-expression} shall -be evaluated exactly once. - \pnum \indextext{type!incomplete}% If the object being deleted has incomplete class type at the point of From ba8ff838ef25600001485912bc44b8e42640ef12 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 15:22:41 -0700 Subject: [PATCH 112/162] CWG2818 Use of predefined reserved identifiers --- source/lex.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/lex.tex b/source/lex.tex index 8ac924c910..06b753d370 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -899,7 +899,9 @@ \tcode{\unun} \indextext{character!underscore}% or begins with an underscore followed by -an uppercase letter +an uppercase letter, +other than those specified in this document +(for example, \xname{cplusplus}\iref{cpp.predefined}), \indextext{uppercase}% is reserved to the implementation for any use. \item From e242072c2a30741b4bba766a3b52b8ca4667efa5 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 15:42:34 -0700 Subject: [PATCH 113/162] CWG2836 Conversion rank of long double and extended floating-point types --- source/basic.tex | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/basic.tex b/source/basic.tex index 8307393fbe..65174226e5 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -5778,6 +5778,15 @@ An extended floating-point type with the same set of values as more than one cv-unqualified standard floating-point type has a rank equal to the rank of \keyword{double}. +\begin{tailnote} +The treatment of \tcode{std::float64_t} differs from +that of the analoguous \tcode{_Float64} in C, +for example on platforms where all of +\tcode{\keyword{long} \keyword{double}}, +\keyword{double}, and +\tcode{std::float64_t} +have the same set of values (see \IsoCUndated{}:2024 H.4.2). +\end{tailnote} \end{itemize} \begin{note} The conversion ranks of floating-point types \tcode{T1} and \tcode{T2} From 2785faa1e7e42a62c19964e9af36ccc9f5910da8 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 15:51:56 -0700 Subject: [PATCH 114/162] CWG2859 Value-initialization with multiple default constructors --- source/basic.tex | 5 +++-- source/declarations.tex | 13 ++++--------- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 65174226e5..90ccb69b2d 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -3468,9 +3468,10 @@ The \defn{lifetime} of an object or reference is a runtime property of the object or reference. A variable is said to have \defnadj{vacuous}{initialization} -if it is default-initialized and, +if it is default-initialized, no other initialization is performed, and, if it is of class type or a (possibly multidimensional) array thereof, -that class type has a trivial default constructor. +a trivial constructor of that class type is selected for +the default-initialization. The lifetime of an object of type \tcode{T} begins when: \begin{itemize} \item storage with the proper alignment and size diff --git a/source/declarations.tex b/source/declarations.tex index 220d944f1c..0cc463ba5e 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -4629,15 +4629,10 @@ If \tcode{T} is a (possibly cv-qualified) class type\iref{class}, then -\begin{itemize} -\item -if \tcode{T} has -either no default constructor\iref{class.default.ctor} or a default -constructor that is user-provided or deleted, then the object is default-initialized; -\item -otherwise, -the object is zero-initialized and then default-initialized. -\end{itemize} +let \tcode{C} be the constructor selected to +default-initialize the object, if any. +If \tcode{C} is not user-provided, the object is first zero-initialized. +In all cases, the object is then default-initialized. \item If From ac4ca28151478c0b502d486378eca52e9afa992d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 16:08:02 -0700 Subject: [PATCH 115/162] CWG2861 dynamic_cast on bad pointer value --- source/expressions.tex | 36 +++++++++++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 5 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 2e1b432eb7..447058874c 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -1034,16 +1034,26 @@ The pointer value\iref{basic.compound} is unchanged by this conversion. \pnum -A prvalue of type ``pointer to \cv{} \tcode{D}'', where \tcode{D} +A prvalue \tcode{v} of type ``pointer to \cv{} \tcode{D}'', where \tcode{D} is a complete class type, can be converted to a prvalue of type ``pointer to \cv{} \tcode{B}'', where \tcode{B} is a base class\iref{class.derived} of \tcode{D}. If \tcode{B} is an inaccessible\iref{class.access} or ambiguous\iref{class.member.lookup} base class of \tcode{D}, a program -that necessitates this conversion is ill-formed. The result of the -conversion is a pointer to the base class subobject of the derived class -object. The null pointer value is converted to the null pointer value of -the destination type. +that necessitates this conversion is ill-formed. +If \tcode{v} is a null pointer value, +the result is a null pointer value. +Otherwise, +if \tcode{B} is a virtual base class of \tcode{D} and +\tcode{v} does not point to an object +whose type is similar\iref{conv.qual} to \tcode{D} and +that is +within its lifetime or +within its period of construction or destruction\iref{class.cdtor}, +the behavior is undefined. +Otherwise, +the result is a pointer to the base class subobject of +the derived class object. \rSec2[conv.mem]{Pointer-to-member conversions} @@ -3863,6 +3873,22 @@ \pnum If \tcode{v} is a null pointer value, the result is a null pointer value. +\pnum +If \tcode{v} has type ``pointer to \cv{}~\tcode{U}'' and +\tcode{v} does not point to an object +whose type is similar\iref{conv.qual} to \tcode{U} and +that is +within its lifetime or +within its period of construction or destruction\iref{class.cdtor}, +the behavior is undefined. +If \tcode{v} is a glvalue of type \tcode{U} and +\tcode{v} does not refer to an object +whose type is similar to \tcode{U} and +that is +within its lifetime or +within its period of construction or destruction, +the behavior is undefined. + \pnum If \tcode{T} is ``pointer to \cv{} \keyword{void}'', then the result is a pointer to the most derived object pointed to by \tcode{v}. From 6230b303b5327dfae1c85204d5bf844fd92e4021 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 16:13:08 -0700 Subject: [PATCH 116/162] CWG2864 Narrowing floating-point conversions --- source/declarations.tex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index 0cc463ba5e..176da6dc2d 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -6258,10 +6258,9 @@ \item from a floating-point type \tcode{T} to another floating-point type whose floating-point conversion rank is neither greater than nor equal to that of \tcode{T}, -except where the source is a constant expression and -the actual value after conversion -is within the range of values that can be represented (even if it cannot be represented exactly), -or +except where the result of the conversion is a constant expression and +either its value is finite and the conversion did not overflow, or +the values before and after the conversion are not finite, or \item from an integer type or unscoped enumeration type to a floating-point type, except where the source is a constant expression and the actual value after conversion will fit From 3ca9529e76e993c771b3205d3bc149472dc6c68c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 16:26:27 -0700 Subject: [PATCH 117/162] CWG2865 Regression on result of conditional operator --- source/expressions.tex | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 447058874c..63d5c17939 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -7058,13 +7058,18 @@ formed and at least one of the operands has (possibly cv-qualified) class type: \begin{itemize} \item if \tcode{T1} and \tcode{T2} are the same class type -(ignoring cv-qualification) and -\tcode{T2} is at least as cv-qualified as \tcode{T1}, -the target type is \tcode{T2}, +(ignoring cv-qualification): + \begin{itemize} + \item + if \tcode{T2} is at least as cv-qualified as \tcode{T1}, + the target type is \tcode{T2}, + \item + otherwise, no conversion sequence is formed for this operand; + \end{itemize} \item otherwise, if \tcode{T2} is a base class of \tcode{T1}, the target type is \cvqual{cv1} \tcode{T2}, where \cvqual{cv1} -denotes the cv-qualifiers of \tcode{T1}, +denotes the cv-qualifiers of \tcode{T1}; \item otherwise, the target type is the type that \tcode{E2} would have after applying the From f7ee4d7cdd90765e46dc4f2570ed8a8f6cc4c178 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 16:40:31 -0700 Subject: [PATCH 118/162] CWG2867 Order of initialization for structured bindings --- source/basic.tex | 13 +++++++++++-- source/declarations.tex | 4 ++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 90ccb69b2d..7384a23262 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -4495,7 +4495,7 @@ \pnum \indextext{initializer!temporary and declarator}% \indextext{temporary!order of destruction of}% -There are four contexts in which temporaries are destroyed at a different +There are five contexts in which temporaries are destroyed at a different point than the end of the full-expression. The first context is when a default constructor is called to initialize an element of an array with no corresponding initializer\iref{dcl.init}. @@ -4621,6 +4621,14 @@ the object persists for the lifetime of the reference initialized by the \grammarterm{for-range-initializer}. +\pnum +The fifth context is when a temporary object +is created in a structured binding declaration\iref{dcl.struct.bind}. +Any temporary objects introduced by +the \grammarterm{initializer}{s} for the variables +with unique names +are destroyed at the end of the structured binding declaration. + \pnum Let \tcode{x} and \tcode{y} each be either a temporary object whose lifetime is not extended, or @@ -5906,7 +5914,8 @@ \item an immediate invocation\iref{expr.const}, \item -an \grammarterm{init-declarator}\iref{dcl.decl} or +an \grammarterm{init-declarator}\iref{dcl.decl} +(including such introduced by a structured binding\iref{dcl.struct.bind}) or a \grammarterm{mem-initializer}\iref{class.base.init}, including the constituent expressions of the initializer, \item diff --git a/source/declarations.tex b/source/declarations.tex index 176da6dc2d..c1ea8ecf5e 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -7099,6 +7099,10 @@ Each $\tcode{v}_i$ is the name of an lvalue of type $\tcode{T}_i$ that refers to the object bound to $\tcode{r}_i$; the referenced type is $\tcode{T}_i$. +The initialization of \exposid{e} is +sequenced before the initialization of any $\tcode{r}_i$. +The initialization of each $\tcode{r}_i$ is +sequenced before the initialization of any $\tcode{r}_j$ where $i < j$. \pnum Otherwise, From aa46088470764768f9b230c3dfea4d6bc0af7b2c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 16:42:07 -0700 Subject: [PATCH 119/162] CWG2869 this in local classes --- source/expressions.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 63d5c17939..25571be5cf 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -1267,8 +1267,8 @@ between the optional \grammarterm{cv-qualifier-seq} and the end of the \grammarterm{function-definition}, \grammarterm{member-declarator}, or \grammarterm{declarator}. It shall not appear within -the declaration of either -a static member function or an explicit object member function +the declaration of +a static or explicit object member function of the current class (although its type and value category are defined within such member functions as they are within an implicit object member function). From f368144b576d48d5e3fcf37789a748efe1d383c4 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 17:03:09 -0700 Subject: [PATCH 120/162] CWG2870 Combining absent encoding-prefixes --- source/lex.tex | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/source/lex.tex b/source/lex.tex index 06b753d370..cd419e9c25 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -1901,16 +1901,11 @@ \pnum \indextext{concatenation!string}% -The common \grammarterm{encoding-prefix} -for a sequence of adjacent \grammarterm{string-literal}s -is determined pairwise as follows. -If two \grammarterm{string-literal}{s} have -the same \grammarterm{encoding-prefix}, -the common \grammarterm{encoding-prefix} is that \grammarterm{encoding-prefix}. -If one \grammarterm{string-literal} has no \grammarterm{encoding-prefix}, -the common \grammarterm{encoding-prefix} is that -of the other \grammarterm{string-literal}. -Any other combinations are ill-formed. +The \grammarterm{string-literal}{s} in +any sequence of adjacent \grammarterm{string-literal}{s} +shall have at most one unique \grammarterm{encoding-prefix} among them. +The common \grammarterm{encoding-prefix} of the sequence is +that \grammarterm{encoding-prefix}, if any. \begin{note} A \grammarterm{string-literal}'s rawness has no effect on the determination of the common \grammarterm{encoding-prefix}. From f6ab13f4aa801bc4290c65fe69e415ff93a33290 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 17:04:49 -0700 Subject: [PATCH 121/162] CWG2871 User-declared constructor templates inhibiting default constructors --- source/classes.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/classes.tex b/source/classes.tex index 3a09dc8bcf..d5d733168e 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -1217,7 +1217,7 @@ has a default argument (including the case of a constructor with no parameters). \indextext{implicitly-declared default constructor}% -If there is no user-declared constructor for class +If there is no user-declared constructor or constructor template for class \tcode{X}, a non-explicit constructor having no parameters is implicitly declared as defaulted\iref{dcl.fct.def}. From be6efd9ab2e54000327a157a79e6d0d597b97cb3 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 17:10:46 -0700 Subject: [PATCH 122/162] CWG2872 Linkage and unclear "can be referred to" --- source/basic.tex | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 7384a23262..39efb84931 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -2664,28 +2664,18 @@ \pnum \indextext{translation unit}% -A name is said to have \defn{linkage} when it can denote the same -object, reference, function, type, template, namespace or value as a -name introduced by a declaration in another scope: -\begin{itemize} -\item When a name has \defnadj{external}{linkage}, -the entity it denotes -can be referred to by names from scopes of other translation units or -from other scopes of the same translation unit. - -\item When a name has \defnx{module linkage}{linkage!module}, -the entity it denotes -can be referred to by names from other scopes of the same module unit\iref{module.unit} or -from scopes of other module units of that same module. - -\item When a name has \defnadj{internal}{linkage}, -the entity it denotes -can be referred to by names from other scopes in the same translation -unit. - -\item When a name has \indextext{linkage!no}\defn{no linkage}, the entity it denotes -cannot be referred to by names from other scopes. -\end{itemize} +A name can have +\defnadj{external}{linkage}, +\defnadj{module}{linkage}, +\defnadj{internal}{linkage}, or +\defnadj{no}{linkage}, +as determined by the rules below. +\begin{note} +All declarations of an entity with a name with internal linkage +appear in the same translation unit. +All declarations of an entity with module linkage +are attached to the same module. +\end{note} \pnum \indextext{linkage!\idxcode{static} and}% From 4ceed3f0dd7684d32ac486c856a06ebabd4430fa Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 17:15:14 -0700 Subject: [PATCH 123/162] CWG2874 Qualified declarations of partial specializations --- source/declarations.tex | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index c1ea8ecf5e..ef18b66264 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -1512,8 +1512,10 @@ \indextext{name!elaborated!\idxcode{enum}}% If an \grammarterm{elaborated-type-specifier} is the sole constituent of a declaration, the declaration is ill-formed unless it is an explicit -specialization\iref{temp.expl.spec}, an explicit -instantiation\iref{temp.explicit} or it has one of the following +specialization\iref{temp.expl.spec}, +a partial specialization\iref{temp.spec.partial}, +an explicit +instantiation\iref{temp.explicit}, or it has one of the following forms: \begin{ncsimplebnf} @@ -1527,7 +1529,7 @@ The second case shall appear only in an \grammarterm{explicit-specialization}\iref{temp.expl.spec} or in a \grammarterm{template-declaration} -(where it declares a partial specialization\iref{temp.decls}). +(where it declares a partial specialization). The \grammarterm{attribute-specifier-seq}, if any, appertains to the class or template being declared. From 76bf42de579ef21d4bb53f68e4f6cc411806b504 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 17:35:53 -0700 Subject: [PATCH 124/162] CWG2877 Type-only lookup for using-enum-declarator --- source/declarations.tex | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index ef18b66264..8ccb2c8a2c 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -7477,11 +7477,26 @@ \pnum A \grammarterm{using-enum-declarator} names the set of declarations found by -lookup\iref{basic.lookup.unqual,basic.lookup.qual} -for the \grammarterm{using-enum-declarator}. +type-only lookup\iref{basic.lookup.general} +for the \grammarterm{using-enum-declarator}\iref{basic.lookup.unqual,basic.lookup.qual}. The \grammarterm{using-enum-declarator} shall designate a non-dependent type with a reachable \grammarterm{enum-specifier}. +\begin{example} +\begin{codeblock} +enum E { x }; +void f() { + int E; + using enum E; // OK +} +using F = E; +using enum F; // OK +template using EE = T; +void g() { + using enum EE; // OK +} +\end{codeblock} +\end{example} \pnum A \grammarterm{using-enum-declaration} From 0193ee832f025189c4de3913eb80a2a459fa612f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 17:54:25 -0700 Subject: [PATCH 125/162] CWG2881 Type restrictions for the explicit object parameter of a lambda --- source/expressions.tex | 2 +- source/templates.tex | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/source/expressions.tex b/source/expressions.tex index 25571be5cf..78f1191cdd 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -2012,7 +2012,7 @@ \item the closure type, \item -a class type derived from the closure type, or +a class type publicly and unambiguously derived from the closure type, or \item a reference to a possibly cv-qualified such type. \end{itemize} diff --git a/source/templates.tex b/source/templates.tex index 480f6dc0e5..23e8f391db 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -7445,6 +7445,13 @@ Attempting to create a function type in which a parameter has a type of \keyword{void}, or in which the return type is a function type or array type. + +\item +%FIXME: What's it mean to "give" a type "to" a parameter? +%FIXME: See also "Attempting to give an invalid type to ..." above. +Attempting to give to +an explicit object parameter of a lambda's function call operator +a type not permitted for such\iref{expr.prim.lambda.closure}. \end{itemize} \end{note} From 3d5d613a1d43215ca4585047e9c27180b6dd2d54 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 18:03:16 -0700 Subject: [PATCH 126/162] CWG2882 Unclear treatment of conversion to void --- source/expressions.tex | 44 ++++++++++++++++++++---------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 78f1191cdd..7c5ea52169 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -4119,7 +4119,22 @@ a program that necessitates such a cast is ill-formed. \pnum -An expression $E$ can be explicitly converted to a type \tcode{T} +Any expression can be explicitly converted to type \cv{}~\keyword{void}, +in which case the operand is a discarded-value expression\iref{expr.prop}. +\begin{note} +Such a \keyword{static_cast} has no result +as it is a prvalue of type \keyword{void}; see~\ref{basic.lval}. +\end{note} +\begin{note} +However, if the value is in a temporary +object\iref{class.temporary}, the destructor for that +object is +not executed until the usual time, and the value of the object is +preserved for the purpose of executing the destructor. +\end{note} + +\pnum +Otherwise, an expression $E$ can be explicitly converted to a type \tcode{T} if there is an implicit conversion sequence\iref{over.best.ics} from $E$ to \tcode{T}, if overload resolution for a direct-initialization\iref{dcl.init} @@ -4147,28 +4162,8 @@ \end{note} \pnum -Otherwise, the \keyword{static_cast} shall perform one of the conversions -listed below. No other conversion shall be performed explicitly using a -\keyword{static_cast}. - -\pnum -Any expression can be explicitly converted to type \cv{}~\keyword{void}, -in which case the operand is a discarded-value expression\iref{expr.prop}. -\begin{note} -Such a \keyword{static_cast} has no result -as it is a prvalue of type \keyword{void}; see~\ref{basic.lval}. -\end{note} -\begin{note} -However, if the value is in a temporary -object\iref{class.temporary}, the destructor for that -object is -not executed until the usual time, and the value of the object is -preserved for the purpose of executing the destructor. -\end{note} - - -\pnum -The inverse of any standard conversion sequence\iref{conv} not containing an +Otherwise, +the inverse of a standard conversion sequence\iref{conv} not containing an lvalue-to-rvalue\iref{conv.lval}, array-to-pointer\iref{conv.array}, function-to-pointer\iref{conv.func}, @@ -4312,6 +4307,9 @@ \end{codeblock} \end{example} +\pnum +No other conversion can be performed using \keyword{static_cast}. + \rSec3[expr.reinterpret.cast]{Reinterpret cast} \pnum From 7c743294138a1a525aa1b2063dec6f45389c3101 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 18:09:16 -0700 Subject: [PATCH 127/162] CWG2883 Definition of "odr-usable" ignores lambda scopes --- source/basic.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index 39efb84931..b32f410be6 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -511,7 +511,9 @@ either: \begin{itemize} \item the intervening scope is a block scope, or -\item the intervening scope is the function parameter scope of a \grammarterm{lambda-expression} +\item the intervening scope is the function parameter scope of a \grammarterm{lambda-expression}, or +\item the intervening scope is the lambda scope of +a \grammarterm{lambda-expression} that has a \grammarterm{simple-capture} naming the entity or has a \grammarterm{capture-default}, and the block scope of the \grammarterm{lambda-expression} From 56758c0d797a2fbb329622ce6697601d765236ab Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 18:11:57 -0700 Subject: [PATCH 128/162] CWG2886 Temporaries and trivial potentially-throwing special member functions --- source/basic.tex | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index b32f410be6..2062fe0cd1 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -4442,7 +4442,7 @@ \pnum When an object of class type \tcode{X} -is passed to or returned from a function, +is passed to or returned from a potentially-evaluated function call, if \tcode{X} has at least one eligible copy or move constructor\iref{special}, each such constructor is trivial, and the destructor of \tcode{X} is either trivial or deleted, @@ -4465,11 +4465,6 @@ \indextext{temporary!constructor for}% \indextext{temporary!destructor for}% \indextext{temporary!destruction of}% -When an implementation introduces a temporary object of a class that has a -non-trivial constructor\iref{class.default.ctor,class.copy.ctor}, -it shall ensure that a constructor is called for the temporary object. -Similarly, the destructor shall be called for a temporary with a non-trivial -destructor\iref{class.dtor}. Temporary objects are destroyed as the last step in evaluating the full-expression\iref{intro.execution} From 84006114ce2ff8012a740509b409b324b153a17e Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 18:31:52 -0700 Subject: [PATCH 129/162] CWG2887 Missing compatibility entries for xvalues --- source/compatibility.tex | 47 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/source/compatibility.tex b/source/compatibility.tex index 46fb8d7557..77b08b1d8e 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -1997,6 +1997,28 @@ \end{codeblock} \end{example} +\diffref{expr.typeid} +\change +Evaluation of operands in \keyword{typeid}. +\rationale +Introduce additional expression value categories. +\effect +Valid \CppIII{} code that uses xvalues as operands for \keyword{typeid} +may change behavior in this revision of \Cpp{}. +\begin{example} +\begin{codeblock} +void f() { + struct B { + B() {} + virtual ~B() { } + }; + + struct C { B b; }; + typeid(C().b); // unevaluated in \CppIII{}, evaluated in \CppXI{} +} +\end{codeblock} +\end{example} + \diffref{expr.mul} \change Specify rounding for results of integer \tcode{/} and \tcode{\%}. @@ -2023,6 +2045,31 @@ \end{codeblock} \end{example} +\diffref{expr.cond} +\change +Fewer copies in the conditional operator. +\rationale +Introduce additional expression value categories. +\effect +Valid \CppIII{} code that uses xvalues as operands for the conditional operator +may change behavior in this revision of \Cpp{}. +\begin{example} +\begin{codeblock} +void f() { + struct B { + B() {} + B(const B&) { } + }; + struct D : B {}; + + struct BB { B b; }; + struct DD { D d; }; + + true ? BB().b : DD().d; // additional copy in \CppIII{}, no copy or move in \CppXI{} +} +\end{codeblock} +\end{example} + \rSec2[diff.cpp03.dcl.dcl]{\ref{dcl.dcl}: declarations} \diffref{dcl.spec} From f20464dd0d61bcb89346a6fdbd3f1d0d0128cb4b Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 18:59:19 -0700 Subject: [PATCH 130/162] CWG2891 Normative status of implementation limits --- source/intro.tex | 14 ++++++++++---- source/limits.tex | 21 +++++---------------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/source/intro.tex b/source/intro.tex index b50e88eeab..3d3b573b17 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -723,15 +723,14 @@ \item If a program contains no violations of the rules in \ref{lex} through \ref{\lastlibchapter} as well as those specified in \ref{depr}, -a conforming implementation shall, -in accordance with the resource limits specified in \ref{implimits}, -accept and correctly execute +a conforming implementation shall accept and correctly execute \begin{footnote} ``Correct execution'' can include undefined behavior and erroneous behavior, depending on the data being processed; see \ref{intro.defs} and~\ref{intro.execution}. \end{footnote} -that program. +that program, +except when the implementation's limitations (see below) are exceeded. \item \indextext{behavior!undefined}% If a program contains a violation of a rule for which no diagnostic is required, @@ -812,6 +811,13 @@ described in \ref{lex} through \ref{cpp} and the subset of the library facilities described in \ref{compliance}. +\pnum +An implementation is encouraged to document its limitations in +the size or complexity of the programs it can successfully process, +if possible and where known. +\ref{implimits} lists some quantities that can be subject to limitations and +a potential minimum supported value for each quantity. + \pnum A conforming implementation may have extensions (including additional library functions), provided they do not alter the diff --git a/source/limits.tex b/source/limits.tex index ca3953634b..bdc1f3deb6 100644 --- a/source/limits.tex +++ b/source/limits.tex @@ -1,22 +1,11 @@ %!TEX root = std.tex -\normannex{implimits}{Implementation quantities} +\infannex{implimits}{Implementation quantities} \pnum -Because computers are finite, \Cpp{} implementations are inevitably -limited in the size of the programs they can successfully process. -Every implementation shall -document those limitations where known. -This documentation may cite fixed limits where they -exist, say how to compute variable limits as a function -of available resources, or say that fixed limits do not exist -or are unknown. - -\pnum -The following list describes quantities that, among others, may be -constrained by implementations. -The bracketed number following each quantity is recommended -as the minimum for that quantity. -However, these quantities are only guidelines and do not determine compliance. +Implementations can exhibit limitations for various quantities; +some possibilities are presented in the following list. +The bracketed number following each quantity is +a potential minimum value for that quantity. \begin{itemize} \item% Nesting levels of compound statements\iref{stmt.block}, From a09f17d9de5bf32272bc0c266609cf0f3a4907ef Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 19:01:10 -0700 Subject: [PATCH 131/162] CWG2892 Unclear usual arithmetic conversions --- source/expressions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/expressions.tex b/source/expressions.tex index 7c5ea52169..cb20e88395 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -1165,7 +1165,7 @@ the following rules are applied: \begin{itemize} \item -If both operands have the same type, no further conversion is needed. +If both operands have the same type, no further conversion is performed. \item Otherwise, if one of the operands is of a non-floating-point type, that operand is converted to the type of From 8f43f8d31c5b6ab21a70a38620976c0fbdad15e9 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 19:09:57 -0700 Subject: [PATCH 132/162] CWG2895 Initialization should ignore the destination type's cv-qualification --- source/declarations.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index 8ccb2c8a2c..0aeb59b809 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -4705,7 +4705,7 @@ The \indextext{type!destination}% \term{destination type} -is the type of the object or reference being initialized and the +is the cv-unqualified type of the object or reference being initialized and the \term{source type} is the type of the initializer expression. If the initializer is not a single (possibly parenthesized) expression, the @@ -4766,13 +4766,13 @@ is sequenced before those associated with the initialization of the $j^\text{th}$ element. \item -Otherwise, if the destination type is a (possibly cv-qualified) class type: +Otherwise, if the destination type is a class type: \begin{itemize} \item If the initializer expression is a prvalue and the cv-unqualified version of the source type -is the same class as the class of the destination, +is the same as the destination type, the initializer expression is used to initialize the destination object. \begin{example} \tcode{T x = T(T(T()));} value-initializes \tcode{x}. @@ -4780,7 +4780,7 @@ \item Otherwise, if the initialization is direct-initialization, or if it is copy-initialization where the cv-unqualified version of the source -type is the same class as, or a derived class of, the class of the destination, +type is the same as or is derived from the class of the destination type, constructors are considered. The applicable constructors are enumerated\iref{over.match.ctor}, and the best one is chosen @@ -4877,7 +4877,7 @@ the (possibly converted) value of the initializer expression. A standard conversion sequence\iref{conv} is used to convert the initializer expression to -a prvalue of the cv-unqualified version of +a prvalue of the destination type; no user-defined conversions are considered. If the conversion cannot From 911c9220ef4e20f50173056d97c2f482bd300949 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 15:28:50 -0700 Subject: [PATCH 133/162] CWG2819 Cast from null pointer value in a constant expression --- source/expressions.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/expressions.tex b/source/expressions.tex index cb20e88395..0ba2c3483d 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -7625,7 +7625,9 @@ from a prvalue \tcode{P} of type ``pointer to \cv{}~\keyword{void}'' to a type ``\cvqual{cv1} pointer to \tcode{T}'', where \tcode{T} is not \cvqual{cv2}~\keyword{void}, -unless \tcode{P} points to an object whose type is similar to \tcode{T}; +unless \tcode{P} +is a null pointer value or +points to an object whose type is similar to \tcode{T}; \item a \keyword{reinterpret_cast}\iref{expr.reinterpret.cast}; From a586edd27d3233ef6cddd3545805160da583ab2f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 15:44:30 -0700 Subject: [PATCH 134/162] CWG2858 Declarative nested-name-specifiers and pack-index-specifiers --- source/expressions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/expressions.tex b/source/expressions.tex index 0ba2c3483d..33dd7edf88 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -1661,7 +1661,7 @@ a declarative \grammarterm{nested-name-specifier}. \end{itemize} A declarative \grammarterm{nested-name-specifier} -shall not have a \grammarterm{decltype-specifier}. +shall not have a \grammarterm{computed-type-specifier}. A declaration that uses a declarative \grammarterm{nested-name-specifier} shall be a friend declaration or inhabit a scope that contains the entity being redeclared or specialized. From 694b7a7c20cb5a1200df5110515fe7aca1e40ec1 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 17:29:17 -0700 Subject: [PATCH 135/162] CWG2876 Disambiguation of T x = delete("text") Also fixes CWG2144. --- source/declarations.tex | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index 0aeb59b809..1602d6ab3e 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -256,16 +256,29 @@ \end{codeblock} \end{example} +\pnum +\indextext{initialization!definition and}% +An object definition causes +storage of appropriate size and alignment to be reserved and +any appropriate initialization\iref{dcl.init} to be done. + \pnum \indextext{definition!declaration as}% Syntactic components beyond those found in the general form of \grammarterm{simple-declaration} are added to a function declaration to make a -\grammarterm{function-definition}. An object declaration, however, is also -a definition unless it contains the \keyword{extern} specifier and has no -initializer\iref{basic.def}. -\indextext{initialization!definition and}% -An object definition causes storage of appropriate size and alignment to be reserved and -any appropriate initialization\iref{dcl.init} to be done. +\grammarterm{function-definition}. +A token sequence starting with \tcode{\{} or \tcode{=} +is treated as a \grammarterm{function-body}\iref{dcl.fct.def.general} +if the type of the \grammarterm{declarator-id}\iref{dcl.meaning.general} +is a function type, and +is otherwise +treated as a \grammarterm{brace-or-equal-initializer}\iref{dcl.init.general}. +\begin{note} +If the declaration acquires a function type through template instantiation, +the program is ill-formed; see \ref{temp.spec.general}. +The function type of a function definition +cannot be specified with a \grammarterm{typedef-name}\iref{dcl.fct}. +\end{note} \pnum A \grammarterm{nodeclspec-function-declaration} shall declare a From d7a5e0e80f5fdd91ac531162d62a2bf03dfb0b99 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 30 Jun 2024 13:19:12 +0200 Subject: [PATCH 136/162] P2747R2 constexpr placement new --- source/basic.tex | 6 ++++-- source/expressions.tex | 37 +++++++++++++++++++++---------------- source/preprocessor.tex | 2 +- source/support.tex | 9 +++++---- 4 files changed, 31 insertions(+), 23 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 2062fe0cd1..94d00fd25b 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -3437,13 +3437,15 @@ \end{example} \pnum -An operation that begins the lifetime of +Except during constant evaluation, +an operation that begins the lifetime of an array of \tcode{unsigned char} or \tcode{std::byte} implicitly creates objects within the region of storage occupied by the array. \begin{note} The array object provides storage for these objects. \end{note} -Any implicit or explicit invocation of a function +Except during constant evaluation, +any implicit or explicit invocation of a function named \tcode{\keyword{operator} \keyword{new}} or \tcode{\keyword{operator} \keyword{new}[]} implicitly creates objects in the returned region of storage and returns a pointer to a suitable created object. diff --git a/source/expressions.tex b/source/expressions.tex index 33dd7edf88..91090a385c 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -5471,12 +5471,7 @@ \pnum During an evaluation of a constant expression, -a call to an allocation function is always omitted. -\begin{note} -Only \grammarterm{new-expression}{s} that would otherwise result in -a call to a replaceable global allocation function -can be evaluated in constant expressions\iref{expr.const}. -\end{note} +a call to a replaceable allocation function is always omitted\iref{expr.const}. \pnum The implementation may @@ -7645,9 +7640,27 @@ \item a \grammarterm{new-expression}\iref{expr.new}, -unless the selected allocation function is +unless either +\begin{itemize} +\item +the selected allocation function is a replaceable global allocation function\iref{new.delete.single,new.delete.array} and -the allocated storage is deallocated within the evaluation of $E$; +the allocated storage is deallocated within the evaluation of $E$, or +\item +the selected allocation function is +a non-allocating form\iref{new.delete.placement} +with an allocated type \tcode{T}, where +\begin{itemize} +\item +the placement argument to the \grammarterm{new-expression} points to +an object that is pointer-interconvertible with an object of type \tcode{T} or, +if T is an array type, +with the first element of an object of type \tcode{T}, and +\item +the placement argument points to storage +whose duration began within the evaluation of $E$; +\end{itemize} +\end{itemize} \item a \grammarterm{delete-expression}\iref{expr.delete}, @@ -7780,14 +7793,6 @@ the evaluation of the body of a member function of \tcode{std::allocator} as defined in \ref{allocator.members}, where \tcode{T} is a literal type, is ignored. -Similarly, the evaluation of the body of -\tcode{std::construct_at} or -\tcode{std::ranges::construct_at} -is considered to include only -the initialization of the \tcode{T} object -if the first argument (of type \tcode{T*}) points -to storage allocated with \tcode{std::allocator} or -to an object whose lifetime began within the evaluation of $E$. \pnum For the purposes of determining whether $E$ is a core constant expression, diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 920520bbff..1904478912 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -1848,7 +1848,7 @@ \defnxname{cpp_char8_t} & \tcode{202207L} \\ \rowsep \defnxname{cpp_concepts} & \tcode{202002L} \\ \rowsep \defnxname{cpp_conditional_explicit} & \tcode{201806L} \\ \rowsep -\defnxname{cpp_constexpr} & \tcode{202306L} \\ \rowsep +\defnxname{cpp_constexpr} & \tcode{202406L} \\ \rowsep \defnxname{cpp_constexpr_dynamic_alloc} & \tcode{201907L} \\ \rowsep \defnxname{cpp_constexpr_in_decltype} & \tcode{201711L} \\ \rowsep \defnxname{cpp_consteval} & \tcode{202211L} \\ \rowsep diff --git a/source/support.tex b/source/support.tex index ff9103f67c..4090a276d0 100644 --- a/source/support.tex +++ b/source/support.tex @@ -610,6 +610,7 @@ #define @\defnlibxname{cpp_lib_constexpr_functional}@ 201907L // freestanding, also in \libheader{functional} #define @\defnlibxname{cpp_lib_constexpr_iterator}@ 201811L // freestanding, also in \libheader{iterator} #define @\defnlibxname{cpp_lib_constexpr_memory}@ 202202L // freestanding, also in \libheader{memory} +#define @\defnlibxname{cpp_lib_constexpr_new}@ 202406L // freestanding, also in \libheader{new} #define @\defnlibxname{cpp_lib_constexpr_numeric}@ 201911L // also in \libheader{numeric} #define @\defnlibxname{cpp_lib_constexpr_string}@ 201907L // also in \libheader{string} #define @\defnlibxname{cpp_lib_constexpr_string_view}@ 201811L // also in \libheader{string_view} @@ -2302,8 +2303,8 @@ void operator delete[](void* ptr, const std::nothrow_t&) noexcept; void operator delete[](void* ptr, std::align_val_t alignment, const std::nothrow_t&) noexcept; -[[nodiscard]] void* operator new (std::size_t size, void* ptr) noexcept; -[[nodiscard]] void* operator new[](std::size_t size, void* ptr) noexcept; +[[nodiscard]] constexpr void* operator new (std::size_t size, void* ptr) noexcept; +[[nodiscard]] constexpr void* operator new[](std::size_t size, void* ptr) noexcept; void operator delete (void* ptr, void*) noexcept; void operator delete[](void* ptr, void*) noexcept; \end{codeblock} @@ -2836,7 +2837,7 @@ \indexlibrarymember{new}{operator}% \begin{itemdecl} -[[nodiscard]] void* operator new(std::size_t size, void* ptr) noexcept; +[[nodiscard]] constexpr void* operator new(std::size_t size, void* ptr) noexcept; \end{itemdecl} \begin{itemdescr} @@ -2861,7 +2862,7 @@ \indexlibrarymember{new}{operator}% \begin{itemdecl} -[[nodiscard]] void* operator new[](std::size_t size, void* ptr) noexcept; +[[nodiscard]] constexpr void* operator new[](std::size_t size, void* ptr) noexcept; \end{itemdecl} \begin{itemdescr} From cdabb167d9b20904fe5ae286e1528277997e19ca Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Thu, 27 Jun 2024 12:23:36 -0500 Subject: [PATCH 137/162] P3144R2 Deleting a Pointer to an Incomplete Type Should be Ill-formed --- source/compatibility.tex | 20 ++++++++++++++++++++ source/expressions.tex | 5 ++--- 2 files changed, 22 insertions(+), 3 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index 77b08b1d8e..fd90a29804 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -33,6 +33,26 @@ \end{codeblock} \end{example} +\diffref{expr.delete} +\change +Calling \tcode{delete} on a pointer to an incomplete class is ill-formed. +\rationale +Reduce undefined behavior. +\effect +A valid \CppXXIII{} program that that calls \tcode{delete} on an incomplete +class type is ill-formed. +\begin{example} +\begin{codeblock} +struct S; + +void f(S *p) { + delete p; // ill-formed; previously well-formed +} + +struct S {}; +\end{codeblock} +\end{example} + \rSec2[diff.cpp23.dcl.dcl]{\ref{dcl.dcl}: Declarations} \diffref{dcl.init.list} diff --git a/source/expressions.tex b/source/expressions.tex index 91090a385c..ba0cd3f76d 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -5853,9 +5853,8 @@ \pnum \indextext{type!incomplete}% -If the object being deleted has incomplete class type at the point of -deletion and the complete class has a non-trivial destructor or a -deallocation function, the behavior is undefined. +If the object being deleted has incomplete class type at the point of deletion, +the program is ill-formed. \pnum \indextext{\idxcode{delete}!destructor and}% From b5e30c55475f48d342b7236ab6315be10dfcf087 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 30 Jun 2024 16:12:24 +0200 Subject: [PATCH 138/162] P2963R3 Ordering of constraints involving fold expressions --- source/compatibility.tex | 26 +++++++++++ source/templates.tex | 98 ++++++++++++++++++++++++++++++++++++++-- 2 files changed, 119 insertions(+), 5 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index fd90a29804..e5b94d0967 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -96,6 +96,32 @@ \end{codeblock} \end{example} +\rSec2[diff.cpp23.temp]{\ref{temp}: templates} + +\diffref{temp.constr} +\change +Some atomic constraints become fold expanded constraints. +\rationale +Permit the subsumption of fold expressions. +\effect +Valid \CppXXIII{} code may become ill-formed. +\begin{example} +\begin{codeblock} +template struct A; +struct S { + static constexpr int compare(const S&) { return 1; } +}; + +template +void f(A *, A *) +requires (T::compare(U{}) && ...); // was well-formed (atomic constraint of type \tcode{bool}), + // now ill-formed (results in an atomic constraint of type \tcode{int}) +void g(A *ap) { + f(ap, ap); +} +\end{codeblock} +\end{example} + \rSec2[diff.cpp23.library]{\ref{library}: library introduction} \diffref{headers} diff --git a/source/templates.tex b/source/templates.tex index 23e8f391db..b88b4a7b0e 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -1480,11 +1480,12 @@ A \defn{constraint} is a sequence of logical operations and operands that specifies requirements on template arguments. The operands of a logical operation are constraints. -There are three different kinds of constraints: +There are four different kinds of constraints: \begin{itemize} \item conjunctions\iref{temp.constr.op}, -\item disjunctions\iref{temp.constr.op}, and -\item atomic constraints\iref{temp.constr.atomic}. +\item disjunctions\iref{temp.constr.op}, +\item atomic constraints\iref{temp.constr.atomic}, and +\item fold expanded constraints\iref{temp.constr.fold}. \end{itemize} \pnum @@ -1719,6 +1720,47 @@ \end{codeblock} \end{example} +\rSec3[temp.constr.fold]{Fold expanded constraint} + +\pnum +A \defnadj{fold expanded}{constraint} is formed from a constraint $C$ and +a \grammarterm{fold-operator} +which can either be \tcode{\&\&} or \tcode{||}. +A fold expanded constraint is a pack expansion\iref{temp.variadic}. +Let $N$ be the number of elements +in the pack expansion parameters\iref{temp.variadic}. + +\pnum +A fold expanded constraint whose \grammarterm{fold-operator} is \tcode{\&\&} +is satisfied if it is a valid pack expansion and +if $N = 0$ or if for each $i$ where $0 \le i < N$ in increasing order, +$C$ is satisfied +when replacing each pack expansion parameter +with the corresponding $i^\text{th}$ element. +No substitution takes place for any $i$ greater than +the smallest $i$ for which the constraint is not satisfied. + +\pnum +A fold expanded constraint whose \grammarterm{fold-operator} is \tcode{||} +is satisfied if it is a valid pack expansion, +$N > 0$, and if for $i$ where $0 \le i < N$ in increasing order, +there is a smallest $i$ for which $C$ is satisfied +when replacing each pack expansion parameter +with the corresponding $i^\text{th}$ element. +No substitution takes place for any $i$ greater than +the smallest $i$ for which the constraint is satisfied. + +\pnum +\begin{note} +If the pack expansion expands packs of different size, +then it is invalid and the fold expanded constraint is not satisfied. +\end{note} + +\pnum +Two fold expanded constraints are \defnadj{compatible for}{subsumption} +if their respective constraints both contain +an equivalent unexpanded pack\iref{temp.over.link}. + \rSec2[temp.constr.decl]{Constrained declarations} \pnum @@ -1894,6 +1936,40 @@ in the parameter mapping. \end{example} +\item +For a \grammarterm{fold-operator}\iref{expr.prim.fold} +that is either \tcode{\&\&} or \tcode{||}, +the normal form of an expression +\tcode{( ... \grammarterm{fold-operator} E )} is the normal form of +\tcode{( E \grammarterm{fold-operator} ... )}. + +\item +For a \grammarterm{fold-operator} +that is either \tcode{\&\&} or \tcode{||}, +the normal form of an expression +\tcode{( E1 \grammarterm{fold-operator} ... \grammarterm{fold-operator} E2 )} +is the the normal form of +\begin{itemize} +\item +\tcode{( E1 \grammarterm{fold-operator} ... ) \grammarterm{fold-operator} E2} +if \tcode{E1} contains an unexpanded pack, or +\item +\tcode{E1 \grammarterm{fold-operator} ( E2 \grammarterm{fold-operator} ... )} +otherwise. +\end{itemize} + +\item +The normal form of \tcode{( E \&\& ... )} is +a fold expanded constraint\iref{temp.constr.fold} +whose constraint is the normal form of \tcode{E} and +whose \grammarterm{fold-operator} is \tcode{\&\&}. + +\item +The normal form of \tcode{( E || ... )} is +a fold expanded constraint +whose constraint is the normal form of \tcode{E} and +whose \grammarterm{fold-operator} is \tcode{||}. + \item The normal form of any other expression \tcode{E} is the atomic constraint @@ -1971,11 +2047,17 @@ \item a disjunctive clause $P_i$ subsumes a conjunctive clause $Q_j$ if and only if there exists an atomic constraint $P_{ia}$ in $P_i$ for which there exists -an atomic constraint $Q_{jb}$ in $Q_j$ such that $P_{ia}$ subsumes $Q_{jb}$, and +an atomic constraint $Q_{jb}$ in $Q_j$ such that $P_{ia}$ subsumes $Q_{jb}$, \item an atomic constraint $A$ subsumes another atomic constraint $B$ if and only if $A$ and $B$ are identical using the -rules described in \ref{temp.constr.atomic}. +rules described in \ref{temp.constr.atomic}, and + +\item a fold expanded constraint $A$ subsumes +another fold expanded constraint $B$ +if they are compatible for subsumption, +have the same \grammarterm{fold-operator}, and +the constraint of $A$ subsumes that of $B$. \end{itemize} % \begin{example} @@ -2789,6 +2871,9 @@ \item In a \grammarterm{fold-expression}\iref{expr.prim.fold}; the pattern is the \grammarterm{cast-expression} that contains an unexpanded pack. + +\item In a fold expanded constraint\iref{temp.constr.fold}; +the pattern is the constraint of that fold expanded constraint. \end{itemize} \begin{example} @@ -2976,6 +3061,9 @@ \tcode{,} & \tcode{void()} \\ \end{floattable} +\pnum +A fold expanded constraint is not instantiated\iref{temp.constr.fold}. + \pnum The instantiation of any other pack expansion produces a list of elements $\tcode{E}_1, \tcode{E}_2, \dotsc, \tcode{E}_N$. From 3bc3d755fba3c1c8e62088d9d155bd170e0efdd8 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 2 Jul 2024 20:33:40 +0200 Subject: [PATCH 139/162] P0963R3 Structured binding declaration as a condition --- source/declarations.tex | 21 ++++++++++++++++----- source/statements.tex | 34 ++++++++++++++++++++++++---------- 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index 1602d6ab3e..987905fa4c 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -208,7 +208,8 @@ \end{example} \pnum -A \grammarterm{simple-declaration} with a \grammarterm{structured-binding-declaration} is called +A \grammarterm{simple-declaration} or a \grammarterm{condition} +with a \grammarterm{structured-binding-declaration} is called a \defn{structured binding declaration}\iref{dcl.struct.bind}. Each \grammarterm{decl-specifier} in the \grammarterm{decl-specifier-seq} shall be @@ -227,9 +228,13 @@ of the form ``\tcode{=} \grammarterm{assignment-expression}'', of the form ``\tcode{\{} \grammarterm{assignment-expression} \tcode{\}}'', or -of the form ``\tcode{(} \grammarterm{assignment-expression} \tcode{)}'', -where the -\grammarterm{assignment-expression} is of array or non-union class type. +of the form ``\tcode{(} \grammarterm{assignment-expression} \tcode{)}''. +If the \grammarterm{structured-binding-declaration} appears as +a \grammarterm{condition}, +the \grammarterm{assignment-expression} shall be of non-union class type. +Otherwise, +the \grammarterm{assignment-expression} shall be of +array or non-union class type. \pnum If the \grammarterm{decl-specifier-seq} contains the \keyword{typedef} @@ -7051,6 +7056,10 @@ \tcode{E} is never a reference type\iref{expr.prop}. \end{note} +\pnum +If a structured binding declaration appears as a \grammarterm{condition}, +the decision variable\iref{stmt.pre} of the condition is \exposid{e}. + \pnum If the \grammarterm{initializer} refers to one of the names introduced by the structured binding declaration, @@ -7114,7 +7123,9 @@ Each $\tcode{v}_i$ is the name of an lvalue of type $\tcode{T}_i$ that refers to the object bound to $\tcode{r}_i$; the referenced type is $\tcode{T}_i$. -The initialization of \exposid{e} is +The initialization of \exposid{e} and +any conversion of \exposid{e} considered as a decision variable\iref{stmt.pre} +is sequenced before the initialization of any $\tcode{r}_i$. The initialization of each $\tcode{r}_i$ is sequenced before the initialization of any $\tcode{r}_j$ where $i < j$. diff --git a/source/statements.tex b/source/statements.tex index 0d8ae2a439..94f8a6b2e7 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -33,7 +33,8 @@ \begin{bnf} \nontermdef{condition}\br expression\br - \opt{attribute-specifier-seq} decl-specifier-seq declarator brace-or-equal-initializer + \opt{attribute-specifier-seq} decl-specifier-seq declarator brace-or-equal-initializer\br + structured-binding-declaration initializer \end{bnf} The optional \grammarterm{attribute-specifier-seq} appertains to the respective statement. @@ -86,8 +87,12 @@ The rules for \grammarterm{condition}{s} apply both to \grammarterm{selection-statement}{s}\iref{stmt.select} and to the \keyword{for} and \keyword{while} statements\iref{stmt.iter}. -A \grammarterm{condition} that is not an \grammarterm{expression} is a -declaration\iref{dcl.dcl}. +If a \grammarterm{structured-binding-declaration} +appears in a \grammarterm{condition}, +the \grammarterm{condition} is a structured binding declaration\iref{dcl.pre}. +A \grammarterm{condition} that is +neither an \grammarterm{expression} nor a structured binding declaration +is a declaration\iref{dcl.dcl}. The \grammarterm{declarator} shall not specify a function or an array. The \grammarterm{decl-specifier-seq} shall not define a class or enumeration. If the \keyword{auto} \grammarterm{type-specifier} appears in @@ -95,9 +100,16 @@ the type of the identifier being declared is deduced from the initializer as described in~\ref{dcl.spec.auto}. \pnum -The value of a \grammarterm{condition} that is an initialized declaration +The \defnadj{decision}{variable} of a \grammarterm{condition} +that is neither an \grammarterm{expression} nor a structured binding declaration +is the declared variable. +The decision variable of a \grammarterm{condition} +that is a structured binding declaration is specified in \ref{dcl.struct.bind}. + +\pnum +The value of a \grammarterm{condition} that is not an \grammarterm{expression} in a statement other than a \keyword{switch} statement is the value of the -declared variable +decision variable contextually converted to \tcode{bool}\iref{conv}. If that conversion is ill-formed, the program is ill-formed. @@ -116,7 +128,10 @@ it is interpreted as the latter. \pnum -In the \grammarterm{decl-specifier-seq} of a \grammarterm{condition}, each +In the \grammarterm{decl-specifier-seq} of a \grammarterm{condition}, +including that of any \grammarterm{structured-binding-declaration} of +the \grammarterm{condition}, +each \grammarterm{decl-specifier} shall be either a \grammarterm{type-specifier} or \keyword{constexpr}. @@ -408,10 +423,9 @@ several statements depending on the value of a condition. \pnum -The value of a \grammarterm{condition} -that is an initialized declaration -is the value of the declared variable, -or the value of the \grammarterm{expression} otherwise. +If the \grammarterm{condition} is an \grammarterm{expression}, +the value of the condition is the value of the \grammarterm{expression}; +otherwise, it is the value of the decision variable. The value of the condition shall be of integral type, enumeration type, or class type. If of class type, the condition is contextually implicitly converted\iref{conv} to From b3f7a0ceedbc275e9014ba12e994edad20bd7089 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 20:04:02 -0700 Subject: [PATCH 140/162] LWG3944 Formatters converting sequences of char to sequences of wchar_t --- source/utilities.tex | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index 3ab7583ff9..64976ca721 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -17147,11 +17147,27 @@ \end{codeblock} \begin{note} Specializations such as \tcode{formatter} -and \tcode{formatter} that would require implicit multibyte / wide string or character conversion are disabled. \end{note} +\pnum +The header \libheaderdef{format} provides +the following disabled specializations: +\begin{itemize} +\item +The string type specializations +\begin{codeblock} +template<> struct formatter; +template<> struct formatter; +template struct formatter; +template + struct formatter, wchar_t>; +template + struct formatter, wchar_t>; +\end{codeblock} +\end{itemize} + \pnum For any types \tcode{T} and \tcode{charT} for which neither the library nor the user provides From 3e4140354d2ce6f8f9d939682432a8f00bf9a9ab Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 20:16:32 -0700 Subject: [PATCH 141/162] LWG4060 submdspan preconditions do not forbid creating invalid pointer --- source/containers.tex | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 76f5cea891..f0438c0702 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -23392,7 +23392,13 @@ is \tcode{true}. \pnum -Let \tcode{offset} be a value of type \tcode{size_t} equal to +If \tcode{\exposid{first_}(slices...)} +equals \tcode{extents().extent($k$)} +for any rank index $k$ of \tcode{extents()}, then +let \tcode{offset} be a value of type \tcode{size_t} equal to +\tcode{(*this).required_span_size()}. +Otherwise, +let \tcode{offset} be a value of type \tcode{size_t} equal to \tcode{(*this)(\exposid{first_}(slices...)...)}. \rSec5[mdspan.sub.map.left]{\tcode{layout_left} specialization of \tcode{submdspan_mapping}} @@ -23840,9 +23846,9 @@ \effects Equivalent to: \begin{codeblock} -auto sub_map_offset = submdspan_mapping(src.mapping(), slices...); -return mdspan(src.accessor().offset(src.data(), sub_map_offset.offset), - sub_map_offset.mapping, +auto sub_map_result = submdspan_mapping(src.mapping(), slices...); +return mdspan(src.accessor().offset(src.data(), sub_map_result.offset), + sub_map_result.mapping, AccessorPolicy::offset_policy(src.accessor())); \end{codeblock} \end{itemdescr} From 544d2e5fca09fd69f7ad6fdd308c0845a06dd3b9 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 20:18:21 -0700 Subject: [PATCH 142/162] LWG4061 Should std::basic_format_context be default-constructible/copyable/movable? --- source/utilities.tex | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/utilities.tex b/source/utilities.tex index 64976ca721..114bf45db7 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -17620,6 +17620,9 @@ basic_format_args args_; // \expos Out out_; // \expos + basic_format_context(const basic_format_context&) = delete; + basic_format_context& operator=(const basic_format_context&) = delete; + public: using iterator = Out; using char_type = charT; From 66eee9f1a0706cb1a5607ecb07b0d86d6e045afa Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 20:59:15 -0700 Subject: [PATCH 143/162] LWG4071 reference_wrapper comparisons are not SFINAE-friendly --- source/utilities.tex | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 114bf45db7..b081f72890 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -11003,10 +11003,9 @@ friend constexpr bool operator==(reference_wrapper, const T&); friend constexpr bool operator==(reference_wrapper, reference_wrapper); - friend constexpr @\exposidnc{synth-three-way-result}@ operator<=>(reference_wrapper, reference_wrapper); - friend constexpr @\exposidnc{synth-three-way-result}@ operator<=>(reference_wrapper, const T&); - friend constexpr @\exposidnc{synth-three-way-result}@ operator<=>(reference_wrapper, - reference_wrapper); + friend constexpr auto operator<=>(reference_wrapper, reference_wrapper); + friend constexpr auto operator<=>(reference_wrapper, const T&); + friend constexpr auto operator<=>(reference_wrapper, reference_wrapper); }; template @@ -11183,34 +11182,45 @@ \end{itemdescr} \begin{itemdecl} -friend constexpr @\exposidnc{synth-three-way-result}@ operator<=>(reference_wrapper x, reference_wrapper y); +friend constexpr auto operator<=>(reference_wrapper x, reference_wrapper y); \end{itemdecl} \begin{itemdescr} +\pnum +\constraints +The expression \tcode{\exposid{synth-three-way}(x.get(), y.get())} +is well-formed. + \pnum \returns \tcode{\exposid{synth-three-way}(x.get(), y.get())}. \end{itemdescr} \begin{itemdecl} -friend constexpr @\exposidnc{synth-three-way-result}@ operator<=>(reference_wrapper x, const T& y); +friend constexpr auto operator<=>(reference_wrapper x, const T& y); \end{itemdecl} \begin{itemdescr} +\pnum +\constraints +The expression \tcode{\exposid{synth-three-way}(x.get(), y)} +is well-formed. + \pnum \returns \tcode{\exposid{synth-three-way}(x.get(), y)}. \end{itemdescr} \begin{itemdecl} -friend constexpr @\exposidnc{synth-three-way-result}@ operator<=>(reference_wrapper x, - reference_wrapper y); +friend constexpr auto operator<=>(reference_wrapper x, reference_wrapper y); \end{itemdecl} \begin{itemdescr} \pnum \constraints \tcode{is_const_v} is \tcode{false}. +The expression \tcode{\exposid{synth-three-way}(x.get(), y.get())} +is well-formed. \pnum \returns From 686149e4232e281dbff61fb5a1678eb80a807404 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 21:16:32 -0700 Subject: [PATCH 144/162] LWG4074 compatible-joinable-ranges is underconstrained --- source/ranges.tex | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 928d3aa180..2ec8e57d8e 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -334,13 +334,8 @@ namespace views { inline constexpr @\unspecnc@ join = @\unspecnc@; } // freestanding // \ref{range.join.with}, join with view - template - concept @\exposconcept{compatible-joinable-ranges}@ = @\seebelow@; // \expos - template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern> - requires @\libconcept{view}@ && @\libconcept{input_range}@> - && @\libconcept{view}@ - && @\exposconcept{compatible-joinable-ranges}@, Pattern> + requires @\seebelow@ class join_with_view; // freestanding namespace views { inline constexpr @\unspecnc@ join_with = @\unspecnc@; } // freestanding @@ -7023,19 +7018,13 @@ \begin{codeblock} namespace std::ranges { - template - concept @\defexposconcept{compatible-joinable-ranges}@ = // \expos - @\libconcept{common_with}@, range_value_t

> && - @\libconcept{common_reference_with}@, range_reference_t

> && - @\libconcept{common_reference_with}@, range_rvalue_reference_t

>; - template concept @\defexposconcept{bidirectional-common}@ = @\libconcept{bidirectional_range}@ && @\libconcept{common_range}@; // \expos template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern> requires @\libconcept{view}@ && @\libconcept{input_range}@> && @\libconcept{view}@ - && @\exposconcept{compatible-joinable-ranges}@, Pattern> + && @\exposconcept{concatable}@, Pattern> class join_with_view : public view_interface> { using @\exposid{InnerRng}@ = range_reference_t; // \expos @@ -7081,7 +7070,8 @@ requires @\libconcept{forward_range}@ && @\libconcept{forward_range}@ && is_reference_v> && - @\libconcept{input_range}@> { + @\libconcept{input_range}@> && + @\exposconcept{concatable}@, const Pattern> { return @\exposid{iterator}@{*this, ranges::begin(@\exposid{base_}@)}; } @@ -7096,7 +7086,8 @@ constexpr auto end() const requires @\libconcept{forward_range}@ && @\libconcept{forward_range}@ && is_reference_v> && - @\libconcept{input_range}@> { + @\libconcept{input_range}@> && + @\exposconcept{concatable}@, const Pattern> { using InnerConstRng = range_reference_t; if constexpr (@\libconcept{forward_range}@ && @\libconcept{common_range}@ && @\libconcept{common_range}@) @@ -7146,7 +7137,7 @@ namespace std::ranges { template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern> requires @\libconcept{view}@ && @\libconcept{input_range}@> - && @\libconcept{view}@ && @\exposconcept{compatible-joinable-ranges}@, Pattern> + && @\libconcept{view}@ && @\exposconcept{concatable}@, Pattern> template class join_with_view::@\exposid{iterator}@ { using @\exposid{Parent}@ = @\exposid{maybe-const}@; // \expos @@ -7553,7 +7544,7 @@ namespace std::ranges { template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern> requires @\libconcept{view}@ && @\libconcept{input_range}@> - && @\libconcept{view}@ && @\exposconcept{compatible-joinable-ranges}@, Pattern> + && @\libconcept{view}@ && @\exposconcept{concatable}@, Pattern> template class join_with_view::@\exposid{sentinel}@ { using @\exposid{Parent}@ = @\exposid{maybe-const}@; // \expos From 4c263760683a8fa0c15ebd3dfd9bacf03d081eef Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 21:24:41 -0700 Subject: [PATCH 145/162] LWG4076 concat_view should be freestanding --- source/ranges.tex | 4 ++-- source/support.tex | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 2ec8e57d8e..6f840bf49c 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -364,9 +364,9 @@ // \ref{range.concat}, concat view template<@\libconcept{input_range}@... Views> requires @\seebelow@ - class concat_view; + class concat_view; // freestanding - namespace views { inline constexpr @\unspecnc@ concat = @\unspecnc@; } + namespace views { inline constexpr @\unspecnc@ concat = @\unspecnc@; } // freestanding // \ref{range.counted}, counted view namespace views { inline constexpr @\unspecnc@ counted = @\unspecnc@; } // freestanding diff --git a/source/support.tex b/source/support.tex index 4090a276d0..4baa2ac4bd 100644 --- a/source/support.tex +++ b/source/support.tex @@ -738,7 +738,7 @@ #define @\defnlibxname{cpp_lib_ranges_cartesian_product}@ 202207L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_chunk}@ 202202L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_chunk_by}@ 202202L // freestanding, also in \libheader{ranges} -#define @\defnlibxname{cpp_lib_ranges_concat}@ 202403L // also in \libheader{ranges} +#define @\defnlibxname{cpp_lib_ranges_concat}@ 202403L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_contains}@ 202207L // also in \libheader{algorithm} #define @\defnlibxname{cpp_lib_ranges_enumerate}@ 202302L // also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_find_last}@ 202207L // also in \libheader{algorithm} From bd4f125d50760bc61bb2a113fd4ece4c732e2f91 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 21:28:57 -0700 Subject: [PATCH 146/162] LWG4079 Missing Preconditions in concat_view::iterator's conversion constructor --- source/ranges.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/ranges.tex b/source/ranges.tex index 6f840bf49c..22a45af075 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8978,6 +8978,10 @@ \end{itemdecl} \begin{itemdescr} +\pnum +\expects +\tcode{it.\exposid{it_}.valueless_by_exception()} is \tcode{false}. + \pnum \effects Initializes \exposid{parent_} with \tcode{it.\exposid{parent_}}, and From 801c8ca5b5f10b0f25c610c38fc93224a5c5ce11 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 21:32:04 -0700 Subject: [PATCH 147/162] LWG4082 views::concat(r) is well-formed when r is an output_range --- source/ranges.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 22a45af075..b6a4d002f2 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -8474,7 +8474,8 @@ Given a pack of subexpressions \tcode{Es...}, the expression \tcode{views::concat(Es...)} is expression-equivalent to \begin{itemize} -\item \tcode{views::all(Es...)} if \tcode{Es} is a pack with only one element, +\item \tcode{views::all(Es...)} if \tcode{Es} is a pack with only one element +whose type models \libconcept{input_range}, \item otherwise, \tcode{concat_view(Es...)}. \end{itemize} \begin{example} From 78c13cafc8eb33e921b32e95480690f526fe765b Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 21:34:52 -0700 Subject: [PATCH 148/162] LWG4083 views::as_rvalue should reject non-input ranges --- source/ranges.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index b6a4d002f2..140b31c462 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -4515,7 +4515,9 @@ The expression \tcode{views::as_rvalue(E)} is expression-equivalent to: \begin{itemize} \item -\tcode{views::all(E)} if \tcode{\libconcept{same_as}, range_reference_t>} is \tcode{true}. +\tcode{views::all(E)} if +\tcode{T} models \libconcept{input_range} and +\tcode{\libconcept{same_as}, range_reference_t>} is \tcode{true}. \item Otherwise, \tcode{as_rvalue_view(E)}. \end{itemize} From 02ebb0176e5cbb9753ca90ddce0b6f15ef6e3a1c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 21:36:36 -0700 Subject: [PATCH 149/162] LWG4096 views::iota(views::iota(0)) should be rejected --- source/ranges.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 140b31c462..3b2c4e2953 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -2663,7 +2663,8 @@ Given subexpressions \tcode{E} and \tcode{F}, the expressions \tcode{views::iota(E)} and \tcode{views::iota(E, F)} are expression-equivalent to -\tcode{iota_view(E)} and \tcode{iota_view(E, F)}, respectively. +\tcode{iota_view>(E)} and \tcode{iota_view(E, F)}, +respectively. \pnum \begin{example} From 676bce015aff33af8b5c26c55de110d39a68f911 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 21:39:54 -0700 Subject: [PATCH 150/162] LWG4098 views::adjacent<0> should reject non-forward ranges --- source/ranges.tex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 3b2c4e2953..1856ff631c 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -12241,7 +12241,8 @@ \begin{itemize} \item \tcode{((void)E, auto(views::empty>))} -if \tcode{N} is equal to \tcode{0}, +if \tcode{N} is equal to \tcode{0} and +\tcode{decltype((E))} models \libconcept{forward_range}, \item otherwise, \tcode{adjacent_view, N>(E)}. \end{itemize} @@ -12874,7 +12875,8 @@ a constant expression \tcode{N}: \begin{itemize} \item -If \tcode{N} is equal to \tcode{0}, +If \tcode{N} is equal to \tcode{0} and +\tcode{decltype((E))} models \libconcept{forward_range}, \tcode{views::adjacent_transform(E, F)} is expression-equivalent to \tcode{((void)E, views::zip_transform(F))}, except that the evaluations of \tcode{E} and \tcode{F} are From 2f866dface4ada2f2545fdbf9e3005d5f51278ea Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 21:45:54 -0700 Subject: [PATCH 151/162] LWG4105 ranges::ends_with's Returns misses difference casting --- source/algorithms.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index a64ccb1efa..4e6f9028aa 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -4682,7 +4682,8 @@ \returns \tcode{false} if $\tcode{N1} < \tcode{N2}$, otherwise \begin{codeblock} -ranges::equal(views::drop(ranges::ref_view(r1), N1 - N2), r2, pred, proj1, proj2) +ranges::equal(views::drop(ranges::ref_view(r1), N1 - static_cast(N2)), + r2, pred, proj1, proj2) \end{codeblock} \end{itemdescr} From 7b8cb075bfeefc1b448f5d5f3a31f946ebcb951b Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 21:51:03 -0700 Subject: [PATCH 152/162] LWG4106 basic_format_args should not be default-constructible --- source/utilities.tex | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index b081f72890..335b85035a 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -18651,8 +18651,6 @@ const basic_format_arg* data_; // \expos public: - basic_format_args() noexcept; - template basic_format_args(const @\exposid{format-arg-store}@& store) noexcept; @@ -18675,17 +18673,6 @@ and packing the former. \end{note} -\indexlibraryctor{basic_format_args}% -\begin{itemdecl} -basic_format_args() noexcept; -\end{itemdecl} - -\begin{itemdescr} -\pnum -\effects -Initializes \tcode{size_} with \tcode{0}. -\end{itemdescr} - \indexlibraryctor{basic_format_args}% \begin{itemdecl} template From af353a9a9349e0963881b46a30d0477f8b9d300c Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 22:56:34 -0700 Subject: [PATCH 153/162] P2997R1 Removing the common reference requirement from the indirectly invocable concepts --- source/iterators.tex | 14 ++++---------- source/support.tex | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index 754c2632b7..c100843bce 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -2449,7 +2449,6 @@ @\libconcept{copy_constructible}@ && @\libconcept{invocable}@> && @\libconcept{invocable}@> && - @\libconcept{invocable}@> && @\libconcept{common_reference_with}@< invoke_result_t>, invoke_result_t>>; @@ -2460,7 +2459,6 @@ @\libconcept{copy_constructible}@ && @\libconcept{regular_invocable}@> && @\libconcept{regular_invocable}@> && - @\libconcept{regular_invocable}@> && @\libconcept{common_reference_with}@< invoke_result_t>, invoke_result_t>>; @@ -2470,8 +2468,7 @@ @\libconcept{indirectly_readable}@ && @\libconcept{copy_constructible}@ && @\libconcept{predicate}@> && - @\libconcept{predicate}@> && - @\libconcept{predicate}@>; + @\libconcept{predicate}@>; template concept @\deflibconcept{indirect_binary_predicate}@ = @@ -2480,8 +2477,7 @@ @\libconcept{predicate}@, @\exposidnc{indirect-value-t}@> && @\libconcept{predicate}@, iter_reference_t> && @\libconcept{predicate}@, @\exposidnc{indirect-value-t}@> && - @\libconcept{predicate}@, iter_reference_t> && - @\libconcept{predicate}@, iter_common_reference_t>; + @\libconcept{predicate}@, iter_reference_t>; template concept @\deflibconcept{indirect_equivalence_relation}@ = @@ -2490,8 +2486,7 @@ @\libconcept{equivalence_relation}@, @\exposidnc{indirect-value-t}@> && @\libconcept{equivalence_relation}@, iter_reference_t> && @\libconcept{equivalence_relation}@, @\exposidnc{indirect-value-t}@> && - @\libconcept{equivalence_relation}@, iter_reference_t> && - @\libconcept{equivalence_relation}@, iter_common_reference_t>; + @\libconcept{equivalence_relation}@, iter_reference_t>; template concept @\deflibconcept{indirect_strict_weak_order}@ = @@ -2500,8 +2495,7 @@ @\libconcept{strict_weak_order}@, @\exposidnc{indirect-value-t}@> && @\libconcept{strict_weak_order}@, iter_reference_t> && @\libconcept{strict_weak_order}@, @\exposidnc{indirect-value-t}@> && - @\libconcept{strict_weak_order}@, iter_reference_t> && - @\libconcept{strict_weak_order}@, iter_common_reference_t>; + @\libconcept{strict_weak_order}@, iter_reference_t>; } \end{codeblock} diff --git a/source/support.tex b/source/support.tex index 4baa2ac4bd..cfcc7e0a57 100644 --- a/source/support.tex +++ b/source/support.tex @@ -731,7 +731,7 @@ #define @\defnlibxname{cpp_lib_polymorphic_allocator}@ 201902L // also in \libheader{memory_resource} #define @\defnlibxname{cpp_lib_print}@ 202403L // also in \libheader{print}, \libheader{ostream} #define @\defnlibxname{cpp_lib_quoted_string_io}@ 201304L // also in \libheader{iomanip} -#define @\defnlibxname{cpp_lib_ranges}@ 202302L +#define @\defnlibxname{cpp_lib_ranges}@ 202406L // also in \libheader{algorithm}, \libheader{functional}, \libheader{iterator}, \libheader{memory}, \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_as_const}@ 202311L // freestanding, also in \libheader{ranges} #define @\defnlibxname{cpp_lib_ranges_as_rvalue}@ 202207L // freestanding, also in \libheader{ranges} From f367a11a48435eaaa9f058a132f9744bf7076e10 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 23:14:01 -0700 Subject: [PATCH 154/162] P2389R2 dextents Index Type Parameter --- source/containers.tex | 20 ++++++++++++++++++++ source/support.tex | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index f0438c0702..26688a256f 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -19056,6 +19056,10 @@ template using dextents = @\seebelow@; + // \ref{mdspan.extents.dims}, alias template \tcode{dims} + template + using dims = @\seebelow@; + // \ref{mdspan.layout}, layout mapping struct layout_left; struct layout_right; @@ -19514,6 +19518,22 @@ \tcode{E::index_type} denotes \tcode{IndexType}. \end{itemdescr} +\rSec4[mdspan.extents.dims]{Alias template \tcode{dims}} + +\indexlibraryglobal{dims}% +\begin{itemdecl} +template + using dims = @\seebelow@; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\result +A type \tcode{E} that is a specialization of \tcode{extents} +such that \tcode{E::rank() == Rank \&\& E::rank() == E::rank_dynamic()} is \tcode{true}, and +\tcode{E::index_type} denotes \tcode{IndexType}. +\end{itemdescr} + \rSec3[mdspan.layout]{Layout mapping} \rSec4[mdspan.layout.general]{General} diff --git a/source/support.tex b/source/support.tex index cfcc7e0a57..f7a76d7893 100644 --- a/source/support.tex +++ b/source/support.tex @@ -713,7 +713,7 @@ #define @\defnlibxname{cpp_lib_map_try_emplace}@ 201411L // also in \libheader{map} #define @\defnlibxname{cpp_lib_math_constants}@ 201907L // also in \libheader{numbers} #define @\defnlibxname{cpp_lib_math_special_functions}@ 201603L // also in \libheader{cmath} -#define @\defnlibxname{cpp_lib_mdspan}@ 202207L // also in \libheader{mdspan} +#define @\defnlibxname{cpp_lib_mdspan}@ 202406L // also in \libheader{mdspan} #define @\defnlibxname{cpp_lib_memory_resource}@ 201603L // also in \libheader{memory_resource} #define @\defnlibxname{cpp_lib_modules}@ 202207L // freestanding #define @\defnlibxname{cpp_lib_move_iterator_concept}@ 202207L // freestanding, also in \libheader{iterator} From ebbe8c009771d397c6f548a871ed1868fcd84f24 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 2 Jul 2024 00:12:08 -0700 Subject: [PATCH 155/162] P3168R2 Give std::optional Range Support --- source/support.tex | 1 + source/utilities.tex | 68 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/source/support.tex b/source/support.tex index f7a76d7893..104c414a58 100644 --- a/source/support.tex +++ b/source/support.tex @@ -726,6 +726,7 @@ #define @\defnlibxname{cpp_lib_not_fn}@ 202306L // freestanding, also in \libheader{functional} #define @\defnlibxname{cpp_lib_null_iterators}@ 201304L // freestanding, also in \libheader{iterator} #define @\defnlibxname{cpp_lib_optional}@ 202110L // also in \libheader{optional} +#define @\defnlibxname{cpp_lib_optional_range_support}@ 202406L // freestanding, also in \libheader{optional} #define @\defnlibxname{cpp_lib_out_ptr}@ 202311L // freestanding, also in \libheader{memory} #define @\defnlibxname{cpp_lib_parallel_algorithm}@ 201603L // also in \libheader{algorithm}, \libheader{numeric} #define @\defnlibxname{cpp_lib_polymorphic_allocator}@ 201902L // also in \libheader{memory_resource} diff --git a/source/utilities.tex b/source/utilities.tex index 335b85035a..fcbb038a43 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -3168,6 +3168,11 @@ template class optional; // partially freestanding + template + constexpr bool ranges::enable_view> = true; + template + constexpr auto format_kind> = range_format::disabled; + template concept @\defexposconcept{is-derived-from-optional}@ = requires(const T& t) { // \expos [](const optional&){ }(t); @@ -3248,7 +3253,9 @@ template class optional { public: - using value_type = T; + using value_type = T; + using iterator = @\impdefnc@; // see~\ref{optional.iterators} + using const_iterator = @\impdefnc@; // see~\ref{optional.iterators} // \ref{optional.ctor}, constructors constexpr optional() noexcept; @@ -3282,6 +3289,12 @@ // \ref{optional.swap}, swap constexpr void swap(optional&) noexcept(@\seebelow@); + // \ref{optional.iterators}, iterator support + constexpr iterator begin() noexcept; + constexpr const_iterator begin() const noexcept; + constexpr iterator end() noexcept; + constexpr const_iterator end() const noexcept; + // \ref{optional.observe}, observers constexpr const T* operator->() const noexcept; constexpr T* operator->() noexcept; @@ -4001,6 +4014,59 @@ the state of \tcode{*val} and \tcode{*rhs.val} is determined by the exception safety guarantee of \tcode{T}'s move constructor. \end{itemdescr} +\rSec3[optional.iterators]{Iterator support} + +\indexlibrarymember{iterator}{optional}% +\indexlibrarymember{const_iterator}{optional}% +\begin{itemdecl} +using iterator = @\impdef@; +using const_iterator = @\impdef@; +\end{itemdecl} + +\begin{itemdescr} +\pnum +These types +model \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}, +meet the \oldconcept{RandomAccessIterator} requirements\iref{random.access.iterators}, and +meet the requirements for constexpr iterators\iref{iterator.requirements.general}, +with value type \tcode{remove_cv_t}. +The reference type is \tcode{T\&} for \tcode{iterator} and +\tcode{const T\&} for \tcode{const_iterator}. + +\pnum +All requirements on container iterators\iref{container.reqmts} apply to +\tcode{optional::iterator} and \tcode{optional::\linebreak{}const_iterator} as well. + +\pnum +Any operation that initializes or destroys the contained value of an optional object invalidates all iterators into that object. +\end{itemdescr} + +\indexlibrarymember{begin}{optional}% +\begin{itemdecl} +constexpr iterator begin() noexcept; +constexpr const_iterator begin() const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +If \tcode{has_value()} is \tcode{true}, +an iterator referring to the contained value. +Otherwise, a past-the-end iterator value. +\end{itemdescr} + +\indexlibrarymember{end}{optional}% +\begin{itemdecl} +constexpr iterator end() noexcept; +constexpr const_iterator end() const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +\tcode{begin() + has_value()}. +\end{itemdescr} + \rSec3[optional.observe]{Observers} \indexlibrarymember{operator->}{optional}% From 16c3fc4fd7a4de08df88a038907d9aae0c5833a7 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 2 Jul 2024 00:25:32 -0700 Subject: [PATCH 156/162] P3217R0 Adjoints to "Enabling list-initialization for algorithms": find_last --- source/algorithms.tex | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 4e6f9028aa..e0522cf917 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -3766,10 +3766,12 @@ \indexlibraryglobal{find_last}% \begin{itemdecl} -template<@\libconcept{forward_iterator}@ I, @\libconcept{sentinel_for}@ S, class T, class Proj = identity> +template<@\libconcept{forward_iterator}@ I, @\libconcept{sentinel_for}@ S, class Proj = identity, + class T = projected_value_t> requires @\libconcept{indirect_binary_predicate}@, const T*> constexpr subrange ranges::find_last(I first, S last, const T& value, Proj proj = {}); -template<@\libconcept{forward_range}@ R, class T, class Proj = identity> +template<@\libconcept{forward_range}@ R, class Proj = identity, + class T = projected_value_t, Proj>> requires @\libconcept{indirect_binary_predicate}@, Proj>, const T*> constexpr borrowed_subrange_t ranges::find_last(R&& r, const T& value, Proj proj = {}); template<@\libconcept{forward_iterator}@ I, @\libconcept{sentinel_for}@ S, class Proj = identity, From e2833bb1d45a8005dfbbbae522f82dcba5c012af Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 2 Jul 2024 01:02:45 -0700 Subject: [PATCH 157/162] P2985R0 A type trait for detecting virtual base classes --- source/meta.tex | 25 ++++++++++++++++++++++--- source/support.tex | 1 + 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/source/meta.tex b/source/meta.tex index 139eddb0df..d791342bbc 100644 --- a/source/meta.tex +++ b/source/meta.tex @@ -262,6 +262,7 @@ // \ref{meta.rel}, type relations template struct is_same; template struct is_base_of; + template struct is_virtual_base_of; template struct is_convertible; template struct is_nothrow_convertible; template struct is_layout_compatible; @@ -548,6 +549,8 @@ constexpr bool @\libglobal{is_same_v}@ = is_same::value; template constexpr bool @\libglobal{is_base_of_v}@ = is_base_of::value; + template + constexpr bool @\libglobal{is_virtual_base_of_v}@ = is_virtual_base_of::value; template constexpr bool @\libglobal{is_convertible_v}@ = is_convertible::value; template @@ -1463,15 +1466,31 @@ without regard to cv-qualifiers & If \tcode{Base} and \tcode{Derived} are non-union class types and are -not (possibly cv-qualified versions of) the same type, + not (possibly cv-qualified versions of) the same type, \tcode{Derived} shall be a complete type. \begin{tailnote} -Base classes that are private, protected, or ambiguous + Base classes that are private, protected, or ambiguous are, nonetheless, base classes. \end{tailnote} \\ \rowsep +\indexlibraryglobal{is_virtual_base_of}% +\tcode{template}\br + \tcode{struct is_virtual_base_of;} & + \tcode{Base} is a virtual base class of \tcode{Derived}\iref{class.mi} + without regard to cv-qualifiers. & + If \tcode{Base} and + \tcode{Derived} are non-union class types, + \tcode{Derived} shall be a complete type. + \begin{note} + Virtual base classes that are private, protected, or ambiguous + are, nonetheless, virtual base classes. + \end{note} + \begin{tailnote} + A class is never a virtual base class of itself. + \end{tailnote} \\ \rowsep + \indexlibraryglobal{is_convertible}% \tcode{template}\br \tcode{struct is_convertible;} & @@ -1486,7 +1505,7 @@ the conversion, as defined by \tcode{is_convertible}, is known not to throw any exceptions\iref{expr.unary.noexcept} & \tcode{From} and \tcode{To} shall be complete types, - \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep + \cv{}~\keyword{void}, or arrays of unknown bound. \\ \rowsep \indexlibraryglobal{is_layout_compatible}% \tcode{template}\br diff --git a/source/support.tex b/source/support.tex index 104c414a58..b04d57545b 100644 --- a/source/support.tex +++ b/source/support.tex @@ -700,6 +700,7 @@ #define @\defnlibxname{cpp_lib_is_pointer_interconvertible}@ 201907L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_scoped_enum}@ 202011L // freestanding, also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_swappable}@ 201603L // freestanding, also in \libheader{type_traits} +#define @\defnlibxname{cpp_lib_is_virtual_base_of}@ 202406L // also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_is_within_lifetime}@ 202306L // also in \libheader{type_traits} #define @\defnlibxname{cpp_lib_jthread}@ 201911L // also in \libheader{stop_token}, \libheader{thread} #define @\defnlibxname{cpp_lib_latch}@ 201907L // also in \libheader{latch} From 5add45b4198d76e8a86aced53e44b18e13b30e41 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 2 Jul 2024 16:28:21 -0700 Subject: [PATCH 158/162] P0843R14 inplace_vector Editorial notes: * The wording in the paper is based on an old draft, and several intervening changes had to be incorporated into the application. * Specifically, Note 1 in [sequence.reqmts] no longer exists (and thus does not get updated). * Stable labels named [containers.sequences.inplace.vector.*] renamed to [inplace.vector.*]. * [inplace.vector.modifiers] Add comma for clarity. * [inplace.vector] Minor editorial fixes (e.g. add missing "the"). * [inplace.vector.overview] Fix punctuation in bulleted sub-list to be consistent. --- source/compatibility.tex | 1 + source/containers.tex | 729 ++++++++++++++++++++++++++++++++++++++- source/iterators.tex | 1 + source/lib-intro.tex | 4 +- source/support.tex | 1 + 5 files changed, 717 insertions(+), 19 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index e5b94d0967..44052918b0 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -133,6 +133,7 @@ The following \Cpp{} headers are new: \libheaderref{debugging}, \libheaderrefx{hazard_pointer}{hazard.pointer.syn}, +\libheaderrefx{inplace_vector}{inplace.vector.syn}, \libheaderref{linalg}, \libheaderref{rcu}, and \libheaderrefx{text_encoding}{text.encoding.syn}. diff --git a/source/containers.tex b/source/containers.tex index 26688a256f..0baca3355c 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -20,6 +20,7 @@ \ref{container.requirements} & Requirements & \\ \rowsep \ref{sequences} & Sequence containers & \tcode{}, \tcode{}, \tcode{}, + \tcode{}, \\ & & \tcode{}, \tcode{} \\ \rowsep \ref{associative} & Associative containers & \tcode{}, \tcode{} \\ \rowsep @@ -262,7 +263,7 @@ \pnum \complexity -Linear for \tcode{array} and constant for all other standard containers. +Linear for \tcode{array} and \tcode{inplace_vector} and constant for all other standard containers. \end{itemdescr} \indexcont{operator=}% @@ -479,7 +480,8 @@ \pnum \complexity -Linear for \tcode{array} and constant for all other standard containers. +Linear for \tcode{array} and \tcode{inplace_vector}, and +constant for all other standard containers. \end{itemdescr} \begin{itemdecl} @@ -617,7 +619,8 @@ \pnum The expression \tcode{a.swap(b)}, for containers \tcode{a} and \tcode{b} of a standard -container type other than \tcode{array}, shall exchange the values of \tcode{a} and +container type other than \tcode{array} and \tcode{inplace_vector}, +shall exchange the values of \tcode{a} and \tcode{b} without invoking any move, copy, or swap operations on the individual container elements. Any \tcode{Compare}, \tcode{Pred}, or \tcode{Hash} types @@ -637,7 +640,7 @@ swap. \pnum -Unless otherwise specified (see~\ref{associative.reqmts.except}, \ref{unord.req.except}, \ref{deque.modifiers}, and +Unless otherwise specified (see~\ref{associative.reqmts.except}, \ref{unord.req.except}, \ref{deque.modifiers}, \ref{inplace.vector.modifiers}, and \ref{vector.modifiers}) all container types defined in this Clause meet the following additional requirements: @@ -908,7 +911,8 @@ \rSec3[container.alloc.reqmts]{Allocator-aware containers} \pnum -Except for \tcode{array}, all of the containers defined in \ref{containers}, +Except for \tcode{array} and \tcode{inplace_vector}, +all of the containers defined in \ref{containers}, \ref{stacktrace.basic}, \ref{basic.string}, and \ref{re.results} meet the additional requirements of an \defnadj{allocator-aware}{container}, as described below. @@ -1263,8 +1267,10 @@ \pnum A sequence container organizes a finite set of objects, all of the same type, into a strictly -linear arrangement. The library provides four basic kinds of sequence containers: -\tcode{vector}, \tcode{forward_list}, \tcode{list}, and \tcode{deque}. In addition, +linear arrangement. The library provides the following basic kinds of sequence containers: +\tcode{vector}, \tcode{inplace_vector}, +\tcode{forward_list}, \tcode{list}, and \tcode{deque}. +In addition, \tcode{array} is provided as a sequence container which provides limited sequence operations because it has a fixed number of elements. The library also provides container adaptors that make it easy to construct abstract data types, @@ -1481,7 +1487,7 @@ \pnum \expects \tcode{T} is \oldconcept{CopyInsertable} into \tcode{X}. -For \tcode{vector} and \tcode{deque}, +For \tcode{vector}, \tcode{inplace_vector}, and \tcode{deque}, \tcode{T} is also \oldconcept{CopyAssignable}. \pnum @@ -1505,7 +1511,7 @@ \pnum \expects \tcode{T} is \oldconcept{MoveInsertable} into \tcode{X}. -For \tcode{vector} and \tcode{deque}, +For \tcode{vector}, \tcode{inplace_vector}, and \tcode{deque}, \tcode{T} is also \oldconcept{MoveAssignable}. \pnum @@ -1554,12 +1560,12 @@ \pnum \expects \tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*i}. -For \tcode{vector} and \tcode{deque}, +For \tcode{vector}, \tcode{inplace_vector}, and \tcode{deque}, \tcode{T} is also \oldconcept{MoveInsertable} into \tcode{X}, and \tcode{T} meets the \oldconcept{MoveConstructible}, -\oldconcept{MoveAssignable}, and +\oldconcept{MoveAs\-signable}, and \oldconcept{Swappable}\iref{swappable.requirements} requirements. Neither \tcode{i} nor \tcode{j} are iterators into \tcode{a}. @@ -1589,12 +1595,12 @@ \expects \tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{*ranges::begin(rg)}. -For \tcode{vector} and \tcode{deque}, +For \tcode{vector}, \tcode{inplace_vector}, and \tcode{deque}, \tcode{T} is also \oldconcept{MoveInsertable} into \tcode{X}, and \tcode{T} meets the -\oldconcept{MoveConstructible}, -\oldconcept{Move\-Assignable}, and +\oldconcept{Move\-Constructible}, +\oldconcept{MoveAssignable}, and \oldconcept{Swappable}\iref{swappable.requirements} requirements. \tcode{rg} and \tcode{a} do not overlap. @@ -1632,7 +1638,7 @@ \pnum \expects -For \tcode{vector} and \tcode{deque}, +For \tcode{vector}, \tcode{inplace_vector}, and \tcode{deque}, \tcode{T} is \oldconcept{MoveAssignable}. \pnum @@ -1657,7 +1663,8 @@ \pnum \expects -For \tcode{vector} and \tcode{deque}, \tcode{T} is \oldconcept{MoveAssignable}. +For \tcode{vector}, \tcode{inplace_vector}, and \tcode{deque}, +\tcode{T} is \oldconcept{MoveAssignable}. \pnum \effects @@ -1858,6 +1865,7 @@ \tcode{array}, \tcode{deque}, \tcode{forward_list}, +\tcode{inplace_vector}, \tcode{list}, and \tcode{vector}. \end{itemdescr} @@ -1886,6 +1894,7 @@ \tcode{basic_string}, \tcode{array}, \tcode{deque}, +\tcode{inplace_vector}, \tcode{list}, and \tcode{vector}. \end{itemdescr} @@ -1948,6 +1957,7 @@ \remarks Required for \tcode{deque}, +\tcode{inplace_vector}, \tcode{list}, and \tcode{vector}. \end{itemdescr} @@ -2060,6 +2070,7 @@ Required for \tcode{basic_string}, \tcode{deque}, +\tcode{inplace_vector}, \tcode{list}, and \tcode{vector}. \end{itemdescr} @@ -2086,6 +2097,7 @@ Required for \tcode{basic_string}, \tcode{deque}, +\tcode{inplace_vector}, \tcode{list}, and \tcode{vector}. \end{itemdescr} @@ -2116,6 +2128,7 @@ \remarks Required for \tcode{deque}, +\tcode{inplace_vector}, \tcode{list}, and \tcode{vector}. \end{itemdescr} @@ -2167,6 +2180,7 @@ Required for \tcode{basic_string}, \tcode{deque}, +\tcode{inplace_vector}, \tcode{list}, and \tcode{vector}. \end{itemdescr} @@ -2189,7 +2203,8 @@ Required for \tcode{basic_string}, \tcode{array}, -\tcode{deque}, and +\tcode{deque}, +\tcode{inplace_vector}, and \tcode{vector}. \end{itemdescr} @@ -2215,7 +2230,8 @@ Required for \tcode{basic_string}, \tcode{array}, -\tcode{deque}, and +\tcode{deque}, +\tcode{inplace_vector}, and \tcode{vector}. \end{itemdescr} @@ -5959,6 +5975,7 @@ \libheaderref{array}, \libheaderref{deque}, \libheaderrefx{forward_list}{forward.list.syn}, +\libheaderrefx{inplace_vector}{inplace.vector.syn}, \libheaderref{list}, and \libheaderref{vector} define class templates that meet the requirements for sequence containers. @@ -6177,6 +6194,28 @@ } \end{codeblock} +\rSec2[inplace.vector.syn]{Header \tcode{} synopsis} + +\indexheader{inplace_vector}% +\begin{codeblock} +// mostly freestanding +#include // see \ref{compare.syn} +#include // see \ref{initializer.list.syn} + +namespace std { + // \ref{inplace.vector}, class template \tcode{inplace_vector} + template class inplace_vector; // partially freestanding + + // \ref{inplace.vector.erasure}, erasure + template + constexpr typename inplace_vector::size_type + erase(inplace_vector& c, const U& value); + template + constexpr typename inplace_vector::size_type + erase_if(inplace_vector& c, Predicate pred); +} +\end{codeblock} + \rSec2[array]{Class template \tcode{array}} \indexlibraryglobal{array}% @@ -9452,6 +9491,659 @@ Equivalent to: \tcode{return \exposid{underlying_}.format(ref, ctx);} \end{itemdescr} +\rSec2[inplace.vector]{Class template \tcode{inplace_vector}} + +\rSec3[inplace.vector.overview]{Overview} + +\pnum +\indexlibraryglobal{inplace_vector}% +An \tcode{inplace_vector} is a contiguous container. +Its capacity is fixed and +its elements are stored within the \tcode{inplace_vector} object itself. + +\pnum +An \tcode{inplace_vector} meets all of the requirements +of a container\iref{container.reqmts}, +of a reversible container\iref{container.rev.reqmts}, +of a contiguous container, and +of a sequence container, +including most of the optional sequence container requirements\iref{sequence.reqmts}. +The exceptions are the +\tcode{push_front}, +\tcode{prepend_range}, +\tcode{pop_front}, and +\tcode{emplace_front} +member functions, which are not provided. +Descriptions are provided here only +for operations on \tcode{inplace_vector} that +are not described in one of these tables or +for operations where there is additional semantic information. + +\pnum +For any \tcode{N}, +\tcode{inplace_vector::iterator} and +\tcode{inplace_vector::const_iterator} +meet the constexpr iterator requirements. + +\pnum +For any $\tcode{N} > 0$, +if \tcode{is_trivial_v} is \tcode{false}, then +no \tcode{inplace_vector} member functions +are usable in constant expressions. + +\pnum +Any member function of \tcode{inplace_vector} that +would cause the size to exceed \tcode{N} +throws an exception of type \tcode{bad_alloc}. + +\pnum +Let \tcode{IV} denote a specialization of \tcode{inplace_vector}. +If \tcode{N} is zero, then +\tcode{IV} is both trivial and empty. +Otherwise: +\begin{itemize} +\item +If \tcode{is_trivially_copy_constructible_v} is \tcode{true}, then +\tcode{IV} has a trivial copy constructor. +\item +If \tcode{is_trivially_move_constructible_v} is \tcode{true}, then +\tcode{IV} has a trivial move constructor. +\item +If \tcode{is_trivially_destructible_v} is \tcode{true}, then: + \begin{itemize} + \item + \tcode{IV} has a trivial destructor. + \item + If +\begin{codeblock} + is_trivially_copy_constructible_v && is_trivially_copy_assignable_v +\end{codeblock} + is \tcode{true}, then + \tcode{IV} has a trivial copy assignment operator. + \item + If +\begin{codeblock} + is_trivially_move_constructible_v && is_trivially_move_assignable_v +\end{codeblock} + is \tcode{true}, then + \tcode{IV} has a trivial move assignment operator. + \end{itemize} +\end{itemize} + +\begin{codeblock} +namespace std { + template + class inplace_vector { + public: + // types: + using value_type = T; + using pointer = T*; + using const_pointer = const T*; + using reference = value_type&; + using const_reference = const value_type&; + using size_type = size_t; + using difference_type = ptrdiff_t; + using iterator = @\impdefx{type of \tcode{inplace_vector::iterator}}@; // see \ref{container.requirements} + using const_iterator = @\impdefx{type of \tcode{inplace_vector::const_iterator}}@; // see \ref{container.requirements} + using reverse_iterator = std::reverse_iterator; + using const_reverse_iterator = std::reverse_iterator; + + // \ref{inplace.vector.cons}, construct/copy/destroy + constexpr inplace_vector() noexcept; + constexpr explicit inplace_vector(size_type n); // freestanding-deleted + constexpr inplace_vector(size_type n, const T& value); // freestanding-deleted + template + constexpr inplace_vector(InputIterator first, InputIterator last); // freestanding-deleted + template<@\exposconcept{container-compatible-range}@ R> + constexpr inplace_vector(from_range_t, R&& rg); // freestanding-deleted + constexpr inplace_vector(const inplace_vector&); + constexpr inplace_vector(inplace_vector&&) + noexcept(N == 0 || is_nothrow_move_constructible_v); + constexpr inplace_vector(initializer_list il); // freestanding-deleted + constexpr ~inplace_vector(); + constexpr inplace_vector& operator=(const inplace_vector& other); + constexpr inplace_vector& operator=(inplace_vector&& other) + noexcept(N == 0 || (is_nothrow_move_assignable_v && + is_nothrow_move_constructible_v)); + constexpr inplace_vector& operator=(initializer_list); // freestanding-deleted + template + constexpr void assign(InputIterator first, InputIterator last); // freestanding-deleted + template<@\exposconcept{container-compatible-range}@ R> + constexpr void assign_range(R&& rg); // freestanding-deleted + constexpr void assign(size_type n, const T& u); // freestanding-deleted + constexpr void assign(initializer_list il); // freestanding-deleted + + // iterators + constexpr iterator begin() noexcept; + constexpr const_iterator begin() const noexcept; + constexpr iterator end() noexcept; + constexpr const_iterator end() const noexcept; + constexpr reverse_iterator rbegin() noexcept; + constexpr const_reverse_iterator rbegin() const noexcept; + constexpr reverse_iterator rend() noexcept; + constexpr const_reverse_iterator rend() const noexcept; + + constexpr const_iterator cbegin() const noexcept; + constexpr const_iterator cend() const noexcept; + constexpr const_reverse_iterator crbegin() const noexcept; + constexpr const_reverse_iterator crend() const noexcept; + + // \ref{inplace.vector.capacity} size/capacity + constexpr bool empty() const noexcept; + constexpr size_type size() const noexcept; + static constexpr size_type max_size() noexcept; + static constexpr size_type capacity() noexcept; + constexpr void resize(size_type sz); // freestanding-deleted + constexpr void resize(size_type sz, const T& c); // freestanding-deleted + static constexpr void reserve(size_type n); // freestanding-deleted + static constexpr void shrink_to_fit() noexcept; + + // element access + constexpr reference operator[](size_type n); + constexpr const_reference operator[](size_type n) const; + constexpr reference at(size_type n); // freestanding-deleted + constexpr const_reference at(size_type n) const; // freestanding-deleted + constexpr reference front(); + constexpr const_reference front() const; + constexpr reference back(); + constexpr const_reference back() const; + + // \ref{inplace.vector.data}, data access + constexpr T* data() noexcept; + constexpr const T* data() const noexcept; + + // \ref{inplace.vector.modifiers}, modifiers + template + constexpr reference emplace_back(Args&&... args); // freestanding-deleted + constexpr reference push_back(const T& x); // freestanding-deleted + constexpr reference push_back(T&& x); // freestanding-deleted + template<@\exposconcept{container-compatible-range}@ R> + constexpr void append_range(R&& rg); // freestanding-deleted + constexpr void pop_back(); + + template + constexpr pointer try_emplace_back(Args&&... args); + constexpr pointer try_push_back(const T& x); + constexpr pointer try_push_back(T&& x); + template<@\exposconcept{container-compatible-range}@ R> + constexpr ranges::borrowed_iterator_t try_append_range(R&& rg); + + template + constexpr reference unchecked_emplace_back(Args&&... args); + constexpr reference unchecked_push_back(const T& x); + constexpr reference unchecked_push_back(T&& x); + + template + constexpr iterator emplace(const_iterator position, Args&&... args); // freestanding-deleted + constexpr iterator insert(const_iterator position, const T& x); // freestanding-deleted + constexpr iterator insert(const_iterator position, T&& x); // freestanding-deleted + constexpr iterator insert(const_iterator position, size_type n, // freestanding-deleted + const T& x); + template + constexpr iterator insert(const_iterator position, // freestanding-deleted + InputIterator first, InputIterator last); + template<@\exposconcept{container-compatible-range}@ R> + constexpr iterator insert_range(const_iterator position, R&& rg); // freestanding-deleted + constexpr iterator insert(const_iterator position, // freestanding-deleted + initializer_list il); + constexpr iterator erase(const_iterator position); + constexpr iterator erase(const_iterator first, const_iterator last); + constexpr void swap(inplace_vector& x) + noexcept(N == 0 || (is_nothrow_swappable_v && + is_nothrow_move_constructible_v)); + constexpr void clear() noexcept; + + constexpr friend bool operator==(const inplace_vector& x, + const inplace_vector& y); + constexpr friend @\exposid{synth-three-way-result}@ + operator<=>(const inplace_vector& x, const inplace_vector& y); + constexpr friend void swap(inplace_vector& x, inplace_vector& y) + noexcept(N == 0 || (is_nothrow_swappable_v && + is_nothrow_move_constructible_v)) + { x.swap(y); } + }; +}; +\end{codeblock} + +\rSec3[inplace.vector.cons]{Constructors} + +\indexlibraryctor{inplace_vector} +\begin{itemdecl} +constexpr explicit inplace_vector(size_type n); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +\tcode{T} is \oldconcept{DefaultInsertable} into \tcode{*this}. + +\pnum +\effects +Constructs an \tcode{inplace_vector} with \tcode{n} default-inserted elements. + +\pnum +\complexity +Linear in \tcode{n}. +\end{itemdescr} + +\indexlibraryctor{inplace_vector} +\begin{itemdecl} +constexpr inplace_vector(size_type n, const T& value); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +\tcode{T} is \oldconcept{CopyInsertable} into \tcode{*this}. + +\pnum +\effects +Constructs an \tcode{inplace_vector} with \tcode{n} copies of \tcode{value}. + +\pnum +\complexity +Linear in \tcode{n}. +\end{itemdescr} + +\indexlibraryctor{inplace_vector} +\begin{itemdecl} +template + constexpr inplace_vector(InputIterator first, InputIterator last); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Constructs an \tcode{inplace_vector} equal to the range \range{first}{last}. + +\pnum +\complexity +Linear in \tcode{distance(first, last)}. +\end{itemdescr} + +\indexlibraryctor{inplace_vector} +\begin{itemdecl} +template<@\exposconcept{container-compatible-range}@ R> + constexpr inplace_vector(from_range_t, R&& rg); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Constructs an \tcode{inplace_vector} object with +the elements of the range \tcode{rg}. + +\pnum +\complexity +Linear in \tcode{ranges::distance(rg)}. +\end{itemdescr} + +\rSec3[inplace.vector.capacity]{Size and capacity} + +\indexlibrarymember{capacity}{inplace_vector}% +\indexlibrarymember{max_size}{inplace_vector}% +\begin{itemdecl} +static constexpr size_type capacity() noexcept; +static constexpr size_type max_size() noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +\tcode{N}. +\end{itemdescr} + +\indexlibrarymember{resize}{inplace_vector}% +\begin{itemdecl} +constexpr void resize(size_type sz); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +\tcode{T} is \oldconcept{DefaultInsertable} into \tcode{*this}. + +\pnum +\effects +%FIXME: Should "is \tcode{true}" be appended here? +If \tcode{sz < size()}, +erases the last \tcode{size() - sz} elements from the sequence. +Otherwise, +appends \tcode{sz - size()} default-inserted elements to the sequence. + +\pnum +\remarks +If an exception is thrown, there are no effects on \tcode{*this}. +\end{itemdescr} + +\indexlibrarymember{resize}{inplace_vector}% +\begin{itemdecl} +constexpr void resize(size_type sz, const T& c); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +\tcode{T} is \oldconcept{CopyInsertable} into \tcode{*this}. + +\pnum +\effects +%FIXME: Should "is \tcode{true}" be appended here? +If \tcode{sz < size()}, +erases the last \tcode{size() - sz} elements from the sequence. +Otherwise, +appends \tcode{sz - size()} copies of \tcode{c} to the sequence. + +\pnum +\remarks +If an exception is thrown, there are no effects on \tcode{*this}. +\end{itemdescr} + +\rSec3[inplace.vector.data]{Data} + +\indexlibrarymember{data}{inplace_vector}% +\begin{itemdecl} +constexpr T* data() noexcept; +constexpr const T* data() const noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +A pointer such that \range{data()}{data() + size()} is a valid range. +For a non-empty \tcode{inplace_vector}, +\tcode{data() == addressof(front())} is \tcode{true}. + +\pnum +\complexity +Constant time. +\end{itemdescr} + +\rSec3[inplace.vector.modifiers]{Modifiers} + +\indexlibrarymember{insert}{inplace_vector}% +\indexlibrarymember{insert_range}{inplace_vector}% +\indexlibrarymember{emplace}{inplace_vector}% +\indexlibrarymember{append_range}{inplace_vector}% +\begin{itemdecl} +constexpr iterator insert(const_iterator position, const T& x); +constexpr iterator insert(const_iterator position, T&& x); +constexpr iterator insert(const_iterator position, size_type n, const T& x); +template + constexpr iterator insert(const_iterator position, InputIterator first, InputIterator last); +template<@\exposconcept{container-compatible-range}@ R> + constexpr iterator insert_range(const_iterator position, R&& rg); +constexpr iterator insert(const_iterator position, initializer_list il); + +template + constexpr iterator emplace(const_iterator position, Args&&... args); +template<@\exposconcept{container-compatible-range}@ R> + constexpr void append_range(R&& rg); +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let $n$ be value of \tcode{size()} before this call for +the \tcode{append_range} overload, and +\tcode{distance(begin, position)} otherwise. + +\pnum +\complexity +Linear in the number of elements inserted plus +the distance to the end of the vector. + +\pnum +\remarks +If an exception is thrown other than by the +copy constructor, +move constructor, +assignment operator, or +move assignment operator +of \tcode{T} or by +any \tcode{InputIterator} operation, +there are no effects. +Otherwise, +if an exception is thrown, then +$\tcode{size()} \ge n$ and +elements in the range \tcode{begin() + \range{0}{$n$}} are not modified. +\end{itemdescr} + +\indexlibrarymember{push_back}{inplace_vector}% +\indexlibrarymember{emplace_back}{inplace_vector}% +\begin{itemdecl} +constexpr reference push_back(const T& x); +constexpr reference push_back(T&& x); +template + constexpr reference emplace_back(Args&&... args); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\returns +\tcode{back()}. + +\pnum +\throws +\tcode{bad_alloc} or +any exception thrown by initialization of inserted element. + +\pnum +\complexity +Constant. + +\pnum +\remarks +If an exception is thrown there are no effects on \tcode{*this}. +\end{itemdescr} + +\indexlibrarymember{try_emplace_back}{inplace_vector}% +\indexlibrarymember{try_push_back}{inplace_vector}% +\begin{itemdecl} +template + constexpr pointer try_emplace_back(Args&&... args); +constexpr pointer try_push_back(const T& x); +constexpr pointer try_push_back(T&& x); +\end{itemdecl} + +\begin{itemdescr} +\pnum +Let \tcode{vals} denote a pack: +\begin{itemize} +\item \tcode{std::forward(args)...} for the first overload, +\item \tcode{x} for the second overload, +\item \tcode{set::move(x)} for the third overload. +\end{itemize} + +\pnum +\expects +\tcode{value_type} is \oldconcept{EmplaceConstructible} +into \tcode{inplace_vector} from \tcode{vals...}. + +\pnum +\effects +If \tcode{size() < capacity()} is \tcode{true}, +appends an object of type \tcode{T} +direct-non-list-initialized with \tcode{vals...}. +Otherwise, there are no effects. + +\pnum +\returns +\keyword{nullptr} if \tcode{size() == capacity()} is \tcode{true}, +otherwise \tcode{addressof(back())}. + +\pnum +\throws +Nothing unless an exception is thrown by initialization of inserted element. + +\pnum +\complexity +Constant. + +\pnum +\remarks +If an exception is thrown there are no effects on \tcode{*this}. +\end{itemdescr} + +\indexlibrarymember{try_append_range}{inplace_vector}% +\begin{itemdecl} +template<@\exposconcept{container-compatible-range}@ R> + constexpr ranges::borrowed_iterator_t try_append_range(R&& rg); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +\tcode{value_type} is \oldconcept{EmplaceConstructible} +into \tcode{inplace_vector} from\\\tcode{*ranges::begin(rg)}. + +\pnum +\effects +Appends copies of initial elements in \tcode{rg} before \tcode{end()}, +until all elements are inserted or \tcode{size() == capacity()} is \tcode{true}. +Each iterator in the range \tcode{rg} is dereferenced at most once. + +\pnum +\returns +%FIXME: Should this be "An iterator past the last inserted element of rg."? +Iterator past last inserted element of \tcode{rg}. + +\pnum +\complexity +Linear in the number of elements inserted. + +\pnum +\remarks +Let $n$ be the value of \tcode{size()} prior to this call. +If an exception is thrown after the insertion of $k$ elements, then +\tcode{size()} equals $n + k$, +elements in the range \tcode{begin() + \range{0}{$n$}} are not modified, and +elements in the range \tcode{begin() + \range{$n$}{$n + k$}} correspond to +the inserted elements. +\end{itemdescr} + +\indexlibrarymember{unchecked_emplace_back}{inplace_vector}% +\begin{itemdecl} +template + constexpr reference unchecked_emplace_back(Args&&... args); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +\tcode{size() < capacity()} is \tcode{true}. + +\pnum +\effects +Equivalent to: +\tcode{return *try_emplace_back(std::forward(args)...);} +\end{itemdescr} + +\indexlibrarymember{unchecked_push_back}{inplace_vector}% +\begin{itemdecl} +constexpr reference unchecked_push_back(const T& x); +constexpr reference unchecked_push_back(T&& x); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\expects +\tcode{size() < capacity()} is \tcode{true}. + +\pnum +\effects +Equivalent to: +\tcode{return *try_push_back(std::forward(x));} +\end{itemdescr} + +\indexlibrarymember{reserve}{inplace_vector}% +\begin{itemdecl} +static constexpr void reserve(size_type n); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +None. + +\pnum +\throws +\tcode{bad_alloc} if \tcode{n > capacity()} is \tcode{true}. +\end{itemdescr} + +\indexlibrarymember{shrink_to_fit}{inplace_vector}% +\begin{itemdecl} +static constexpr void shrink_to_fit() noexcept; +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +None. +\end{itemdescr} + +\indexlibrarymember{erase}{inplace_vector}% +\indexlibrarymember{pop_back}{inplace_vector}% +\begin{itemdecl} +constexpr iterator erase(const_iterator position); +constexpr iterator erase(const_iterator first, const_iterator last); +constexpr void pop_back(); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Invalidates iterators and references at or after the point of the erase. + +\pnum +\throws +Nothing unless an exception is thrown by +the assignment operator or move assignment operator of \tcode{T}. + +\pnum +\complexity +The destructor of \tcode{T} is called the number of times +equal to the number of the elements erased, but +the assignment operator of \tcode{T} is called the number of times +equal to the number of elements after the erased elements. +\end{itemdescr} + +\rSec3[inplace.vector.erasure]{Erasure} + +\indexlibrarymember{erase}{inplace_vector}% +\begin{itemdecl} +template + constexpr size_t erase(inplace_vector& c, const U& value); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: +\begin{codeblock} +auto it = remove(c.begin(), c.end(), value); +auto r = distance(it, c.end()); +c.erase(it, c.end()); +return r; +\end{codeblock} +\end{itemdescr} + +\indexlibrarymember{erase_if}{inplace_vector}% +\begin{itemdecl} +template + constexpr size_t erase_if(inplace_vector& c, Predicate pred); +\end{itemdecl} + +\begin{itemdescr} +\pnum +\effects +Equivalent to: +\begin{codeblock} +auto it = remove_if(c.begin(), c.end(), pred); +auto r = distance(it, c.end()); +c.erase(it, c.end()); +\end{codeblock} +\end{itemdescr} + \rSec1[associative]{Associative containers} \rSec2[associative.general]{General} @@ -18378,6 +19070,7 @@ \pnum \ensures +%FIXME: Should "is \tcode{true}" be appended here? \tcode{size() == 0 \&\& data() == nullptr}. \end{itemdescr} diff --git a/source/iterators.tex b/source/iterators.tex index c100843bce..04b178f72e 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -7254,6 +7254,7 @@ \libheaderrefx{flat_map}{flat.map.syn}, \libheaderrefx{flat_set}{flat.set.syn}, \libheaderrefx{forward_list}{forward.list.syn}, +\libheaderrefx{inplace_vector}{inplace.vector.syn}, \libheaderref{list}, \libheaderrefx{map}{associative.map.syn}, \libheaderrefx{regex}{re.syn}, diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 61e3ad1204..7ac50b576c 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1149,6 +1149,7 @@ \tcode{} \\ \tcode{} \\ \tcode{} \\ +\tcode{} \\ \tcode{} \\ \tcode{} \\ \tcode{} \\ @@ -1534,6 +1535,7 @@ \ref{string.view} & String view classes & \tcode{} \\ \rowsep \ref{string.classes} & String classes & \tcode{} \\ \rowsep \ref{c.strings} & Null-terminated sequence utilities & \tcode{}, \tcode{} \\ \rowsep +\ref{containers} & Containers library & \tcode{} \\ \rowsep \ref{array} & Class template \tcode{array} & \tcode{} \\ \rowsep \ref{views.contiguous} & Contiguous access & \tcode{} \\ \rowsep \ref{views.multidim} & Multidimensional access & \tcode{} \\ \rowsep @@ -2048,7 +2050,7 @@ difference, the type of the size of objects in this allocation model, as well as the memory allocation and deallocation primitives for it. All of the string types\iref{strings}, -containers\iref{containers} (except \tcode{array}), +containers\iref{containers} (except \tcode{array} and \tcode{inplace_vector}), string buffers and string streams\iref{input.output}, and \tcode{match_results}\iref{re} are parameterized in terms of allocators. diff --git a/source/support.tex b/source/support.tex index b04d57545b..fa2ac7a15b 100644 --- a/source/support.tex +++ b/source/support.tex @@ -681,6 +681,7 @@ #define @\defnlibxname{cpp_lib_hypot}@ 201603L // also in \libheader{cmath} #define @\defnlibxname{cpp_lib_incomplete_container_elements}@ 201505L // also in \libheader{forward_list}, \libheader{list}, \libheader{vector} +#define @\defnlibxname{cpp_lib_inplace_vector}@ 202406L // also in \libheader{inplace_vector} #define @\defnlibxname{cpp_lib_int_pow2}@ 202002L // freestanding, also in \libheader{bit} #define @\defnlibxname{cpp_lib_integer_comparison_functions}@ 202002L // also in \libheader{utility} #define @\defnlibxname{cpp_lib_integer_sequence}@ 201304L // freestanding, also in \libheader{utility} From 37a6c0dc80d8c2a54559a7515a4de2734f1b6242 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Fri, 12 Jul 2024 18:29:35 +0100 Subject: [PATCH 159/162] [inplace.vector.modifiers] Harmonize wording for returned iterator --- source/containers.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 0baca3355c..e835728b4f 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -10004,8 +10004,9 @@ \pnum \returns -%FIXME: Should this be "An iterator past the last inserted element of rg."? -Iterator past last inserted element of \tcode{rg}. +An iterator pointing to the first element of \tcode{rg} +that was not inserted into \tcode{*this}, +or \tcode{ranged::end(rg)} if no such element exists. \pnum \complexity From 24037c709e2ac488668da04c7a06f1811c9f605b Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 1 Jul 2024 22:38:29 -0700 Subject: [PATCH 160/162] P3235R3 std::print more types faster with less memory --- source/iostreams.tex | 28 ++++++++++++++-------------- source/support.tex | 2 +- source/time.tex | 21 +++++++++++++++++++++ source/utilities.tex | 15 ++++++++++++--- 4 files changed, 48 insertions(+), 18 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index dc23d3c5f2..c264412488 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -7746,14 +7746,14 @@ If the ordinary literal encoding\iref{lex.charset} is UTF-8, equivalent to: \begin{codeblock} locksafe - ? vprint_unicode_locking(stream, fmt.str, make_format_args(args...)) - : vprint_unicode(stream, fmt.str, make_format_args(args...)); + ? vprint_unicode(stream, fmt.str, make_format_args(args...)) + : vprint_unicode_buffered(stream, fmt.str, make_format_args(args...)); \end{codeblock} Otherwise, equivalent to: \begin{codeblock} locksafe - ? vprint_nonunicode_locking(stream, fmt.str, make_format_args(args...)) - : vprint_nonunicode(stream, fmt.str, make_format_args(args...)); + ? vprint_nonunicode(stream, fmt.str, make_format_args(args...)) + : vprint_nonunicode_buffered(stream, fmt.str, make_format_args(args...)); \end{codeblock} \end{itemdescr} @@ -7829,9 +7829,9 @@ \end{codeblock} \end{itemdescr} -\indexlibraryglobal{vprint_unicode}% +\indexlibraryglobal{vprint_unicode_buffered}% \begin{itemdecl} -void vprint_unicode(FILE* stream, string_view fmt, format_args args); +void vprint_unicode_buffered(FILE* stream, string_view fmt, format_args args); \end{itemdecl} \begin{itemdescr} @@ -7840,13 +7840,13 @@ Equivalent to: \begin{codeblock} string out = vformat(fmt, args); -vprint_unicode_locking(stream, "{}", make_format_args(out)); +vprint_unicode(stream, "{}", make_format_args(out)); \end{codeblock} \end{itemdescr} -\indexlibraryglobal{vprint_unicode_locking}% +\indexlibraryglobal{vprint_unicode}% \begin{itemdecl} -void vprint_unicode_locking(FILE* stream, string_view fmt, format_args args); +void vprint_unicode(FILE* stream, string_view fmt, format_args args); \end{itemdecl} \begin{itemdescr} @@ -7912,9 +7912,9 @@ \end{codeblock} \end{itemdescr} -\indexlibraryglobal{vprint_nonunicode}% +\indexlibraryglobal{vprint_nonunicode_buffered}% \begin{itemdecl} -void vprint_nonunicode(FILE* stream, string_view fmt, format_args args); +void vprint_nonunicode_buffered(FILE* stream, string_view fmt, format_args args); \end{itemdecl} \begin{itemdescr} @@ -7923,13 +7923,13 @@ Equivalent to: \begin{codeblock} string out = vformat(fmt, args); -vprint_nonunicode_locking("{}", make_format_args(out)); +vprint_nonunicode("{}", make_format_args(out)); \end{codeblock} \end{itemdescr} -\indexlibraryglobal{vprint_nonunicode_locking}% +\indexlibraryglobal{vprint_nonunicode}% \begin{itemdecl} -void vprint_nonunicode_locking(FILE* stream, string_view fmt, format_args args); +void vprint_nonunicode(FILE* stream, string_view fmt, format_args args); \end{itemdecl} \begin{itemdescr} diff --git a/source/support.tex b/source/support.tex index fa2ac7a15b..3c5939f914 100644 --- a/source/support.tex +++ b/source/support.tex @@ -732,7 +732,7 @@ #define @\defnlibxname{cpp_lib_out_ptr}@ 202311L // freestanding, also in \libheader{memory} #define @\defnlibxname{cpp_lib_parallel_algorithm}@ 201603L // also in \libheader{algorithm}, \libheader{numeric} #define @\defnlibxname{cpp_lib_polymorphic_allocator}@ 201902L // also in \libheader{memory_resource} -#define @\defnlibxname{cpp_lib_print}@ 202403L // also in \libheader{print}, \libheader{ostream} +#define @\defnlibxname{cpp_lib_print}@ 202406L // also in \libheader{print}, \libheader{ostream} #define @\defnlibxname{cpp_lib_quoted_string_io}@ 201304L // also in \libheader{iomanip} #define @\defnlibxname{cpp_lib_ranges}@ 202406L // also in \libheader{algorithm}, \libheader{functional}, \libheader{iterator}, \libheader{memory}, \libheader{ranges} diff --git a/source/time.tex b/source/time.tex index 6d0d2b398f..20908f8850 100644 --- a/source/time.tex +++ b/source/time.tex @@ -10828,6 +10828,27 @@ \end{codeblock} \end{example} +\pnum +For \tcode{chrono::duration} +the library only provides the following specialization +of \tcode{enable_nonlocking_formatter_optimization}: +\begin{codeblock} +template + inline constexpr bool enable_nonlocking_formatter_optimization< + chrono::duration> = + enable_nonlocking_formatter_optimization; +\end{codeblock} + +\pnum +For \tcode{chrono::zoned_time} +the library only provides the following specialization of +\tcode{enable_nonlocking_formatter_optimization}: +\begin{codeblock} +template + inline constexpr bool enable_nonlocking_formatter_optimization< + chrono::zoned_time> = true; +\end{codeblock} + \indexlibrary{\idxcode{formatter}!specializations!\idxcode{chrono::sys_time}}% \begin{itemdecl} template diff --git a/source/utilities.tex b/source/utilities.tex index fcbb038a43..72a714d64a 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -15897,6 +15897,10 @@ @\libconcept{formattable}@, charT> struct formatter : @\exposid{range-default-formatter}@, R, charT> { }; + template + requires (format_kind != range_format::disabled) + inline constexpr bool enable_nonlocking_formatter_optimization = false; + // \ref{format.arguments}, arguments // \ref{format.arg}, class template \tcode{basic_format_arg} template class basic_format_arg; @@ -17214,9 +17218,10 @@ interpret the format specification as a \fmtgrammarterm{std-format-spec} as described in \ref{format.string.std}. -In addition, -for each type \tcode{T} for which -a \tcode{formatter} specialization is provided above, + +\pnum +Unless specified otherwise, for each type \tcode{T} for which +a \tcode{formatter} specialization is provided by the library, each of the headers provides the following specialization: \begin{codeblock} template<> inline constexpr bool enable_nonlocking_formatter_optimization = true; @@ -18795,6 +18800,10 @@ typename FormatContext::iterator format(@\seebelow@& elems, FormatContext& ctx) const; }; + + template + inline constexpr bool enable_nonlocking_formatter_optimization<@\placeholder{pair-or-tuple}@> = + (enable_nonlocking_formatter_optimization && ...); } \end{codeblock} From 225eadc4f3676472836397c9c0449f3203ae0a6d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Tue, 2 Jul 2024 01:51:39 -0700 Subject: [PATCH 161/162] P2968R2 Make std::ignore a first-class object --- source/utilities.tex | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index 72a714d64a..d40af96736 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -1494,6 +1494,11 @@ two arguments is similar to an instantiation of \tcode{pair} with the same two arguments. See~\ref{pairs}. +\pnum +In addition to being available via inclusion of the \libheader{tuple} header, +\tcode{ignore}\iref{tuple.syn} is available when +\libheader{utility}\iref{utility} is included. + \rSec2[tuple.syn]{Header \tcode{} synopsis} \indexheader{tuple}% @@ -1520,9 +1525,14 @@ template<@\exposconceptnc{tuple-like}@ TTuple, @\exposconceptnc{tuple-like}@ UTuple> struct common_type; - // \ref{tuple.creation}, tuple creation functions - inline constexpr @\unspec@ ignore; + // \tcode{ignore} + struct @\exposidnc{ignore-type}@ { // \expos + constexpr const @\exposid{ignore-type}@ + operator=(const auto &) const noexcept { return *this; } + }; + inline constexpr @\exposid{ignore-type}@ ignore; + // \ref{tuple.creation}, tuple creation functions template constexpr tuple...> make_tuple(TTypes&&...); @@ -2591,9 +2601,7 @@ \begin{itemdescr} \pnum \returns -\tcode{tuple(t...)}. When an -argument in \tcode{t} is \tcode{ignore}, assigning -any value to the corresponding tuple element has no effect. +\tcode{tuple(t...)}. \pnum \begin{example} From 0eb750bb5f3abc6902d8ac69ba9e0a2404c2105f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Fri, 12 Jul 2024 17:40:51 +0100 Subject: [PATCH 162/162] Update configuration for new working draft N4986 and add corresponding Editors' Report N4987 --- papers/n4987.html | 915 +++++++++++++++++++++++++++++++++++++++++++++ papers/n4987.md | 774 ++++++++++++++++++++++++++++++++++++++ papers/wd-index.md | 1 + source/config.tex | 2 +- 4 files changed, 1691 insertions(+), 1 deletion(-) create mode 100644 papers/n4987.html create mode 100644 papers/n4987.md diff --git a/papers/n4987.html b/papers/n4987.html new file mode 100644 index 0000000000..3099e7e867 --- /dev/null +++ b/papers/n4987.html @@ -0,0 +1,915 @@ + + + + + +N4987 + + +

N4987 Editors’ Report:
Programming Languages — C++

+ +

Date: 2024-07-16

+ +

Thomas Köppe (editor, Google DeepMind)
+Jens Maurer (co-editor)
+Dawn Perchik (co-editor, Bright Side Computing, LLC)
+Richard Smith (co-editor, Google Inc)

+ +

Email: cxxeditor@gmail.com

+ +

Acknowledgements

+ +

Thanks to all those who have submitted editorial +issues +and to those who have provided pull requests with fixes.

+ +

New papers

+ +
    +
  • N4986 is the +current working draft for C++26. It replaces +N4981.
  • +
  • N4987 is this Editors' Report.
  • +
+ +

Motions incorporated into working draft

+ +

Notes on motions

+ +

All passed motions from CWG and LWG motions 1 through 9 were applied cleanly. +LWG motions 10, 11, and 12 have not yet been applied due to a lack of time, +but will be included in the next draft.

+ +

In CWG Poll 1, issue CWG2144 contains no wording changes since it is subsumed by CWG2876, which is part of Poll 2. +The wording changes from issue CWG2867 of CWG Poll 1 affect the same wording as CWG Poll 7; the wording has been reconciled.

+ +

Core working group polls

+ +

CWG Poll 1. Accept as Defect Reports and apply the proposed resolutions of all issues except 2819, 2858, and 2876 in +P3345R0 +(Core Language Working Group "ready" Issues for the June, 2024 meeting) to the C++ Working Paper.

+ +

CWG Poll 2. Apply the proposed resolution of issues 2819, 2858, and 2876 in +P3345R0 +(Core Language Working Group "ready" Issues for the June, 2024 meeting) to the C++ Working Paper.

+ +

CWG Poll 3. Apply the changes in +P2747R2 +(constexpr placement new) to the C++ Working Paper.

+ +

CWG Poll 5. Apply the changes in +P3144R2 +(Deleting a Pointer to an Incomplete Type Should be Ill-formed) to the C++ Working Paper.

+ +

CWG Poll 6. Apply the changes in +P2963R3 +(Ordering of constraints involving fold expressions) to the C++ Working Paper.

+ +

CWG Poll 7. Apply the changes in +P0963R3 +(Structured binding declaration as a condition) to the C++ Working Paper.

+ +

CWG Poll 4 did not have consensus.

+ +

Library working group polls

+ +

LWG Poll 1. Apply the changes for all Ready and Tentatively Ready issues in +P3341R0 +(C++ Standard Library Ready Issues to be moved in St. Louis, Jun. 2024) to the C++ working paper.

+ +

LWG Poll 2. Apply the changes in +P2997R1 +(Removing the common reference requirement from the indirectly invocable concepts) to the C++ working paper.

+ +

LWG Poll 3. Apply the changes in +P2389R2 +(dextents Index Type Parameter) to the C++ working paper.

+ +

LWG Poll 4. Apply the changes in +P3168R2 +(Give std::optional Range Support) to the C++ working paper.

+ +

LWG Poll 5. Apply the changes in +P3217R0 +(Adjoints to "Enabling list-initialization for algorithms": find_last) to the C++ working paper.

+ +

LWG Poll 6. Apply the changes in +P2985R0 +(A type trait for detecting virtual base classes) to the C++ working paper.

+ +

LWG Poll 7. Apply the changes in +P0843R14 +(inplace_vector) to the C++ working paper.

+ +

LWG Poll 8. Accept as a Defect Report and apply the changes in +P3235R3 +(std::print more types faster with less memory) to the C++ working paper.

+ +

LWG Poll 9. Apply the changes in +P2968R2 +(Make std::ignore a first-class object) to the C++ working paper.

+ +

Not yet applied:

+ +

LWG Poll 10. Apply the changes in +P2075R6 +(Philox as an extension of the C++ RNG engines) to the C++ working paper.

+ +

LWG Poll 11. Apply the changes in +P2422R1 +(Remove nodiscard annotations from the standard library specification) to the C++ working paper.

+ +

LWG Poll 12. Apply the changes in +P2300R10 +(std::execution) to the C++ working paper.

+ +

Editorial changes

+ +

Major editorial changes

+ +

A number of editorial changes have been applied that resulted from the ongoing review of the +C++23 IS with the ISO secretariat.

+ +

Mathematical formulae are now numbered, and they must be referenced explicitly from the text.

+ +

We avoid writing references as "subclause 1.2.3" in favour of just "1.2.3" now whenever that is +equally clear.

+ +

Examples in Annex C now use the regular example style, as opposed to the previous ad-hoc style.

+ +

We changed how we refer to the C++ standard itself and how we cite other standards. The page +footers have been changed to show the page number and the copyright over two lines, and the +display of Annex titles has been changed, both in accordance with new ISO style advice. For +details see the following listing.

+ +

Minor editorial changes

+ +

A log of editorial fixes made to the working draft since N4981 is below. This +list excludes changes that do not affect the body text or only affect whitespace +or typeface. For a complete list including such changes (or for the actual +deltas applied by these changes), consult the +draft sources on GitHub.

+ +
commit 59d6bfc0c23b61cabb72d9a48270ed1c3b7e02f9
+Author: Alisdair Meredith <alisdairm@me.com>
+Date:   Tue Apr 16 09:57:19 2024 -0400
+
+    [basic.life] Reflow text defining transparently replaceable
+
+    p8 is difficult to read as it defines transparently replaceable
+    only after it has made all use of it.  The edit pulls the
+    definition of transparently replaceable into its own preceding
+    paragraph, and then simplifies the sentence that uses this term.
+
+commit ccfb6adea4373a63b7063f4d41cb9d47876a9347
+Author: Alisdair Meredith <alisdairm@me.com>
+Date:   Wed Apr 17 03:08:36 2024 -0400
+
+    [tab:headers.cpp.fs] Move the debugging library to numberically sorted position (#6927)
+
+commit c82e95ca91b313bc2cfde60aac9abbd49406d930
+Author: Alisdair Meredith <alisdairm@me.com>
+Date:   Wed Apr 17 18:42:19 2024 -0400
+
+    [zombie.names] Turn lists of zombie names into tables (#6925)
+
+commit c1eec01966d6383dabfaa4304939ce3be3868f1f
+Author: Hewill Kang <67143766+hewillk@users.noreply.github.com>
+Date:   Thu Apr 18 23:51:53 2024 +0800
+
+    [range.concat.overview] Remove unnecessary `std::` prefix from example (#6931)
+
+commit 2de15529d3f98a5de25cecf9ac8ed5b104d776e1
+Author: Jan Schultke <me@eisenwave.net>
+Date:   Thu Apr 18 18:00:42 2024 +0200
+
+    [charconv.syn] Clarify types matching integer-type (#6847)
+
+commit bae18b69cbca566eac284c8c2f316407fda98d16
+Author: Hewill Kang <67143766+hewillk@users.noreply.github.com>
+Date:   Fri Apr 19 01:21:19 2024 +0800
+
+    [range.concat.view] Format code to match the current style (#6929)
+
+commit 79dcca82c22d75fc2b2b6cbc1c338a0229db9a34
+Author: S. B. Tam <cpplearner@outlook.com>
+Date:   Fri Apr 19 19:51:29 2024 +0800
+
+    [range.utility.conv.general] Fix misapplication of LWG4016 (#6932)
+
+commit e572580d71dfc8bdb32b8d1a21a2e493676e2151
+Author: Hewill Kang <67143766+hewillk@users.noreply.github.com>
+Date:   Fri Apr 19 21:57:48 2024 +0800
+
+    [range.concat.iterator] Remove @ outside of codeblocks (#6934)
+
+commit 5a5295d9c9e1881e58d3b4696fe45f00ef1cc507
+Author: Alisdair Meredith <alisdairm@me.com>
+Date:   Fri Apr 19 17:32:53 2024 -0400
+
+    [index] Add missing entries for Cpp17 concepts (#6940)
+
+commit 5d4d9508bca4709366a0ff7acb17ba7b3a2efced
+Author: Hewill Kang <67143766+hewillk@users.noreply.github.com>
+Date:   Sat Apr 20 20:16:23 2024 +0800
+
+    [range.join.with.iterator] Add missing 'template' keyword for dependent name 'emplace' (#5455)
+
+commit 0ac38fd4c4548ff61cd378f98eff3e18f4463caf
+Author: S. B. Tam <cpplearner@outlook.com>
+Date:   Fri Aug 18 15:12:08 2023 +0800
+
+    Fix typo (`dynamic_rank` => `rank_dynamic`)
+
+commit 47c2f68d84cb13a7ca83a507fb1f32ddf4774ec1
+Author: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com>
+Date:   Mon Apr 22 23:19:41 2024 +0200
+
+    [mdspan.layout.leftpad.obs] Remove superfluous \item (#6944)
+
+commit 4f0779d5a3665af9dd92a96e52d809ba3911495d
+Author: Jan Schultke <me@eisenwave.net>
+Date:   Tue Apr 23 12:13:27 2024 +0200
+
+    [intro.execution] Add comma after conditional clause (#6945)
+
+commit 12b6307589257a803527eb38c43f08f867d59322
+Author: Hewill Kang <67143766+hewillk@users.noreply.github.com>
+Date:   Mon Apr 29 15:23:41 2024 +0800
+
+    [algorithm.syn,alg.fill] Fix typos in constraints (#6957)
+
+commit 927d0dba2b068ba9f2136479b4ba05a430eec348
+Author: Hewill Kang <67143766+hewillk@users.noreply.github.com>
+Date:   Mon Apr 29 22:43:49 2024 +0800
+
+    [alg.rand.generate] Remove brace typo (#6956)
+
+commit 480adbe4d6ae54e03b6cec5f8784689445c36eee
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue Apr 30 07:48:14 2024 +0200
+
+    [print.syn] Correctly order println overloads
+
+commit 3333421819c1b2c6dec1becd0dd2a9fa0aeba8cd
+Author: Hewill Kang <67143766+hewillk@users.noreply.github.com>
+Date:   Tue Apr 30 20:22:43 2024 +0800
+
+    [range.concat.iterator] Remove superfluous period (#6960)
+
+commit 513635b371c6a664be2a0ea6fc6939350b9b5e6b
+Author: Hewill Kang <67143766+hewillk@users.noreply.github.com>
+Date:   Fri May 10 00:17:43 2024 +0800
+
+    [range.reverse.overview] Replace 'equivalent to' with 'then' (#6966)
+
+commit be18ecc17114bcae4acdad10a3467686510b22c2
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Sat May 11 21:51:48 2024 +0200
+
+    [class.derived.general] Restore accidental reversal of P2662R3 change
+
+    P2662R3 contained a rename of the grammar production "class-or-decltype"
+    to "class-or-computed-type-specifier".  That was editorially reverted
+    with commit c831ec0b8aac369aa61ce392783865ff04b84b19, but that commit
+    also accidentally reverted the change from "decltype-specifier" to
+    "computed-type-specifier" as one of the options for "class-or-decltype".
+
+    This commit restores the latter change, as intended by P2662R3.
+
+commit 9dcff41d2d26577c2ec0643056187a0f8094832e
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Sun May 12 15:24:43 2024 +0100
+
+    [intro.refs] Fix document titles
+
+commit 5b332fed1a4577ad08ed469da26c9c7864ea9e11
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Sun May 12 15:31:43 2024 +0100
+
+    [intro.refs, intro.defs] Update ISO 80000-2:2009 to :2019, change "and" to comma
+
+commit 85f4bb454effe50029de636d6f206f9c1153236a
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Sun May 12 15:53:11 2024 +0100
+
+    [defns.order.ptr] Add missing hypen in "built-in"
+
+commit 9cd8d6ce9cc446c94d91e1350b9113906774f0af
+Author: Hewill Kang <67143766+hewillk@users.noreply.github.com>
+Date:   Tue May 14 21:49:55 2024 +0800
+
+    [format.context] Fix error in example (#6970)
+
+commit 951ded4880e4295981c0d691915a81d84c2baa9d
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Sun May 12 16:01:09 2024 +0100
+
+    [defns.unblock] Italicize entire term "blocked", not just "block".
+
+    ISO has indicated that this is the acceptable way to state a reference to another definition, in this case "block" [defns.block].
+
+commit 1cb3842f83412720a23c664f478a4167cb3162a2
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue May 14 18:52:30 2024 +0200
+
+    [styles] Redesign Annex titles per Rice Model Standard
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 2f23560744a966f7a455629506468a02055d53ea
+Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
+Date:   Mon May 20 05:52:26 2024 -0400
+
+    [alg.ends.with] Replace drop_view with views::drop (#6773)
+
+commit bbac8a98d303d3ad5ecd9514fb2db37745d16984
+Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
+Date:   Mon May 20 07:24:27 2024 -0400
+
+    [dcl.init.list] Eliminate "specialization of initializer_list<X>" (#6258)
+
+commit ad37b863dec4af4c88d8f2154d5f3e4a9b2a3b33
+Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
+Date:   Tue May 21 07:12:32 2024 -0400
+
+    [support.initlist] "initializer list" should be "initializer_list" (#6680)
+
+    This note is talking about the class type, not the grammatical construct.
+
+commit 2e455af5d6a2bdaac7e9d0d4e7f23ac7a6c0451d
+Author: zhihaoy <43971430+zhihaoy@users.noreply.github.com>
+Date:   Tue May 21 22:50:56 2024 -0700
+
+    [util.smartptr.shared.cast] Properly describe possibility of double deletion in notes (#7037)
+
+commit 4b3f32ae814c8da3faccc0dc307904bd250371d9
+Author: Jonathan Wakely <cxx@kayari.org>
+Date:   Tue May 28 22:10:36 2024 +0100
+
+    [input.output] Add cross-references to header synopses (#7005)
+
+    Several of the synopses are not adjacent to the types they declare.
+    Adding cross-references makes it easier to find the relevant definitions
+    of classes and class templates.
+
+    Also make the title of [ostream.manip] more specific to its content.
+
+commit dbf17528619707307f859bac1b36c52654fecfc8
+Author: Arthur O'Dwyer <arthur.j.odwyer@gmail.com>
+Date:   Mon Jun 10 17:06:15 2024 -0400
+
+    [container.adaptors] Reorder constructors for flat_* adaptors (#6274)
+
+    Canonicalize the ordering of the constructors for the flat_* adaptors:
+     - default constructor is first
+     - each overload without `key_compare` is followed by the corresponding one with `key_compare`
+     - each pair of overloads without `sorted_unique` is followed by the corresponding pair with `sorted_unique`
+
+commit ae9b2d7481af415076ffdf33d5920e31e5591eb1
+Author: Jan Schultke <me@eisenwave.net>
+Date:   Tue Jun 11 15:32:36 2024 +0200
+
+    [res.on.exception.handling] Add cross-reference to [except.spec] (#7058)
+
+commit c95ff039b634388962e1fa242e772da8466d49b6
+Author: Jan Schultke <me@eisenwave.net>
+Date:   Wed Jun 12 12:36:02 2024 +0200
+
+    [stmt.if] Add missing comma after conditional clause (#7061)
+
+commit 42a38b072a471a112720535c087d96c8f4865a47
+Author: Jan Schultke <me@eisenwave.net>
+Date:   Wed Jun 12 18:56:14 2024 +0200
+
+    [stmt.pre] Add a cross-reference to [intro.execution] (#7060)
+
+commit 3680e10a5a7eb48b35f150429ce6b3313583bb87
+Author: Jan Schultke <me@eisenwave.net>
+Date:   Fri Jun 14 12:48:46 2024 +0200
+
+    [class.virtual] Add commas (#7062)
+
+commit 9ad7d63f8db28c88dfa68866d23c5ab742be3f80
+Author: Antony Polukhin <antoshkka@gmail.com>
+Date:   Tue Jun 18 19:00:34 2024 +0300
+
+    [associative.reqmts.general] Fix typo (#7069)
+
+commit a24620eced94b1f04fcbd8add49f5e9ca6326ed4
+Author: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com>
+Date:   Fri Jun 21 12:36:01 2024 +0200
+
+    [class.union.general] Add comma (#7072)
+
+commit 59e634a8a841f58efeac873459bedf28928a83f9
+Author: Johannes Sixt <j6t@kdbg.org>
+Date:   Wed Jun 26 11:53:47 2024 +0200
+
+    [func.require] Add missing formatting of subscript index (#7071)
+
+commit 6d67d200863e430650047adb651324bc5663b6fc
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue May 14 13:13:42 2024 +0200
+
+    [diff] Mark examples as such
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 21e022557462544e2e6d32411f71e42a378d2236
+Author: Jonathan Wakely <cxx@kayari.org>
+Date:   Tue Jul 2 14:31:08 2024 +0100
+
+    [depr.c.macros] Fix "macro" singular when referring to two macros
+
+    This should have been applied as part of LWG 4036.
+
+commit 8bb63636c37f8e67808de1e1ce1142a3028293fd
+Author: Jonathan Wakely <cxx@kayari.org>
+Date:   Wed Jul 3 20:53:40 2024 +0100
+
+    [istream.unformatted] add missing semi-colon to list item (#7117)
+
+commit 8227c196af96f157a539e5181f7a75ab3de3a096
+Author: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com>
+Date:   Fri Jul 5 10:03:47 2024 +0200
+
+    [except.throw] Add comma (#7118)
+
+commit 07c20b75a867b66c858de716dfb639b0a9d1da2c
+Author: Yihe Li <winmikedows@hotmail.com>
+Date:   Sat Jul 6 23:32:43 2024 +0800
+
+    [version.syn] Remove redundant <version> for __cpp_lib_ranges_enumerate (#7120)
+
+commit 15b7ea6c95e471888cda2c334ba8ac30cabccf64
+Author: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com>
+Date:   Sun Jul 7 10:23:09 2024 +0200
+
+    [basic.start.main] fix definite article (#7121)
+
+commit 61d85d3f9b78d792bd1bdb1d15202f9cdd931b31
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Tue Jul 9 00:57:58 2024 +0100
+
+    [intro.compliance.general] Cite Annex B more normatively.
+
+commit 2048179f82bbe92dcccee3cc6bbdac4973c77606
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Tue Jul 9 01:25:28 2024 +0100
+
+    [intro.compliance.general] Cite Annex D more normatively.
+
+commit 6b67a856495634df3a0bd0d8abee36eb0d3c8c6f
+Author: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com>
+Date:   Tue Jul 9 08:29:50 2024 +0200
+
+    [temp.inst] Fix definite article
+
+commit 43c47b42fd1f7cd4d095299aca98666c06e45949
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Tue Jul 9 01:44:08 2024 +0100
+
+    [uaxid] Clarify that requirements come "from UAX #31", and use "this document".
+
+commit 7c35cb057ef4885e091bf65c1103d64946e7c8d1
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Tue Jul 9 14:47:10 2024 +0100
+
+    [std] Make bibliography reference link colour more citely
+
+commit bc2c80c23133a0581a847bd7fcfaca621ca86ffe
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Mon May 13 20:17:21 2024 +0200
+
+    [dcl.init.list] Add commas and period for bulleted list
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 868db7356ad1490890391e8c82888de5c4d4aad4
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Mon May 13 20:18:20 2024 +0200
+
+    [facet.num.get.virtuals] Add missing punctuation
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 77ee6ed3b8865b2bb514cb8446488aa6fb032dda
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Mon May 13 23:39:13 2024 +0200
+
+    [lex.literal] Properly format table headings
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit cb9850377b88a4d7da12d05bcdf11948c384f699
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Mon May 13 23:47:55 2024 +0200
+
+    [basic.fundamental] Center second column of "integer width" table
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 2a2b8732e0d81dd9f5d3880b70bd451173e5f5fc
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Tue Jul 9 15:41:56 2024 +0100
+
+    [intro.defs] Minor rewording. Avoid sounding like a requirement.
+
+commit 4746925c7117015480542fd68ad5f595b78173d2
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue May 14 14:11:53 2024 +0200
+
+    [numeric.limits.members,bibliography] Remove LIA-1 abbreviation for ISO 10967
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit c18d51ddf436abf39065ea86497161383bba11c0
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed May 15 09:05:36 2024 +0200
+
+    [intro.memory] Move footnote about Unicode trademark to [lex.phases]
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 1f32f6aa8000f194f1b5c4daba94d271eea817fb
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed May 15 16:28:34 2024 +0200
+
+    [diff,bibliography] Move details of old C++ standards to the bibliography
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit d5410b4035e3108d48a63434abfff7e377c996d2
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed May 15 18:31:14 2024 +0200
+
+    [diff.cpp20,diff.cpp17] Add missing inclusion clause
+
+commit af4cf904c3d2df0675dbd456af2de2f1259e370c
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Thu May 16 12:56:12 2024 +0200
+
+    [std] Rename 'In general' headings to 'General' for consistency
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 9d3011b4224bb63636f4a117967e8ba8110f5ba4
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri May 17 14:11:48 2024 +0200
+
+    [implimits] Rephrase introductory sentence for list of quantities
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 260d3a0d0cde1431dd4221115e1b37979ee07e7d
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Thu May 16 12:30:44 2024 +0200
+
+    [class.copy.ctor] Remove reference to non-existing example
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 0bc3e030be28ff2191af8e9c9c202bff6e23c320
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Thu May 16 12:37:12 2024 +0200
+
+    [class.conv.general] Remove vague reference to unhelpful examples
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 861f07de24c5cfbd69840038d8589bc13b24b7e7
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed May 15 21:58:36 2024 +0200
+
+    [cpp.predefined,namespace.future,version.syn] Replace 'C++' with 'this document'
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit a7a2cbd10ea752d49ca286e3fea3e7cbbb9b6e9d
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri May 17 00:44:32 2024 +0200
+
+    [futures.state] Turn note into example
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 88c48bb78815576fb20db42b89f381c580d28b0e
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue May 14 22:41:24 2024 +0200
+
+    [std] Remove colons in front of bulleted lists
+
+commit 9d7aa6108b84a09117463d0b13bc24cf61926897
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue May 14 22:47:38 2024 +0200
+
+    [iterators] Add colon after 'model ... only if' when complete sentences follow
+
+commit 79ac47f7053da4ef20c117e282377591d028e7a5
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed May 15 21:42:09 2024 +0200
+
+    [basic.fundamental,cstdarg.syn] Use full reference for ISO C sections
+
+    Fixes ISO/CS comment (C++23)
+
+commit 2bbf136502811925250b09fd73909b78e0236091
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Thu May 16 12:51:32 2024 +0200
+
+    [execpol.general] Use 'this document', not 'this standard'
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit e65393f3c87d323258e38c498b849dc57404a20b
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed May 15 22:13:14 2024 +0200
+
+    [format.string.std] Add (R) symbol after Windows
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit dafefea895de358b8edcb6780e3c7b71d209b458
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue May 14 19:12:57 2024 +0200
+
+    [rand.req] Replace 'that Table' with a precise reference
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 361e7769a245aad263574bbe83b9266d8da3b01b
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri May 17 09:42:22 2024 +0200
+
+    [std] Replace 'this standard' with 'this document'
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit e86031dd14e052956fc23ec4dbc1510b7438ba5b
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Mon May 13 23:19:57 2024 +0200
+
+    [time.format,time.parse] Fix references to ISO week calendar
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 868b0b29ac16370ed8792442a0ab41be91c5d575
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Mon May 13 19:01:05 2024 +0200
+
+    [std] Avoid hanging paragraphs by introducing "General" subclauses
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit f0580700cf0e8e920ceb3a078b6872a4c16fa225
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Wed May 15 21:49:31 2024 +0200
+
+    [std] Remove ISO from any mention of 'C'
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 69f184ea599635dac4cd9dc06a3303bed93b26f7
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Mon May 13 19:30:38 2024 +0200
+
+    [std] Remove mid-sentence 'subclause' introducer
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit ecb071672b02a4b7bc829f87433d98785d9dd701
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Mon May 13 19:44:40 2024 +0200
+
+    [std] Remove incorrect or duplicative 'this subclause' introducers
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit a249f9f37531fe79e768f19a45f1b1a70685c2c6
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Tue Jul 9 22:48:20 2024 +0100
+
+    [classes] Turn ad-hoc examples into proper examples (#7125)
+
+commit eade3851e174ac014b478b8d4f097103d3b996ae
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Thu May 16 12:44:01 2024 +0200
+
+    [lex.ccon,expr.prim.lambda.capture] Excise 'ISO' prefix
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 5383169856690cf05d946f058ed861119405d126
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Thu May 16 14:32:49 2024 +0200
+
+    [fs.class.path.general] Defuse cross-reference to POSIX
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 5731ab6a9122763bf6193d1382a05c7bebe82b38
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Tue Jul 9 23:24:09 2024 +0100
+
+    [time.format] Remove mid-sentence 'subclause' introducer from external reference
+
+commit 856d175973d343d8e16d641221f47357672d9959
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Fri May 17 14:26:54 2024 +0200
+
+    [lib] Excise Note A, Note B, etc. designations
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 5508a007540d790a8f5cd30f863f4d329edf2694
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Thu May 16 15:07:27 2024 +0200
+
+    [macros,numerics] Add and use numbered 'formula' environment
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 2b0ff8d6bd285bbe8b27fdab47e268b115a3f930
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Wed Jul 10 11:33:23 2024 +0100
+
+    [lex.string] Replace colon with full stop to end the sentence.
+
+    On request of ISO/CS, for otherwise we should have made the next 'if'
+    lowercase, because: "Grammatically this is the same sentence,
+    as there is no full stop, so the 'if' should be lowercase."
+
+    If a colon really doesn't end a sentence, then we should make it so
+    that the sentence really does end.
+
+commit 064fb0b34eb8cbb14f52dc966c833ef7c749c82c
+Author: Jens Maurer <Jens.Maurer@gmx.net>
+Date:   Tue May 14 08:23:07 2024 +0200
+
+    [macros] Prefer page break above 'note' or 'example' introducers
+
+    Fixes ISO/CS comment (C++23 proof)
+
+commit 13b08d0f58dfea7ae2e19b1d931094d4523a52d2
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Thu Jul 11 01:41:29 2024 +0100
+
+    [layout, styles] New ISO header and footer layout.
+
+    The footer now takes up two lines, one for the copyright and one for
+    the page number.
+
+commit 7f6069c794abb56e51affdc2923e3d33b3a547a8
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Thu Jul 11 12:27:28 2024 +0100
+
+    [cover-reg] Update regular cover
+
+commit f41a619cf852ae638bfe4792ec78ac1f214a7d23
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Fri Jul 12 01:28:38 2024 +0100
+
+    [impldefindex] Reinstate full page mark
+
+    As of 13b08d0f58dfea7ae2e19b1d931094d4523a52d2 we have space for it.
+
+commit b2870b5c87765946f5c4a644da508adcc483045e
+Author: Thomas Köppe <tkoeppe@google.com>
+Date:   Fri Jul 12 01:30:06 2024 +0100
+
+    [macros, std] Create macros for ISO/IEC 60559 and ISO/IEC/IEEE 9945.
+
+    As a side effect, this corrects the title of ISO/IEC 60559(:2020),
+    whose previous version was ISO/IEC/IEEE 60559:2011.
+
+ + diff --git a/papers/n4987.md b/papers/n4987.md new file mode 100644 index 0000000000..d405f0b427 --- /dev/null +++ b/papers/n4987.md @@ -0,0 +1,774 @@ +# N4987 Editors' Report -- Programming Languages -- C++ + +Date: 2024-07-16 + +Thomas Köppe (editor, Google DeepMind) +Jens Maurer (co-editor) +Dawn Perchik (co-editor, Bright Side Computing, LLC) +Richard Smith (co-editor, Google Inc) + +Email: `cxxeditor@gmail.com` + +## Acknowledgements + +Thanks to all those who have [submitted editorial +issues](https://github.com/cplusplus/draft/wiki/How-to-submit-an-editorial-issue) +and to those who have provided pull requests with fixes. + +## New papers + + * [N4986](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4986.pdf) is the + current working draft for C++26. It replaces + [N4981](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4981.pdf). + * N4987 is this Editors' Report. + +## Motions incorporated into working draft + +### Notes on motions + +All passed motions from CWG and LWG motions 1 through 9 were applied cleanly. +LWG motions 10, 11, and 12 have not yet been applied due to a lack of time, +but will be included in the next draft. + +In CWG Poll 1, issue CWG2144 contains no wording changes since it is subsumed by CWG2876, which is part of Poll 2. +The wording changes from issue CWG2867 of CWG Poll 1 affect the same wording as CWG Poll 7; the wording has been reconciled. + +### Core working group polls + +CWG Poll 1. Accept as Defect Reports and apply the proposed resolutions of all issues except 2819, 2858, and 2876 in +[P3345R0](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3345r0.html) +(Core Language Working Group "ready" Issues for the June, 2024 meeting) to the C++ Working Paper. + +CWG Poll 2. Apply the proposed resolution of issues 2819, 2858, and 2876 in +[P3345R0](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3345r0.html) +(Core Language Working Group "ready" Issues for the June, 2024 meeting) to the C++ Working Paper. + +CWG Poll 3. Apply the changes in +[P2747R2](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2747r2.html) +(`constexpr` placement new) to the C++ Working Paper. + +CWG Poll 5. Apply the changes in +[P3144R2](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3144r2.pdf) +(Deleting a Pointer to an Incomplete Type Should be Ill-formed) to the C++ Working Paper. + +CWG Poll 6. Apply the changes in +[P2963R3](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2963r3.pdf) +(Ordering of constraints involving fold expressions) to the C++ Working Paper. + +CWG Poll 7. Apply the changes in +[P0963R3](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0963r3.html) +(Structured binding declaration as a condition) to the C++ Working Paper. + +CWG Poll 4 did not have consensus. + +### Library working group polls + +LWG Poll 1. Apply the changes for all Ready and Tentatively Ready issues in +[P3341R0](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3341r0.html) +(C++ Standard Library Ready Issues to be moved in St. Louis, Jun. 2024) to the C++ working paper. + +LWG Poll 2. Apply the changes in +[P2997R1](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2997r1.html) +(Removing the common reference requirement from the indirectly invocable concepts) to the C++ working paper. + +LWG Poll 3. Apply the changes in +[P2389R2](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2389r2.html) +(`dextents` Index Type Parameter) to the C++ working paper. + +LWG Poll 4. Apply the changes in +[P3168R2](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3168r2.html) +(Give `std::optional` Range Support) to the C++ working paper. + +LWG Poll 5. Apply the changes in +[P3217R0](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3217r0.html) +(Adjoints to "Enabling list-initialization for algorithms": `find_last`) to the C++ working paper. + +LWG Poll 6. Apply the changes in +[P2985R0](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2985r0.html) +(A type trait for detecting virtual base classes) to the C++ working paper. + +LWG Poll 7. Apply the changes in +[P0843R14](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p0843r14.html) +(`inplace_vector`) to the C++ working paper. + +LWG Poll 8. Accept as a Defect Report and apply the changes in +[P3235R3](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p3235r3.html) +(std::print more types faster with less memory) to the C++ working paper. + +LWG Poll 9. Apply the changes in +[P2968R2](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2968r2.html) +(Make std::ignore a first-class object) to the C++ working paper. + +**Not yet applied:** + +LWG Poll 10. Apply the changes in +[P2075R6](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2075r6.html) +(Philox as an extension of the C++ RNG engines) to the C++ working paper. + +LWG Poll 11. Apply the changes in +[P2422R1](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2422r1.html) +(Remove nodiscard annotations from the standard library specification) to the C++ working paper. + +LWG Poll 12. Apply the changes in +[P2300R10](https://open-std.org/jtc1/sc22/wg21/docs/papers/2024/p2300r10.html) +(std::execution) to the C++ working paper. + +## Editorial changes + +### Major editorial changes + +A number of editorial changes have been applied that resulted from the ongoing review of the +C++23 IS with the ISO secretariat. + +Mathematical formulae are now numbered, and they must be referenced explicitly from the text. + +We avoid writing references as "subclause 1.2.3" in favour of just "1.2.3" now whenever that is +equally clear. + +Examples in Annex C now use the regular example style, as opposed to the previous ad-hoc style. + +We changed how we refer to the C++ standard itself and how we cite other standards. The page +footers have been changed to show the page number and the copyright over two lines, and the +display of Annex titles has been changed, both in accordance with new ISO style advice. For +details see the following listing. + +### Minor editorial changes + +A log of editorial fixes made to the working draft since N4981 is below. This +list excludes changes that do not affect the body text or only affect whitespace +or typeface. For a complete list including such changes (or for the actual +deltas applied by these changes), consult the +[draft sources on GitHub](https://github.com/cplusplus/draft/compare/n4981...n4986). + + commit 59d6bfc0c23b61cabb72d9a48270ed1c3b7e02f9 + Author: Alisdair Meredith + Date: Tue Apr 16 09:57:19 2024 -0400 + + [basic.life] Reflow text defining transparently replaceable + + p8 is difficult to read as it defines transparently replaceable + only after it has made all use of it. The edit pulls the + definition of transparently replaceable into its own preceding + paragraph, and then simplifies the sentence that uses this term. + + commit ccfb6adea4373a63b7063f4d41cb9d47876a9347 + Author: Alisdair Meredith + Date: Wed Apr 17 03:08:36 2024 -0400 + + [tab:headers.cpp.fs] Move the debugging library to numberically sorted position (#6927) + + commit c82e95ca91b313bc2cfde60aac9abbd49406d930 + Author: Alisdair Meredith + Date: Wed Apr 17 18:42:19 2024 -0400 + + [zombie.names] Turn lists of zombie names into tables (#6925) + + commit c1eec01966d6383dabfaa4304939ce3be3868f1f + Author: Hewill Kang <67143766+hewillk@users.noreply.github.com> + Date: Thu Apr 18 23:51:53 2024 +0800 + + [range.concat.overview] Remove unnecessary `std::` prefix from example (#6931) + + commit 2de15529d3f98a5de25cecf9ac8ed5b104d776e1 + Author: Jan Schultke + Date: Thu Apr 18 18:00:42 2024 +0200 + + [charconv.syn] Clarify types matching integer-type (#6847) + + commit bae18b69cbca566eac284c8c2f316407fda98d16 + Author: Hewill Kang <67143766+hewillk@users.noreply.github.com> + Date: Fri Apr 19 01:21:19 2024 +0800 + + [range.concat.view] Format code to match the current style (#6929) + + commit 79dcca82c22d75fc2b2b6cbc1c338a0229db9a34 + Author: S. B. Tam + Date: Fri Apr 19 19:51:29 2024 +0800 + + [range.utility.conv.general] Fix misapplication of LWG4016 (#6932) + + commit e572580d71dfc8bdb32b8d1a21a2e493676e2151 + Author: Hewill Kang <67143766+hewillk@users.noreply.github.com> + Date: Fri Apr 19 21:57:48 2024 +0800 + + [range.concat.iterator] Remove @ outside of codeblocks (#6934) + + commit 5a5295d9c9e1881e58d3b4696fe45f00ef1cc507 + Author: Alisdair Meredith + Date: Fri Apr 19 17:32:53 2024 -0400 + + [index] Add missing entries for Cpp17 concepts (#6940) + + commit 5d4d9508bca4709366a0ff7acb17ba7b3a2efced + Author: Hewill Kang <67143766+hewillk@users.noreply.github.com> + Date: Sat Apr 20 20:16:23 2024 +0800 + + [range.join.with.iterator] Add missing 'template' keyword for dependent name 'emplace' (#5455) + + commit 0ac38fd4c4548ff61cd378f98eff3e18f4463caf + Author: S. B. Tam + Date: Fri Aug 18 15:12:08 2023 +0800 + + Fix typo (`dynamic_rank` => `rank_dynamic`) + + commit 47c2f68d84cb13a7ca83a507fb1f32ddf4774ec1 + Author: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> + Date: Mon Apr 22 23:19:41 2024 +0200 + + [mdspan.layout.leftpad.obs] Remove superfluous \item (#6944) + + commit 4f0779d5a3665af9dd92a96e52d809ba3911495d + Author: Jan Schultke + Date: Tue Apr 23 12:13:27 2024 +0200 + + [intro.execution] Add comma after conditional clause (#6945) + + commit 12b6307589257a803527eb38c43f08f867d59322 + Author: Hewill Kang <67143766+hewillk@users.noreply.github.com> + Date: Mon Apr 29 15:23:41 2024 +0800 + + [algorithm.syn,alg.fill] Fix typos in constraints (#6957) + + commit 927d0dba2b068ba9f2136479b4ba05a430eec348 + Author: Hewill Kang <67143766+hewillk@users.noreply.github.com> + Date: Mon Apr 29 22:43:49 2024 +0800 + + [alg.rand.generate] Remove brace typo (#6956) + + commit 480adbe4d6ae54e03b6cec5f8784689445c36eee + Author: Jens Maurer + Date: Tue Apr 30 07:48:14 2024 +0200 + + [print.syn] Correctly order println overloads + + commit 3333421819c1b2c6dec1becd0dd2a9fa0aeba8cd + Author: Hewill Kang <67143766+hewillk@users.noreply.github.com> + Date: Tue Apr 30 20:22:43 2024 +0800 + + [range.concat.iterator] Remove superfluous period (#6960) + + commit 513635b371c6a664be2a0ea6fc6939350b9b5e6b + Author: Hewill Kang <67143766+hewillk@users.noreply.github.com> + Date: Fri May 10 00:17:43 2024 +0800 + + [range.reverse.overview] Replace 'equivalent to' with 'then' (#6966) + + commit be18ecc17114bcae4acdad10a3467686510b22c2 + Author: Jens Maurer + Date: Sat May 11 21:51:48 2024 +0200 + + [class.derived.general] Restore accidental reversal of P2662R3 change + + P2662R3 contained a rename of the grammar production "class-or-decltype" + to "class-or-computed-type-specifier". That was editorially reverted + with commit c831ec0b8aac369aa61ce392783865ff04b84b19, but that commit + also accidentally reverted the change from "decltype-specifier" to + "computed-type-specifier" as one of the options for "class-or-decltype". + + This commit restores the latter change, as intended by P2662R3. + + commit 9dcff41d2d26577c2ec0643056187a0f8094832e + Author: Thomas Köppe + Date: Sun May 12 15:24:43 2024 +0100 + + [intro.refs] Fix document titles + + commit 5b332fed1a4577ad08ed469da26c9c7864ea9e11 + Author: Thomas Köppe + Date: Sun May 12 15:31:43 2024 +0100 + + [intro.refs, intro.defs] Update ISO 80000-2:2009 to :2019, change "and" to comma + + commit 85f4bb454effe50029de636d6f206f9c1153236a + Author: Thomas Köppe + Date: Sun May 12 15:53:11 2024 +0100 + + [defns.order.ptr] Add missing hypen in "built-in" + + commit 9cd8d6ce9cc446c94d91e1350b9113906774f0af + Author: Hewill Kang <67143766+hewillk@users.noreply.github.com> + Date: Tue May 14 21:49:55 2024 +0800 + + [format.context] Fix error in example (#6970) + + commit 951ded4880e4295981c0d691915a81d84c2baa9d + Author: Thomas Köppe + Date: Sun May 12 16:01:09 2024 +0100 + + [defns.unblock] Italicize entire term "blocked", not just "block". + + ISO has indicated that this is the acceptable way to state a reference to another definition, in this case "block" [defns.block]. + + commit 1cb3842f83412720a23c664f478a4167cb3162a2 + Author: Jens Maurer + Date: Tue May 14 18:52:30 2024 +0200 + + [styles] Redesign Annex titles per Rice Model Standard + + Fixes ISO/CS comment (C++23 proof) + + commit 2f23560744a966f7a455629506468a02055d53ea + Author: Arthur O'Dwyer + Date: Mon May 20 05:52:26 2024 -0400 + + [alg.ends.with] Replace drop_view with views::drop (#6773) + + commit bbac8a98d303d3ad5ecd9514fb2db37745d16984 + Author: Arthur O'Dwyer + Date: Mon May 20 07:24:27 2024 -0400 + + [dcl.init.list] Eliminate "specialization of initializer_list" (#6258) + + commit ad37b863dec4af4c88d8f2154d5f3e4a9b2a3b33 + Author: Arthur O'Dwyer + Date: Tue May 21 07:12:32 2024 -0400 + + [support.initlist] "initializer list" should be "initializer_list" (#6680) + + This note is talking about the class type, not the grammatical construct. + + commit 2e455af5d6a2bdaac7e9d0d4e7f23ac7a6c0451d + Author: zhihaoy <43971430+zhihaoy@users.noreply.github.com> + Date: Tue May 21 22:50:56 2024 -0700 + + [util.smartptr.shared.cast] Properly describe possibility of double deletion in notes (#7037) + + commit 4b3f32ae814c8da3faccc0dc307904bd250371d9 + Author: Jonathan Wakely + Date: Tue May 28 22:10:36 2024 +0100 + + [input.output] Add cross-references to header synopses (#7005) + + Several of the synopses are not adjacent to the types they declare. + Adding cross-references makes it easier to find the relevant definitions + of classes and class templates. + + Also make the title of [ostream.manip] more specific to its content. + + commit dbf17528619707307f859bac1b36c52654fecfc8 + Author: Arthur O'Dwyer + Date: Mon Jun 10 17:06:15 2024 -0400 + + [container.adaptors] Reorder constructors for flat_* adaptors (#6274) + + Canonicalize the ordering of the constructors for the flat_* adaptors: + - default constructor is first + - each overload without `key_compare` is followed by the corresponding one with `key_compare` + - each pair of overloads without `sorted_unique` is followed by the corresponding pair with `sorted_unique` + + commit ae9b2d7481af415076ffdf33d5920e31e5591eb1 + Author: Jan Schultke + Date: Tue Jun 11 15:32:36 2024 +0200 + + [res.on.exception.handling] Add cross-reference to [except.spec] (#7058) + + commit c95ff039b634388962e1fa242e772da8466d49b6 + Author: Jan Schultke + Date: Wed Jun 12 12:36:02 2024 +0200 + + [stmt.if] Add missing comma after conditional clause (#7061) + + commit 42a38b072a471a112720535c087d96c8f4865a47 + Author: Jan Schultke + Date: Wed Jun 12 18:56:14 2024 +0200 + + [stmt.pre] Add a cross-reference to [intro.execution] (#7060) + + commit 3680e10a5a7eb48b35f150429ce6b3313583bb87 + Author: Jan Schultke + Date: Fri Jun 14 12:48:46 2024 +0200 + + [class.virtual] Add commas (#7062) + + commit 9ad7d63f8db28c88dfa68866d23c5ab742be3f80 + Author: Antony Polukhin + Date: Tue Jun 18 19:00:34 2024 +0300 + + [associative.reqmts.general] Fix typo (#7069) + + commit a24620eced94b1f04fcbd8add49f5e9ca6326ed4 + Author: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> + Date: Fri Jun 21 12:36:01 2024 +0200 + + [class.union.general] Add comma (#7072) + + commit 59e634a8a841f58efeac873459bedf28928a83f9 + Author: Johannes Sixt + Date: Wed Jun 26 11:53:47 2024 +0200 + + [func.require] Add missing formatting of subscript index (#7071) + + commit 6d67d200863e430650047adb651324bc5663b6fc + Author: Jens Maurer + Date: Tue May 14 13:13:42 2024 +0200 + + [diff] Mark examples as such + + Fixes ISO/CS comment (C++23 proof) + + commit 21e022557462544e2e6d32411f71e42a378d2236 + Author: Jonathan Wakely + Date: Tue Jul 2 14:31:08 2024 +0100 + + [depr.c.macros] Fix "macro" singular when referring to two macros + + This should have been applied as part of LWG 4036. + + commit 8bb63636c37f8e67808de1e1ce1142a3028293fd + Author: Jonathan Wakely + Date: Wed Jul 3 20:53:40 2024 +0100 + + [istream.unformatted] add missing semi-colon to list item (#7117) + + commit 8227c196af96f157a539e5181f7a75ab3de3a096 + Author: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> + Date: Fri Jul 5 10:03:47 2024 +0200 + + [except.throw] Add comma (#7118) + + commit 07c20b75a867b66c858de716dfb639b0a9d1da2c + Author: Yihe Li + Date: Sat Jul 6 23:32:43 2024 +0800 + + [version.syn] Remove redundant for __cpp_lib_ranges_enumerate (#7120) + + commit 15b7ea6c95e471888cda2c334ba8ac30cabccf64 + Author: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> + Date: Sun Jul 7 10:23:09 2024 +0200 + + [basic.start.main] fix definite article (#7121) + + commit 61d85d3f9b78d792bd1bdb1d15202f9cdd931b31 + Author: Thomas Köppe + Date: Tue Jul 9 00:57:58 2024 +0100 + + [intro.compliance.general] Cite Annex B more normatively. + + commit 2048179f82bbe92dcccee3cc6bbdac4973c77606 + Author: Thomas Köppe + Date: Tue Jul 9 01:25:28 2024 +0100 + + [intro.compliance.general] Cite Annex D more normatively. + + commit 6b67a856495634df3a0bd0d8abee36eb0d3c8c6f + Author: Andreas Krug <153394595+Andreas-Krug@users.noreply.github.com> + Date: Tue Jul 9 08:29:50 2024 +0200 + + [temp.inst] Fix definite article + + commit 43c47b42fd1f7cd4d095299aca98666c06e45949 + Author: Thomas Köppe + Date: Tue Jul 9 01:44:08 2024 +0100 + + [uaxid] Clarify that requirements come "from UAX #31", and use "this document". + + commit 7c35cb057ef4885e091bf65c1103d64946e7c8d1 + Author: Thomas Köppe + Date: Tue Jul 9 14:47:10 2024 +0100 + + [std] Make bibliography reference link colour more citely + + commit bc2c80c23133a0581a847bd7fcfaca621ca86ffe + Author: Jens Maurer + Date: Mon May 13 20:17:21 2024 +0200 + + [dcl.init.list] Add commas and period for bulleted list + + Fixes ISO/CS comment (C++23 proof) + + commit 868db7356ad1490890391e8c82888de5c4d4aad4 + Author: Jens Maurer + Date: Mon May 13 20:18:20 2024 +0200 + + [facet.num.get.virtuals] Add missing punctuation + + Fixes ISO/CS comment (C++23 proof) + + commit 77ee6ed3b8865b2bb514cb8446488aa6fb032dda + Author: Jens Maurer + Date: Mon May 13 23:39:13 2024 +0200 + + [lex.literal] Properly format table headings + + Fixes ISO/CS comment (C++23 proof) + + commit cb9850377b88a4d7da12d05bcdf11948c384f699 + Author: Jens Maurer + Date: Mon May 13 23:47:55 2024 +0200 + + [basic.fundamental] Center second column of "integer width" table + + Fixes ISO/CS comment (C++23 proof) + + commit 2a2b8732e0d81dd9f5d3880b70bd451173e5f5fc + Author: Thomas Köppe + Date: Tue Jul 9 15:41:56 2024 +0100 + + [intro.defs] Minor rewording. Avoid sounding like a requirement. + + commit 4746925c7117015480542fd68ad5f595b78173d2 + Author: Jens Maurer + Date: Tue May 14 14:11:53 2024 +0200 + + [numeric.limits.members,bibliography] Remove LIA-1 abbreviation for ISO 10967 + + Fixes ISO/CS comment (C++23 proof) + + commit c18d51ddf436abf39065ea86497161383bba11c0 + Author: Jens Maurer + Date: Wed May 15 09:05:36 2024 +0200 + + [intro.memory] Move footnote about Unicode trademark to [lex.phases] + + Fixes ISO/CS comment (C++23 proof) + + commit 1f32f6aa8000f194f1b5c4daba94d271eea817fb + Author: Jens Maurer + Date: Wed May 15 16:28:34 2024 +0200 + + [diff,bibliography] Move details of old C++ standards to the bibliography + + Fixes ISO/CS comment (C++23 proof) + + commit d5410b4035e3108d48a63434abfff7e377c996d2 + Author: Jens Maurer + Date: Wed May 15 18:31:14 2024 +0200 + + [diff.cpp20,diff.cpp17] Add missing inclusion clause + + commit af4cf904c3d2df0675dbd456af2de2f1259e370c + Author: Jens Maurer + Date: Thu May 16 12:56:12 2024 +0200 + + [std] Rename 'In general' headings to 'General' for consistency + + Fixes ISO/CS comment (C++23 proof) + + commit 9d3011b4224bb63636f4a117967e8ba8110f5ba4 + Author: Jens Maurer + Date: Fri May 17 14:11:48 2024 +0200 + + [implimits] Rephrase introductory sentence for list of quantities + + Fixes ISO/CS comment (C++23 proof) + + commit 260d3a0d0cde1431dd4221115e1b37979ee07e7d + Author: Jens Maurer + Date: Thu May 16 12:30:44 2024 +0200 + + [class.copy.ctor] Remove reference to non-existing example + + Fixes ISO/CS comment (C++23 proof) + + commit 0bc3e030be28ff2191af8e9c9c202bff6e23c320 + Author: Jens Maurer + Date: Thu May 16 12:37:12 2024 +0200 + + [class.conv.general] Remove vague reference to unhelpful examples + + Fixes ISO/CS comment (C++23 proof) + + commit 861f07de24c5cfbd69840038d8589bc13b24b7e7 + Author: Jens Maurer + Date: Wed May 15 21:58:36 2024 +0200 + + [cpp.predefined,namespace.future,version.syn] Replace 'C++' with 'this document' + + Fixes ISO/CS comment (C++23 proof) + + commit a7a2cbd10ea752d49ca286e3fea3e7cbbb9b6e9d + Author: Jens Maurer + Date: Fri May 17 00:44:32 2024 +0200 + + [futures.state] Turn note into example + + Fixes ISO/CS comment (C++23 proof) + + commit 88c48bb78815576fb20db42b89f381c580d28b0e + Author: Jens Maurer + Date: Tue May 14 22:41:24 2024 +0200 + + [std] Remove colons in front of bulleted lists + + commit 9d7aa6108b84a09117463d0b13bc24cf61926897 + Author: Jens Maurer + Date: Tue May 14 22:47:38 2024 +0200 + + [iterators] Add colon after 'model ... only if' when complete sentences follow + + commit 79ac47f7053da4ef20c117e282377591d028e7a5 + Author: Jens Maurer + Date: Wed May 15 21:42:09 2024 +0200 + + [basic.fundamental,cstdarg.syn] Use full reference for ISO C sections + + Fixes ISO/CS comment (C++23) + + commit 2bbf136502811925250b09fd73909b78e0236091 + Author: Jens Maurer + Date: Thu May 16 12:51:32 2024 +0200 + + [execpol.general] Use 'this document', not 'this standard' + + Fixes ISO/CS comment (C++23 proof) + + commit e65393f3c87d323258e38c498b849dc57404a20b + Author: Jens Maurer + Date: Wed May 15 22:13:14 2024 +0200 + + [format.string.std] Add (R) symbol after Windows + + Fixes ISO/CS comment (C++23 proof) + + commit dafefea895de358b8edcb6780e3c7b71d209b458 + Author: Jens Maurer + Date: Tue May 14 19:12:57 2024 +0200 + + [rand.req] Replace 'that Table' with a precise reference + + Fixes ISO/CS comment (C++23 proof) + + commit 361e7769a245aad263574bbe83b9266d8da3b01b + Author: Jens Maurer + Date: Fri May 17 09:42:22 2024 +0200 + + [std] Replace 'this standard' with 'this document' + + Fixes ISO/CS comment (C++23 proof) + + commit e86031dd14e052956fc23ec4dbc1510b7438ba5b + Author: Jens Maurer + Date: Mon May 13 23:19:57 2024 +0200 + + [time.format,time.parse] Fix references to ISO week calendar + + Fixes ISO/CS comment (C++23 proof) + + commit 868b0b29ac16370ed8792442a0ab41be91c5d575 + Author: Jens Maurer + Date: Mon May 13 19:01:05 2024 +0200 + + [std] Avoid hanging paragraphs by introducing "General" subclauses + + Fixes ISO/CS comment (C++23 proof) + + commit f0580700cf0e8e920ceb3a078b6872a4c16fa225 + Author: Jens Maurer + Date: Wed May 15 21:49:31 2024 +0200 + + [std] Remove ISO from any mention of 'C' + + Fixes ISO/CS comment (C++23 proof) + + commit 69f184ea599635dac4cd9dc06a3303bed93b26f7 + Author: Jens Maurer + Date: Mon May 13 19:30:38 2024 +0200 + + [std] Remove mid-sentence 'subclause' introducer + + Fixes ISO/CS comment (C++23 proof) + + commit ecb071672b02a4b7bc829f87433d98785d9dd701 + Author: Jens Maurer + Date: Mon May 13 19:44:40 2024 +0200 + + [std] Remove incorrect or duplicative 'this subclause' introducers + + Fixes ISO/CS comment (C++23 proof) + + commit a249f9f37531fe79e768f19a45f1b1a70685c2c6 + Author: Thomas Köppe + Date: Tue Jul 9 22:48:20 2024 +0100 + + [classes] Turn ad-hoc examples into proper examples (#7125) + + commit eade3851e174ac014b478b8d4f097103d3b996ae + Author: Jens Maurer + Date: Thu May 16 12:44:01 2024 +0200 + + [lex.ccon,expr.prim.lambda.capture] Excise 'ISO' prefix + + Fixes ISO/CS comment (C++23 proof) + + commit 5383169856690cf05d946f058ed861119405d126 + Author: Jens Maurer + Date: Thu May 16 14:32:49 2024 +0200 + + [fs.class.path.general] Defuse cross-reference to POSIX + + Fixes ISO/CS comment (C++23 proof) + + commit 5731ab6a9122763bf6193d1382a05c7bebe82b38 + Author: Thomas Köppe + Date: Tue Jul 9 23:24:09 2024 +0100 + + [time.format] Remove mid-sentence 'subclause' introducer from external reference + + commit 856d175973d343d8e16d641221f47357672d9959 + Author: Jens Maurer + Date: Fri May 17 14:26:54 2024 +0200 + + [lib] Excise Note A, Note B, etc. designations + + Fixes ISO/CS comment (C++23 proof) + + commit 5508a007540d790a8f5cd30f863f4d329edf2694 + Author: Jens Maurer + Date: Thu May 16 15:07:27 2024 +0200 + + [macros,numerics] Add and use numbered 'formula' environment + + Fixes ISO/CS comment (C++23 proof) + + commit 2b0ff8d6bd285bbe8b27fdab47e268b115a3f930 + Author: Thomas Köppe + Date: Wed Jul 10 11:33:23 2024 +0100 + + [lex.string] Replace colon with full stop to end the sentence. + + On request of ISO/CS, for otherwise we should have made the next 'if' + lowercase, because: "Grammatically this is the same sentence, + as there is no full stop, so the 'if' should be lowercase." + + If a colon really doesn't end a sentence, then we should make it so + that the sentence really does end. + + commit 064fb0b34eb8cbb14f52dc966c833ef7c749c82c + Author: Jens Maurer + Date: Tue May 14 08:23:07 2024 +0200 + + [macros] Prefer page break above 'note' or 'example' introducers + + Fixes ISO/CS comment (C++23 proof) + + commit 13b08d0f58dfea7ae2e19b1d931094d4523a52d2 + Author: Thomas Köppe + Date: Thu Jul 11 01:41:29 2024 +0100 + + [layout, styles] New ISO header and footer layout. + + The footer now takes up two lines, one for the copyright and one for + the page number. + + commit 7f6069c794abb56e51affdc2923e3d33b3a547a8 + Author: Thomas Köppe + Date: Thu Jul 11 12:27:28 2024 +0100 + + [cover-reg] Update regular cover + + commit f41a619cf852ae638bfe4792ec78ac1f214a7d23 + Author: Thomas Köppe + Date: Fri Jul 12 01:28:38 2024 +0100 + + [impldefindex] Reinstate full page mark + + As of 13b08d0f58dfea7ae2e19b1d931094d4523a52d2 we have space for it. + + commit b2870b5c87765946f5c4a644da508adcc483045e + Author: Thomas Köppe + Date: Fri Jul 12 01:30:06 2024 +0100 + + [macros, std] Create macros for ISO/IEC 60559 and ISO/IEC/IEEE 9945. + + As a side effect, this corrects the title of ISO/IEC 60559(:2020), + whose previous version was ISO/IEC/IEEE 60559:2011. diff --git a/papers/wd-index.md b/papers/wd-index.md index 19b0d4c6a9..6a8961ccc1 100644 --- a/papers/wd-index.md +++ b/papers/wd-index.md @@ -49,3 +49,4 @@ * [N4964](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4964.pdf) 2023-10 C++ Working Draft * [N4971](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/n4971.pdf) 2023-12 C++ Working Draft * [N4981](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4981.pdf) 2024-03 C++ Working Draft + * [N4986](http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2024/n4986.pdf) 2024-06 C++ Working Draft diff --git a/source/config.tex b/source/config.tex index be1743a556..bd8cc0fbc2 100644 --- a/source/config.tex +++ b/source/config.tex @@ -1,7 +1,7 @@ %!TEX root = std.tex %%-------------------------------------------------- %% Version numbers -\newcommand{\docno}{Dxxxx} +\newcommand{\docno}{N4986} \newcommand{\prevdocno}{N4981} \newcommand{\cppver}{202302L}