From 7ade52d1569eb9f90c5dce5aa3c7451d767cb00c Mon Sep 17 00:00:00 2001 From: Davis Herring Date: Thu, 26 Mar 2020 13:59:18 -0600 Subject: [PATCH 001/250] [basic.link] Add word missing from P1815R2 --- source/basic.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index 0f96f7822c..7b571a9201 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -2970,7 +2970,7 @@ \begin{itemize} \item it is, or is a pointer to, -a TU-local function or the object associated with a TU-local variable, +a TU-local function or the object associated with a TU-local variable, or \item it is an object of class or array type and any of its subobjects or From b608f052a605e970ce67e1b1766ec1d4d1555dc7 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 3 Apr 2020 21:44:35 -0400 Subject: [PATCH 002/250] [over.match.class.deduct] Fix self-referential cross-references --- source/overloading.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/overloading.tex b/source/overloading.tex index 64db8a9e2b..dc6fbb5eaa 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -1643,12 +1643,12 @@ the arguments of \tcode{A} are deducible (see below) from the return type. \item -If \tcode{f} is a copy deduction candidate\iref{over.match.class.deduct}, +If \tcode{f} is a copy deduction candidate, then \tcode{f'} is considered to be so as well. \item If \tcode{f} was generated -from a \grammarterm{deduction-guide}\iref{over.match.class.deduct}, +from a \grammarterm{deduction-guide}\iref{temp.deduct.guide}, then \tcode{f'} is considered to be so as well. \item From a1851d62b47b7ac9a652bb19038ae74d48cdfacc Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Thu, 9 Apr 2020 02:19:51 -0400 Subject: [PATCH 003/250] [dcl.fct] Fix incorrectly pluralized grammar terms (#3926) --- source/declarations.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index be7d23d077..d9207556a0 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -3664,9 +3664,9 @@ \pnum An abbreviated function template can have a \grammarterm{template-head}. -The invented \grammarterm{template-parameters} are +The invented \grammarterm{template-parameter}{s} are appended to the \grammarterm{template-parameter-list} after -the explicitly declared \grammarterm{template-parameters}. +the explicitly declared \grammarterm{template-parameter}{s}. \begin{example} \begin{codeblock} template concept C = /* ... */; From 04e473c929cac0c46ea9f0984cd567b0e5162b3f Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 10 Apr 2020 03:59:18 -0400 Subject: [PATCH 004/250] [dcl.fct.def] Fix incorrect cross-reference referring to "this" (#3925) --- source/declarations.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/declarations.tex b/source/declarations.tex index d9207556a0..509eb4e400 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -5945,7 +5945,7 @@ \pnum \begin{note} A \grammarterm{cv-qualifier-seq} affects the type of \tcode{this} -in the body of a member function; see~\ref{dcl.ref}. +in the body of a member function; see~\ref{expr.prim.this}. \end{note} \pnum From ebaf8f903ce3f66d26c8882f605abcfe08ce8ec3 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Fri, 10 Apr 2020 04:10:51 -0400 Subject: [PATCH 005/250] [class.temporary, expr, dcl.ref] Fix incorrect cross-references for decltype (#3918) --- source/basic.tex | 2 +- source/declarations.tex | 6 +++--- source/expressions.tex | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 7b571a9201..1bb35a3f4a 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -4310,7 +4310,7 @@ This includes accessibility\iref{class.access} and whether it is deleted, for the constructor selected and for the destructor. However, in the special case of the operand of a -\grammarterm{decltype-specifier}\iref{expr.call}, no temporary is introduced, +\grammarterm{decltype-specifier}\iref{dcl.type.decltype}, no temporary is introduced, so the foregoing does not apply to such a prvalue. \end{note} diff --git a/source/declarations.tex b/source/declarations.tex index 509eb4e400..22e0824e7d 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -1994,7 +1994,7 @@ \opt{\grammarterm{type-constraint}} \tcode{decltype(auto)}, \tcode{T} shall be the placeholder alone. The type deduced for \tcode{T} is -determined as described in~\ref{dcl.type.simple}, as though +determined as described in~\ref{dcl.type.decltype}, as though $E$ had been the operand of the \tcode{decltype}. \begin{example} @@ -2737,7 +2737,7 @@ Cv-qualified references are ill-formed except when the cv-qualifiers are introduced through the use of a \grammarterm{typedef-name}~(\ref{dcl.typedef}, \ref{temp.param}) or -\grammarterm{decltype-specifier}\iref{dcl.type.simple}, +\grammarterm{decltype-specifier}\iref{dcl.type.decltype}, in which case the cv-qualifiers are ignored. \begin{example} \begin{codeblock} @@ -2864,7 +2864,7 @@ \pnum \indextext{reference collapsing}% If a \grammarterm{typedef-name}~(\ref{dcl.typedef}, \ref{temp.param}) -or a \grammarterm{decltype-specifier}\iref{dcl.type.simple} denotes a type \tcode{TR} that +or a \grammarterm{decltype-specifier}\iref{dcl.type.decltype} denotes a type \tcode{TR} that is a reference to a type \tcode{T}, an attempt to create the type ``lvalue reference to \cv{}~\tcode{TR}'' creates the type ``lvalue reference to \tcode{T}'', while an attempt to create the type ``rvalue reference to \cv{}~\tcode{TR}'' creates the type \tcode{TR}. diff --git a/source/expressions.tex b/source/expressions.tex index 50e48c1ff7..53dac140b0 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -266,7 +266,7 @@ and rvalues in other significant contexts. \pnum -Unless otherwise indicated\iref{dcl.type.simple}, +Unless otherwise indicated\iref{dcl.type.decltype}, a prvalue shall always have complete type or the \tcode{void} type; if it has a class type or (possibly multi-dimensional) array of class type, that class shall not be an abstract class\iref{class.abstract}. @@ -417,7 +417,7 @@ \ref{expr.typeid}, \ref{expr.sizeof}, \ref{expr.unary.noexcept}, -\ref{dcl.type.simple}, +\ref{dcl.type.decltype}, \ref{temp.pre}, \ref{temp.concept}). An unevaluated operand is not evaluated. From de368c6eca968106d3d4bb1adf44f10da384cb94 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Sat, 21 Mar 2020 18:46:07 -0700 Subject: [PATCH 006/250] [iterator.synopsis] move_iterator non-member operator+ should agree with [move.iter.nonmember] P0896R4 changed the declaration in [move.iter.nonmember], but failed to update the header synopsis. --- source/iterators.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index b5b3ce60f9..387a3b0da9 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -361,8 +361,8 @@ const move_iterator& x, const move_iterator& y) -> decltype(x.base() - y.base()); template - constexpr move_iterator operator+( - typename move_iterator::difference_type n, const move_iterator& x); + constexpr move_iterator + operator+(iter_difference_t n, const move_iterator& x); template constexpr move_iterator make_move_iterator(Iterator i); From 6a596ae931a59dbc79156b645d452f4a9a035161 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Wed, 25 Mar 2020 11:26:36 -0700 Subject: [PATCH 007/250] [iterator.synopsis,move.iter.nonmember] Harmonize formatting of operator-(move_iterator, move_iterator) --- source/iterators.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index 387a3b0da9..0cef2b207e 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -358,8 +358,8 @@ template constexpr auto operator-( - const move_iterator& x, - const move_iterator& y) -> decltype(x.base() - y.base()); + const move_iterator& x, const move_iterator& y) + -> decltype(x.base() - y.base()); template constexpr move_iterator operator+(iter_difference_t n, const move_iterator& x); @@ -4497,9 +4497,9 @@ \indexlibrarymember{operator-}{move_iterator}% \begin{itemdecl} template - constexpr auto operator-(const move_iterator& x, - const move_iterator& y) - -> decltype(x.base() - y.base()); + constexpr auto operator-( + const move_iterator& x, const move_iterator& y) + -> decltype(x.base() - y.base()); template<@\libconcept{sized_sentinel_for}@ S> friend constexpr iter_difference_t operator-(const move_sentinel& x, const move_iterator& y); From bdc6db78e4aced5b91d6c1b5c44d05b03baec082 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 17 Apr 2020 00:43:20 +0200 Subject: [PATCH 008/250] [depr.strstream] Fix typography for NTBS in index. (#3942) --- source/future.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/future.tex b/source/future.tex index e0fcf48131..67cc38e89e 100644 --- a/source/future.tex +++ b/source/future.tex @@ -1163,7 +1163,7 @@ Initializes the base class with \tcode{istream(\&sb)} and \tcode{sb} with \tcode{strstreambuf(s, 0)}. \tcode{s} shall designate the first element of an \ntbs{}.% -\indextext{NTBS} +\indextext{NTBS@\ntbs{}} \end{itemdescr} \indexlibraryctor{istrstream}% @@ -1279,7 +1279,7 @@ \tcode{(mode \& app) != 0}, then \tcode{s} shall designate the first element of an array of \tcode{n} elements that contains an \ntbs{} whose first element is designated by \tcode{s}. -\indextext{NTBS}% +\indextext{NTBS@\ntbs{}}% The constructor is \tcode{strstreambuf(s, n, s + std::strlen(s))}.\footnote{The function signature \indexlibraryglobal{strlen}% From c11caa42c9d38473134cfe6f351103bd4a9d1044 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 19 Apr 2020 20:49:14 +0200 Subject: [PATCH 009/250] [depr.atomics] Fix header name. (#3948) The typo was introduced in commit bbb46260d5dd0bb8b561cc74f929ac9a982629a9 while applying P0883R2 Fixing Atomic Initialization. --- source/future.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/future.tex b/source/future.tex index 67cc38e89e..294144cca4 100644 --- a/source/future.tex +++ b/source/future.tex @@ -2658,7 +2658,7 @@ \rSec1[depr.atomics]{Deprecated atomic operations} \pnum -The header \libheaderref{atomics} has the following additions. +The header \libheaderrefx{atomic}{atomics.syn} has the following additions. \begin{codeblock} namespace std { From b890578b59573b91b0074ca79fcd2ba5f3756013 Mon Sep 17 00:00:00 2001 From: Alberto Barbati <2210776+iaanus@users.noreply.github.com> Date: Thu, 23 Apr 2020 20:39:19 +0200 Subject: [PATCH 010/250] [format.syn] Add missing reference to [format.context] in header synopsis (#3954) --- source/utilities.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/utilities.tex b/source/utilities.tex index 27abe5506e..e22e6db810 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -19125,6 +19125,7 @@ using format_parse_context = basic_format_parse_context; using wformat_parse_context = basic_format_parse_context; + // \ref{format.context}, class template \tcode{basic_format_context} template class basic_format_context; using format_context = basic_format_context<@\unspec@, char>; using wformat_context = basic_format_context<@\unspec@, wchar_t>; From d11a2564b34cfa0fa6f7b39755cb5a2a205bdf77 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Sun, 3 May 2020 16:36:34 -0400 Subject: [PATCH 011/250] [namespace.qual] Add missing \tcode formatting to X (#3975) --- source/basic.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index 1bb35a3f4a..b001eb0dba 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -2212,7 +2212,7 @@ \pnum Given \tcode{X::m} (where \tcode{X} is a user-declared namespace), or -given \tcode{::m} (where X is the global namespace), if +given \tcode{::m} (where \tcode{X} is the global namespace), if $S(X, m)$ is the empty set, the program is ill-formed. Otherwise, if $S(X, m)$ has exactly one member, or if the context of the reference is a \grammarterm{using-declaration}\iref{namespace.udecl}, $S(X, m)$ From 9440e380714ea1c30f02e90e33803cdb381b40a2 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Sun, 3 May 2020 16:41:55 -0400 Subject: [PATCH 012/250] [over.ics.ref] Remove erroneous capitalization (#3972) --- source/overloading.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/overloading.tex b/source/overloading.tex index dc6fbb5eaa..99e924d21b 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -2515,7 +2515,7 @@ argument expression, the implicit conversion sequence is the identity conversion, unless the argument expression has a type that is a derived class of the parameter type, in which case the implicit conversion sequence is a derived-to-base -Conversion\iref{over.best.ics}. +conversion\iref{over.best.ics}. \begin{example} \begin{codeblock} struct A {}; From aaa5dac87325e2bb2ff09f6a955217e2b751311b Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Sun, 3 May 2020 13:55:00 -0700 Subject: [PATCH 013/250] [meta.trans.other] "C++ object type" is overly precise (#3969) ... suggesting that the more common plain "object type" means something different. --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index e22e6db810..8caf441d30 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -17476,7 +17476,7 @@ struct aligned_storage;} & The value of \textit{default-alignment} shall be the most - stringent alignment requirement for any \Cpp{} object type whose size + stringent alignment requirement for any object type whose size is no greater than \tcode{Len}\iref{basic.types}. The member typedef \tcode{type} shall be a trivial standard-layout type suitable for use as uninitialized storage for any object whose size From 4d2e04b92ff5b90303fd1cb9742bc6e20b20cce2 Mon Sep 17 00:00:00 2001 From: tschuett Date: Mon, 4 May 2020 19:21:10 +0200 Subject: [PATCH 014/250] Allow 'listings' package v1.8d (#3979) --- source/styles.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/styles.tex b/source/styles.tex index 83af976ff7..a5dd6c9ee9 100644 --- a/source/styles.tex +++ b/source/styles.tex @@ -142,13 +142,13 @@ %% (copied verbatim from listings.sty version 1.6 except where commented) \makeatletter -\lst@CheckVersion{1.8c}{\lst@CheckVersion{1.8b}{\lst@CheckVersion{1.7}{\lst@CheckVersion{1.6}{\lst@CheckVersion{1.5b}{ +\lst@CheckVersion{1.8d}{\lst@CheckVersion{1.8c}{\lst@CheckVersion{1.8b}{\lst@CheckVersion{1.7}{\lst@CheckVersion{1.6}{\lst@CheckVersion{1.5b}{ \typeout{^^J% ***^^J% *** This file requires listings.sty version 1.6.^^J% *** You have version \lst@version; exiting ...^^J% ***^^J}% - \batchmode \@@end}}}}} + \batchmode \@@end}}}}}} \def\lst@Init#1{% \begingroup From 32281d56e0ab5c1ce9d260987898c3e760f80950 Mon Sep 17 00:00:00 2001 From: cor3ntin Date: Wed, 6 May 2020 19:35:40 +0200 Subject: [PATCH 015/250] [range.elements.iterator] Fix typo in declaration of operator<= (#3981) --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index bdcd1dd54f..2b83bc3dc6 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -6371,7 +6371,7 @@ requires @\libconcept{random_access_range}@<@\exposid{Base}@>; friend constexpr bool operator>(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) requires @\libconcept{random_access_range}@<@\exposid{Base}@>; - friend constexpr bool operator<=(const @\exposid{iterator}@& y, const @\exposid{iterator}@& y) + friend constexpr bool operator<=(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) requires @\libconcept{random_access_range}@<@\exposid{Base}@>; friend constexpr bool operator>=(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) requires @\libconcept{random_access_range}@<@\exposid{Base}@>; From b1b1ea47f5266c347e8b8e872921116f512b8dc6 Mon Sep 17 00:00:00 2001 From: NinaRanns <57705710+NinaRanns@users.noreply.github.com> Date: Tue, 12 May 2020 19:50:45 +0200 Subject: [PATCH 016/250] [common.iter.cust] Pluralize subclause heading (#3995) to match [counted.iter.cust] --- source/iterators.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iterators.tex b/source/iterators.tex index 0cef2b207e..92bd0723c5 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -5058,7 +5058,7 @@ $i$ is \tcode{x.v_.index()} and $j$ is \tcode{y.v_.index()}. \end{itemdescr} -\rSec3[common.iter.cust]{Customization} +\rSec3[common.iter.cust]{Customizations} \indexlibrarymember{iter_move}{common_iterator}% \begin{itemdecl} From a4967d41be0527f689d6c6232d02ab6012ea3830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Sun, 17 May 2020 15:47:04 -0400 Subject: [PATCH 017/250] [atomics.types.operations] Fix typo in exposition-only code (#4001) Fixes NB JP 010 (C++20 DIS) --- source/atomics.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/atomics.tex b/source/atomics.tex index 9ad8f7e20b..45752b2680 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -1907,7 +1907,7 @@ if (memcmp(this, &expected, sizeof(*this)) == 0) memcpy(this, &desired, sizeof(*this)); else - memcpy(expected, this, sizeof(*this)); + memcpy(&expected, this, sizeof(*this)); \end{codeblock} \end{note} \begin{example} From 040f0a01d7ea1ee0315e830b0a7a135f03a2efd2 Mon Sep 17 00:00:00 2001 From: Sergey Zubkov Date: Mon, 18 May 2020 18:21:03 -0400 Subject: [PATCH 018/250] [class.temporary] Omit hyphen from "trivially copyable" (#4002) --- source/basic.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index b001eb0dba..cf98384097 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -4294,7 +4294,7 @@ \item when a prvalue is converted to an xvalue\iref{conv.rval}, \item -when needed by the implementation to pass or return an object of trivially-copyable type (see below), +when needed by the implementation to pass or return an object of trivially copyable type (see below), and \item when throwing an exception\iref{except.throw}. From 7bfdad040dd9fbb1a15554ea364ddf0445efa0ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Sat, 23 May 2020 04:39:07 -0400 Subject: [PATCH 019/250] [range.single.view] Add missing requires-clause to \itemdecl (#4009) --- source/ranges.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/ranges.tex b/source/ranges.tex index 2b83bc3dc6..a6836b9abc 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1940,6 +1940,7 @@ \indexlibraryctor{single_view}% \begin{itemdecl} template + requires @\libconcept{constructible_from}@ constexpr single_view(in_place_t, Args&&... args); \end{itemdecl} From 86ce85d929a1d9f69f5c64895f4b0b60afb38c53 Mon Sep 17 00:00:00 2001 From: frederick-vs-ja Date: Sat, 23 May 2020 16:47:59 +0800 Subject: [PATCH 020/250] [thread.syn] Do not mandate including when including (#3991) This was accidentally introduced while applying LWG3330 Include from most library headers. --- source/threads.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/source/threads.tex b/source/threads.tex index cccf77df5b..27f6a73bd1 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -966,7 +966,6 @@ \indexheader{thread}% \begin{codeblock} #include // see \ref{compare.syn} -#include // see \ref{initializer.list.syn} namespace std { class thread; From 99302851dff1fb8f48082e436ce71ebf4aac4d5e Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 23 May 2020 10:55:08 +0200 Subject: [PATCH 021/250] [vector.capacity] Remove duplicate \pnum (#3983) Also prevent future occurrences by updating check.sh --- source/containers.tex | 2 +- tools/check.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index c01656a9f0..f95d17cf94 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -5947,11 +5947,11 @@ \begin{itemdescr} \pnum -\pnum \expects \tcode{T} is \oldconcept{CopyInsertable} into \tcode{*this}. +\pnum \effects If \tcode{sz < size()}, erases the last \tcode{size() - sz} elements from the sequence. Otherwise, diff --git a/tools/check.sh b/tools/check.sh index e83f14591d..0a75efeb22 100755 --- a/tools/check.sh +++ b/tools/check.sh @@ -27,6 +27,11 @@ grep -ne '^.\+\\pnum' $texfiles && exit 1 grep -ne '\\pnum.\+$' $texfiles && exit 1 # Fixup: sed '/\\pnum.\+$/s/\\pnum\s*/\\pnum\n/' +# Two consecutive \pnum +for f in $texfiles; do + awk 'prev == $0 && /^\\pnum/ { print FILENAME ":" FNR ": duplicate \pnum on consecutive lines" } { prev = $0 }' $f +done | grep . && exit 1 + # \opt used incorrectly. grep -n '\\opt[^{]' $texfiles && exit 1 grep -n 'opt{}' *.tex && exit 1 From 61a614c61ed318da609e4f44c6caafdd34ffd2b8 Mon Sep 17 00:00:00 2001 From: Eelis Date: Fri, 29 May 2020 21:01:26 +0200 Subject: [PATCH 022/250] [iterator.concept.forward] Undo spurious list item capitalization. (#4017) --- source/iterators.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iterators.tex b/source/iterators.tex index 92bd0723c5..4a81f627ba 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1706,7 +1706,7 @@ offer the \defn{multi-pass guarantee} if: \begin{itemize} \item \tcode{a == b} implies \tcode{++a == ++b} and -\item The expression +\item the expression \tcode{((void)[](X x)\{++x;\}(a), *a)} is equivalent to the expression \tcode{*a}. \end{itemize} From 8f5b9c26f214517843550ae6a3c4ce46be92820c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Tue, 2 Jun 2020 05:45:38 -0400 Subject: [PATCH 023/250] [algorithms.general] Add [algorithms.results] to summary table (#4020) --- source/algorithms.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index f33175aa9d..6ff786f7f1 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -18,7 +18,8 @@ \begin{libsumtab}{Algorithms library summary}{algorithms.summary} \ref{algorithms.requirements} & Algorithms requirements & \\ \ref{algorithms.parallel} & Parallel algorithms & \\ \rowsep -\ref{alg.nonmodifying} & Non-modifying sequence operations & \tcode{} \\ +\ref{algorithms.results} & Algorithm result types & \tcode{} \\ +\ref{alg.nonmodifying} & Non-modifying sequence operations & \\ \ref{alg.modifying.operations} & Mutating sequence operations & \\ \ref{alg.sorting} & Sorting and related operations & \\ \rowsep \ref{numeric.ops} & Generalized numeric operations & \tcode{} \\ \rowsep From 137ab4e419164bb422e9a1476cfc5bb59236b542 Mon Sep 17 00:00:00 2001 From: FrankHB Date: Fri, 5 Jun 2020 14:27:10 +0800 Subject: [PATCH 024/250] [unique.ptr.runtime.asgn] Fix missing space (#4023) --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index 8caf441d30..b3a60d6418 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -9223,7 +9223,7 @@ \indexlibrarymember{operator=}{unique_ptr}% \begin{itemdecl} -template unique_ptr& operator=(unique_ptr&& u)noexcept; +template unique_ptr& operator=(unique_ptr&& u) noexcept; \end{itemdecl} \begin{itemdescr} From 30d6063428eef735a2aee66924f991a51aa23fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Tue, 9 Jun 2020 02:37:32 -0400 Subject: [PATCH 025/250] [ranges.general] Capitalize the word 'clause' (#4029) --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index a6836b9abc..8b3e676f43 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -4,7 +4,7 @@ \rSec1[ranges.general]{General} \pnum -This clause describes components for dealing with ranges of elements. +This Clause describes components for dealing with ranges of elements. \pnum The following subclauses describe From c1a60ab76155a6233e0828792b097160ae462f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Tue, 9 Jun 2020 02:37:50 -0400 Subject: [PATCH 026/250] [iterator.concept.winc] Format 'I' in code font (#4027) --- source/iterators.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iterators.tex b/source/iterators.tex index 4a81f627ba..c0324dbd7e 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1419,7 +1419,7 @@ \tcode{\exposid{is-integer-like}} is \tcode{true} if and only if \tcode{I} is an integer-like type. \tcode{\exposid{is-signed-integer-like}} is \tcode{true} -if and only if I is a signed-integer-like type. +if and only if \tcode{I} is a signed-integer-like type. \pnum Let \tcode{i} be an object of type \tcode{I}. When \tcode{i} is in the domain of From 3d4398394fd596a50bf6df4aade93f374b0d8d38 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 9 Jun 2020 08:52:48 +0200 Subject: [PATCH 027/250] [iterator.synopsis] Fix indexing targets for singular sentinels. (#4030) --- source/iterators.tex | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index c0324dbd7e..2b07e0234c 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -30,8 +30,6 @@ \rSec1[iterator.synopsis]{Header \tcode{}\ synopsis} \indexheader{iterator}% -\indexlibraryglobal{default_sentinel}% -\indexlibraryglobal{unreachable_sentinel}% \begin{codeblock} #include // see \ref{compare.syn} #include // see \ref{concepts.syn} @@ -382,7 +380,7 @@ // \ref{default.sentinels}, default sentinels struct default_sentinel_t; - inline constexpr default_sentinel_t default_sentinel{}; + inline constexpr default_sentinel_t @\libglobal{default_sentinel}@{}; // \ref{iterators.counted}, counted iterators template<@\libconcept{input_or_output_iterator}@ I> class counted_iterator; @@ -395,7 +393,7 @@ // \ref{unreachable.sentinels}, unreachable sentinels struct unreachable_sentinel_t; - inline constexpr unreachable_sentinel_t unreachable_sentinel{}; + inline constexpr unreachable_sentinel_t @\libglobal{unreachable_sentinel}@{}; // \ref{stream.iterators}, stream iterators template, From 90e686f48cbd1cdf2bf92d01972f978fee2957e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Thu, 11 Jun 2020 02:12:58 -0400 Subject: [PATCH 028/250] [refwrap] Add blank line between class definition and deduction guide (#4036) --- source/utilities.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/utilities.tex b/source/utilities.tex index b3a60d6418..4e81905cd2 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -13374,6 +13374,7 @@ template constexpr invoke_result_t operator()(ArgTypes&&...) const; }; + template reference_wrapper(T&) -> reference_wrapper; } From 49472c22ac37a2c1c632b10879732a4a2ac6e8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Thu, 11 Jun 2020 02:16:54 -0400 Subject: [PATCH 029/250] [stopcallback] Fix indentation (#4040) --- source/threads.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 27f6a73bd1..782c3fd79f 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -850,10 +850,10 @@ // \ref{stopcallback.cons}, constructors and destructor template - explicit stop_callback(const stop_token& st, C&& cb) + explicit stop_callback(const stop_token& st, C&& cb) noexcept(is_nothrow_constructible_v); template - explicit stop_callback(stop_token&& st, C&& cb) + explicit stop_callback(stop_token&& st, C&& cb) noexcept(is_nothrow_constructible_v); ~stop_callback(); @@ -867,7 +867,7 @@ }; template - stop_callback(stop_token, Callback) -> stop_callback; + stop_callback(stop_token, Callback) -> stop_callback; } \end{codeblock} From 5acb34dbc470b1ce232137122e4db65739fc6889 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Thu, 11 Jun 2020 02:36:22 -0400 Subject: [PATCH 030/250] [string.view.template] Wrap synopsis in its namespace (#4038) --- source/strings.tex | 226 +++++++++++++++++++++++---------------------- 1 file changed, 114 insertions(+), 112 deletions(-) diff --git a/source/strings.tex b/source/strings.tex index f135dfd618..b56973b0b6 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -4020,119 +4020,121 @@ \indexlibrarymember{size_type}{basic_string_view}% \indexlibrarymember{difference_type}{basic_string_view}% \begin{codeblock} -template> -class basic_string_view { -public: - // types - using traits_type = traits; - using value_type = charT; - using pointer = value_type*; - using const_pointer = const value_type*; - using reference = value_type&; - using const_reference = const value_type&; - using const_iterator = @\impdefx{type of \tcode{basic_string_view::const_iterator}}@; // see \ref{string.view.iterators} - using iterator = const_iterator;@\footnote{Because \tcode{basic_string_view} refers to a constant sequence, \tcode{iterator} and \tcode{const_iterator} are the same type.}@ - using const_reverse_iterator = reverse_iterator; - using reverse_iterator = const_reverse_iterator; - using size_type = size_t; - using difference_type = ptrdiff_t; - static constexpr size_type npos = size_type(-1); - - // \ref{string.view.cons}, construction and assignment - constexpr basic_string_view() noexcept; - constexpr basic_string_view(const basic_string_view&) noexcept = default; - constexpr basic_string_view& operator=(const basic_string_view&) noexcept = default; - constexpr basic_string_view(const charT* str); - constexpr basic_string_view(const charT* str, size_type len); +namespace std { + template> + class basic_string_view { + public: + // types + using traits_type = traits; + using value_type = charT; + using pointer = value_type*; + using const_pointer = const value_type*; + using reference = value_type&; + using const_reference = const value_type&; + using const_iterator = @\impdefx{type of \tcode{basic_string_view::const_iterator}}@; // see \ref{string.view.iterators} + using iterator = const_iterator;@\footnote{Because \tcode{basic_string_view} refers to a constant sequence, \tcode{iterator} and \tcode{const_iterator} are the same type.}@ + using const_reverse_iterator = reverse_iterator; + using reverse_iterator = const_reverse_iterator; + using size_type = size_t; + using difference_type = ptrdiff_t; + static constexpr size_type npos = size_type(-1); + + // \ref{string.view.cons}, construction and assignment + constexpr basic_string_view() noexcept; + constexpr basic_string_view(const basic_string_view&) noexcept = default; + constexpr basic_string_view& operator=(const basic_string_view&) noexcept = default; + constexpr basic_string_view(const charT* str); + constexpr basic_string_view(const charT* str, size_type len); + template + constexpr basic_string_view(It begin, End end); + + // \ref{string.view.iterators}, iterator support + constexpr const_iterator begin() const noexcept; + constexpr const_iterator end() const noexcept; + constexpr const_iterator cbegin() const noexcept; + constexpr const_iterator cend() const noexcept; + constexpr const_reverse_iterator rbegin() const noexcept; + constexpr const_reverse_iterator rend() const noexcept; + constexpr const_reverse_iterator crbegin() const noexcept; + constexpr const_reverse_iterator crend() const noexcept; + + // \ref{string.view.capacity}, capacity + constexpr size_type size() const noexcept; + constexpr size_type length() const noexcept; + constexpr size_type max_size() const noexcept; + [[nodiscard]] constexpr bool empty() const noexcept; + + // \ref{string.view.access}, element access + constexpr const_reference operator[](size_type pos) const; + constexpr const_reference at(size_type pos) const; + constexpr const_reference front() const; + constexpr const_reference back() const; + constexpr const_pointer data() const noexcept; + + // \ref{string.view.modifiers}, modifiers + constexpr void remove_prefix(size_type n); + constexpr void remove_suffix(size_type n); + constexpr void swap(basic_string_view& s) noexcept; + + // \ref{string.view.ops}, string operations + constexpr size_type copy(charT* s, size_type n, size_type pos = 0) const; + + constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const; + + constexpr int compare(basic_string_view s) const noexcept; + constexpr int compare(size_type pos1, size_type n1, basic_string_view s) const; + constexpr int compare(size_type pos1, size_type n1, basic_string_view s, + size_type pos2, size_type n2) const; + constexpr int compare(const charT* s) const; + constexpr int compare(size_type pos1, size_type n1, const charT* s) const; + constexpr int compare(size_type pos1, size_type n1, const charT* s, size_type n2) const; + + constexpr bool starts_with(basic_string_view x) const noexcept; + constexpr bool starts_with(charT x) const noexcept; + constexpr bool starts_with(const charT* x) const; + constexpr bool ends_with(basic_string_view x) const noexcept; + constexpr bool ends_with(charT x) const noexcept; + constexpr bool ends_with(const charT* x) const; + + // \ref{string.view.find}, searching + constexpr size_type find(basic_string_view s, size_type pos = 0) const noexcept; + constexpr size_type find(charT c, size_type pos = 0) const noexcept; + constexpr size_type find(const charT* s, size_type pos, size_type n) const; + constexpr size_type find(const charT* s, size_type pos = 0) const; + constexpr size_type rfind(basic_string_view s, size_type pos = npos) const noexcept; + constexpr size_type rfind(charT c, size_type pos = npos) const noexcept; + constexpr size_type rfind(const charT* s, size_type pos, size_type n) const; + constexpr size_type rfind(const charT* s, size_type pos = npos) const; + + constexpr size_type find_first_of(basic_string_view s, size_type pos = 0) const noexcept; + constexpr size_type find_first_of(charT c, size_type pos = 0) const noexcept; + constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const; + constexpr size_type find_first_of(const charT* s, size_type pos = 0) const; + constexpr size_type find_last_of(basic_string_view s, size_type pos = npos) const noexcept; + constexpr size_type find_last_of(charT c, size_type pos = npos) const noexcept; + constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const; + constexpr size_type find_last_of(const charT* s, size_type pos = npos) const; + constexpr size_type find_first_not_of(basic_string_view s, size_type pos = 0) const noexcept; + constexpr size_type find_first_not_of(charT c, size_type pos = 0) const noexcept; + constexpr size_type find_first_not_of(const charT* s, size_type pos, + size_type n) const; + constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const; + constexpr size_type find_last_not_of(basic_string_view s, + size_type pos = npos) const noexcept; + constexpr size_type find_last_not_of(charT c, size_type pos = npos) const noexcept; + constexpr size_type find_last_not_of(const charT* s, size_type pos, + size_type n) const; + constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const; + + private: + const_pointer data_; // \expos + size_type size_; // \expos + }; + + // \ref{string.view.deduct}, deduction guide template - constexpr basic_string_view(It begin, End end); - - // \ref{string.view.iterators}, iterator support - constexpr const_iterator begin() const noexcept; - constexpr const_iterator end() const noexcept; - constexpr const_iterator cbegin() const noexcept; - constexpr const_iterator cend() const noexcept; - constexpr const_reverse_iterator rbegin() const noexcept; - constexpr const_reverse_iterator rend() const noexcept; - constexpr const_reverse_iterator crbegin() const noexcept; - constexpr const_reverse_iterator crend() const noexcept; - - // \ref{string.view.capacity}, capacity - constexpr size_type size() const noexcept; - constexpr size_type length() const noexcept; - constexpr size_type max_size() const noexcept; - [[nodiscard]] constexpr bool empty() const noexcept; - - // \ref{string.view.access}, element access - constexpr const_reference operator[](size_type pos) const; - constexpr const_reference at(size_type pos) const; - constexpr const_reference front() const; - constexpr const_reference back() const; - constexpr const_pointer data() const noexcept; - - // \ref{string.view.modifiers}, modifiers - constexpr void remove_prefix(size_type n); - constexpr void remove_suffix(size_type n); - constexpr void swap(basic_string_view& s) noexcept; - - // \ref{string.view.ops}, string operations - constexpr size_type copy(charT* s, size_type n, size_type pos = 0) const; - - constexpr basic_string_view substr(size_type pos = 0, size_type n = npos) const; - - constexpr int compare(basic_string_view s) const noexcept; - constexpr int compare(size_type pos1, size_type n1, basic_string_view s) const; - constexpr int compare(size_type pos1, size_type n1, basic_string_view s, - size_type pos2, size_type n2) const; - constexpr int compare(const charT* s) const; - constexpr int compare(size_type pos1, size_type n1, const charT* s) const; - constexpr int compare(size_type pos1, size_type n1, const charT* s, size_type n2) const; - - constexpr bool starts_with(basic_string_view x) const noexcept; - constexpr bool starts_with(charT x) const noexcept; - constexpr bool starts_with(const charT* x) const; - constexpr bool ends_with(basic_string_view x) const noexcept; - constexpr bool ends_with(charT x) const noexcept; - constexpr bool ends_with(const charT* x) const; - - // \ref{string.view.find}, searching - constexpr size_type find(basic_string_view s, size_type pos = 0) const noexcept; - constexpr size_type find(charT c, size_type pos = 0) const noexcept; - constexpr size_type find(const charT* s, size_type pos, size_type n) const; - constexpr size_type find(const charT* s, size_type pos = 0) const; - constexpr size_type rfind(basic_string_view s, size_type pos = npos) const noexcept; - constexpr size_type rfind(charT c, size_type pos = npos) const noexcept; - constexpr size_type rfind(const charT* s, size_type pos, size_type n) const; - constexpr size_type rfind(const charT* s, size_type pos = npos) const; - - constexpr size_type find_first_of(basic_string_view s, size_type pos = 0) const noexcept; - constexpr size_type find_first_of(charT c, size_type pos = 0) const noexcept; - constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const; - constexpr size_type find_first_of(const charT* s, size_type pos = 0) const; - constexpr size_type find_last_of(basic_string_view s, size_type pos = npos) const noexcept; - constexpr size_type find_last_of(charT c, size_type pos = npos) const noexcept; - constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const; - constexpr size_type find_last_of(const charT* s, size_type pos = npos) const; - constexpr size_type find_first_not_of(basic_string_view s, size_type pos = 0) const noexcept; - constexpr size_type find_first_not_of(charT c, size_type pos = 0) const noexcept; - constexpr size_type find_first_not_of(const charT* s, size_type pos, - size_type n) const; - constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const; - constexpr size_type find_last_not_of(basic_string_view s, - size_type pos = npos) const noexcept; - constexpr size_type find_last_not_of(charT c, size_type pos = npos) const noexcept; - constexpr size_type find_last_not_of(const charT* s, size_type pos, - size_type n) const; - constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const; - -private: - const_pointer data_; // \expos - size_type size_; // \expos -}; - -// \ref{string.view.deduct}, deduction guide -template - basic_string_view(It, End) -> basic_string_view>; + basic_string_view(It, End) -> basic_string_view>; +} \end{codeblock} \pnum From d3677615e4c3b33a016afe98caf78dd06cd6d033 Mon Sep 17 00:00:00 2001 From: Eelis Date: Sat, 13 Jun 2020 08:45:58 +0200 Subject: [PATCH 031/250] [container.requirements.general] Remove parentheses for 'equal()' outside of a function call expression. (#4043) --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index f95d17cf94..e2150e737b 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -276,7 +276,7 @@ have linear complexity for \tcode{array} and have constant complexity for all other standard containers. \begin{note} -The algorithm \tcode{equal()} is defined in \ref{algorithms}. +The algorithm \tcode{equal} is defined in \ref{algorithms}. \end{note} \pnum From 14476e230e3cf57b1a383488859769a5019d5aba Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 12 Jun 2020 21:52:01 +0200 Subject: [PATCH 032/250] [structure.specifications] Integrate [res.on.expects]. (#4042) The latter consisted of a single sentence that is best integrated into the place where the Preconditions: element is introduced. Also fixes LWG3168. --- source/lib-intro.tex | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 37ffe80b8c..d8ea15b971 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -620,7 +620,8 @@ \item \expects the conditions -that the function assumes to hold whenever it is called. +that the function assumes to hold whenever it is called; +violation of any preconditions results in undefined behavior. \item \effects @@ -2976,12 +2977,6 @@ This applies even to objects such as mutexes intended for thread synchronization. \end{note} -\rSec3[res.on.expects]{Expects paragraph} - -\pnum -Violation of any preconditions specified in a function's \expects element -results in undefined behavior. - \rSec3[res.on.requirements]{Semantic requirements} \pnum From 67d38cc28307d79da00426740ebd71a4254d5a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Wed, 24 Jun 2020 01:53:45 -0400 Subject: [PATCH 033/250] [expr.const] Remove duplicate cross-reference (#4055) --- source/expressions.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/expressions.tex b/source/expressions.tex index 53dac140b0..1fcfb24354 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -6928,7 +6928,7 @@ \end{itemize} \item -an lvalue-to-rvalue conversion\iref{conv.lval} +an lvalue-to-rvalue conversion that is applied to a glvalue that refers to a non-active member of a union or a subobject thereof; From 849aa48651bd245e44ff503b41e514aa4cfba261 Mon Sep 17 00:00:00 2001 From: Eelis Date: Thu, 25 Jun 2020 23:33:00 +0200 Subject: [PATCH 034/250] [container.requirements] Improve index entries for contiguous and reversible containers. (#4051) --- source/containers.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index e2150e737b..9e644d73fd 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -366,10 +366,11 @@ swap. \pnum +\indextext{reversible container|see{container, reversible}}% If the iterator type of a container belongs to the bidirectional or random access iterator categories\iref{iterator.requirements}, the container is called -\term{reversible} +\defnx{reversible}{container!reversible} and meets the additional requirements in \tref{container.rev.req}. @@ -465,8 +466,7 @@ within that container. \pnum -\indextext{container!contiguous}% -A \defn{contiguous container} +A \defnadj{contiguous}{container} is a container whose member types \tcode{iterator} and \tcode{const_iterator} meet the From 84ed3246e4b34be200bcac5c4dadb4ddde8804e1 Mon Sep 17 00:00:00 2001 From: Eelis Date: Mon, 29 Jun 2020 16:29:00 +0200 Subject: [PATCH 035/250] [special] Remove index entry for 'X(X&)'. (#4064) --- source/classes.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/source/classes.tex b/source/classes.tex index d7186bfae0..9412e4c09e 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -1134,7 +1134,6 @@ \rSec2[special]{Special member functions} -\indextext{\idxcode{X(X\&)}|see{constructor, copy}}% \indextext{~@\tcode{\~}|see{destructor}}% \indextext{assignment!copy|see{assignment operator, copy}}% \indextext{assignment!move|see{assignment operator, move}}% From 63958f820eb236733c9b1d3c6fb7fa6d6fdb7108 Mon Sep 17 00:00:00 2001 From: Eelis Date: Mon, 29 Jun 2020 22:58:18 +0200 Subject: [PATCH 036/250] [expr.new] Use repeated \indextext for index redirects with multiple targets. (#4065) --- source/expressions.tex | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 1fcfb24354..f240f67a3e 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -4656,9 +4656,12 @@ \pnum \indextext{expression!\idxcode{new}}% -\indextext{free store|seealso{\tcode{new}, \tcode{delete}}}% -\indextext{memory management|see{\tcode{new}, \tcode{delete}}}% -\indextext{storage management|see{\tcode{new}, \tcode{delete}}}% +\indextext{free store|seealso{\tcode{new}}}% +\indextext{free store|seealso{\tcode{delete}}}% +\indextext{memory management|see{\tcode{new}}}% +\indextext{memory management|see{\tcode{delete}}}% +\indextext{storage management|see{\tcode{new}}}% +\indextext{storage management|see{\tcode{delete}}}% \indextext{\idxcode{new}}% The \grammarterm{new-expression} attempts to create an object of the \grammarterm{type-id}\iref{dcl.name} or \grammarterm{new-type-id} to which From 138bc754340cadb719e350a5f5c09501537e460c Mon Sep 17 00:00:00 2001 From: Eelis Date: Sun, 5 Jul 2020 21:42:50 +0200 Subject: [PATCH 037/250] [allocator.members] Remove stray whitespace. (#4073) --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index 4e81905cd2..380181c930 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -8269,7 +8269,7 @@ \pnum \effects -Deallocates the storage referenced by \tcode{p} . +Deallocates the storage referenced by \tcode{p}. \pnum \remarks From 3f1c485fd210cf690d62b56ee924e40d6a2ae550 Mon Sep 17 00:00:00 2001 From: Eelis Date: Wed, 8 Jul 2020 17:36:49 +0200 Subject: [PATCH 038/250] [re.grammar] Avoid monospace font for ordinary text. (#4074) --- source/regex.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/regex.tex b/source/regex.tex index e47b609b9e..a379311090 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -3693,17 +3693,17 @@ In addition the following expressions shall be equivalent: \begin{codeblock} -\d and [[:digit:]] +\d @\textnormal{and}@ [[:digit:]] -\D and [^[:digit:]] +\D @\textnormal{and}@ [^[:digit:]] -\s and [[:space:]] +\s @\textnormal{and}@ [[:space:]] -\S and [^[:space:]] +\S @\textnormal{and}@ [^[:space:]] -\w and [_[:alnum:]] +\w @\textnormal{and}@ [_[:alnum:]] -\W and [^_[:alnum:]] +\W @\textnormal{and}@ [^_[:alnum:]] \end{codeblock} \pnum From 63f4c969e7b4039692d1267eb67184ecffb51da3 Mon Sep 17 00:00:00 2001 From: Eelis Date: Thu, 9 Jul 2020 22:33:29 +0200 Subject: [PATCH 039/250] [tab:cpp17.moveassignable] Remove superfluous space. (#4076) --- 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 d8ea15b971..c46d2b43ba 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1722,7 +1722,7 @@ \multicolumn{4}{|p{5.3in}|}{ \tcode{rv}'s state is unspecified. \begin{note} -\ \tcode{rv} must still meet the requirements of the library + \tcode{rv} must still meet the requirements of the library component that is using it, whether or not \tcode{t} and \tcode{rv} refer to the same object. The operations listed in those requirements must work as specified whether \tcode{rv} has been moved from or not. From ccf3283a15c23a747257c1ddebf5c634bc640d30 Mon Sep 17 00:00:00 2001 From: Eelis Date: Sat, 11 Jul 2020 09:45:24 +0200 Subject: [PATCH 040/250] [alg.copy] Typeset variable consistently in math font. (#4079) --- source/algorithms.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 6ff786f7f1..68c463bfdd 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -4338,7 +4338,7 @@ \pnum \effects For each non-negative integer $i < N$, -performs \tcode{*(result + i) = *(first + i)}. +performs \tcode{*(result + $i$) = *(first + $i$)}. \pnum \returns From 00e23c7c23919bad4f1ec051df23709eb8988cfd Mon Sep 17 00:00:00 2001 From: Eelis Date: Wed, 15 Jul 2020 17:57:12 +0200 Subject: [PATCH 041/250] [fs.class.path] Ensure interword spacing inside sentence. (#4083) --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 974a95f02d..8fdf1ea6db 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -11702,7 +11702,7 @@ an implied starting location. The elements of a path that determine if it is relative are operating system dependent. \begin{note} -Pathnames ``.'' and ``..'' are relative paths. +Pathnames ``.''\ and ``..''\ are relative paths. \end{note} \pnum From 0d1803362f997d970a4e1c6ebcbc25ace7bdaeb8 Mon Sep 17 00:00:00 2001 From: frederick-vs-ja Date: Wed, 22 Jul 2020 03:33:07 +0800 Subject: [PATCH 042/250] [istream.syn,ostream.syn] update synopses according to LWG1203 (#4084) Edits missed by commit ffb23d0521af5a8795fc051d2915858d00518d41. --- source/iostreams.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 8fdf1ea6db..3893f21181 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -4052,8 +4052,8 @@ template basic_istream& ws(basic_istream& is); - template - basic_istream& operator>>(basic_istream&& is, T&& x); + template + Istream&& operator>>(Istream&& is, T&& x); } \end{codeblock} @@ -4087,8 +4087,8 @@ template basic_ostream& flush_emit(basic_ostream& os); - template - basic_ostream& operator<<(basic_ostream&& os, const T& x); + template + Ostream&& operator<<(Ostream&& os, const T& x); } \end{codeblock} From 40b740e7bf8589756a924a53ec5d1f1122df5c66 Mon Sep 17 00:00:00 2001 From: Eelis van der Weegen Date: Fri, 3 Jul 2020 05:03:45 +0200 Subject: [PATCH 043/250] [iterator.requirements.general] Add missing comma. --- source/iterators.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iterators.tex b/source/iterators.tex index 2b07e0234c..a326ce9fae 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -519,7 +519,7 @@ \item \libconcept{input_iterator}\iref{iterator.concept.input}, \item \libconcept{output_iterator}\iref{iterator.concept.output}, \item \libconcept{forward_iterator}\iref{iterator.concept.forward}, -\item \libconcept{bidirectional_iterator}\iref{iterator.concept.bidir} +\item \libconcept{bidirectional_iterator}\iref{iterator.concept.bidir}, \item \libconcept{random_access_iterator}\iref{iterator.concept.random.access}, and \item \libconcept{contiguous_iterator}\iref{iterator.concept.contiguous}, From 0ed1277db812b7cf09c5c30b41c82a33ac381bbc Mon Sep 17 00:00:00 2001 From: Eelis van der Weegen Date: Sun, 5 Jul 2020 20:26:39 +0200 Subject: [PATCH 044/250] [list.ops] Add missing full stop at end of sentence. --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 9e644d73fd..2cbff1d95f 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -5411,7 +5411,7 @@ Nothing unless an exception is thrown by \tcode{*i == *(i-1)} or -\tcode{pred(*i, *(i - 1))} +\tcode{pred(*i, *(i - 1))}. \pnum \complexity From 279c10a6bb07c505c9350e7f6759dedc3e7569df Mon Sep 17 00:00:00 2001 From: Eelis Date: Thu, 23 Jul 2020 00:50:05 +0200 Subject: [PATCH 045/250] [lex.ext] Simplify use of \placeholder. (#4091) --- source/lex.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/lex.tex b/source/lex.tex index 6fa15f8570..683d645bbe 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -1915,7 +1915,7 @@ If \placeholder{S} contains a raw literal operator, the literal \placeholder{L} is treated as a call of the form \begin{codeblock} -operator "" @\placeholder{X}@(@"\placeholder{n}{"}@) +operator "" @\placeholder{X}@("@\placeholder{n}@") \end{codeblock} Otherwise (\placeholder{S} contains a numeric literal operator template), \placeholder{L} is treated as a call of the form @@ -1941,7 +1941,7 @@ If \placeholder{S} contains a raw literal operator, the \grammarterm{literal} \placeholder{L} is treated as a call of the form \begin{codeblock} -operator "" @\placeholder{X}@(@"\placeholder{f}{"}@) +operator "" @\placeholder{X}@("@\placeholder{f}@") \end{codeblock} Otherwise (\placeholder{S} contains a numeric literal operator template), \placeholder{L} is treated as a call of the form From 5765a6a520d8a92048c577bf12e7485e7ffcf3df Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Mon, 27 Jul 2020 23:14:52 -0700 Subject: [PATCH 046/250] [mask.array.assign] Replace "it" with its antecedent (#4095) Many nouns appear in this sentence before "it", _none_ of which is the proper antecedent. --- source/numerics.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/numerics.tex b/source/numerics.tex index 22ff23903e..d6d58294f9 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -8710,7 +8710,7 @@ These assignment operators have reference semantics, assigning the values of the argument array elements to selected elements of the \tcode{valarray} -object to which it refers. +object to which the \tcode{mask_array} object refers. \end{itemdescr} \rSec3[mask.array.comp.assign]{Compound assignment} From cee1c37bcc13b76e1fb97b4eb5f7284d03b590f4 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Mon, 27 Jul 2020 23:16:07 -0700 Subject: [PATCH 047/250] [mask.array.comp.assign] Clarify "mask object" (#4096) Use "mask_array object" instead. --- source/numerics.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/numerics.tex b/source/numerics.tex index d6d58294f9..a623780b79 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -8744,7 +8744,7 @@ indicated operation to the elements of the argument array and selected elements of the \tcode{valarray} -object to which the mask object refers. +object to which the \tcode{mask_array} object refers. \end{itemdescr} \rSec3[mask.array.fill]{Fill function} From 20210e4f9141e0f8a5fa633eccb6bf643c0cfd61 Mon Sep 17 00:00:00 2001 From: Eelis van der Weegen Date: Fri, 31 Jul 2020 06:15:52 +0200 Subject: [PATCH 048/250] [std] Add missing \pnums. --- source/algorithms.tex | 1 + source/atomics.tex | 1 + source/future.tex | 2 ++ source/numerics.tex | 1 + source/support.tex | 1 + source/utilities.tex | 1 + 6 files changed, 7 insertions(+) diff --git a/source/algorithms.tex b/source/algorithms.tex index 68c463bfdd..d65c597753 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -10629,6 +10629,7 @@ \end{itemdecl} \begin{itemdescr} +\pnum \effects Equivalent to: \begin{codeblock} diff --git a/source/atomics.tex b/source/atomics.tex index 45752b2680..89b434e219 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -1371,6 +1371,7 @@ \end{itemdecl} \begin{itemdescr} +\pnum \effects Equivalent to: \tcode{return fetch_\placeholder{key}(operand) \placeholdernc{op} operand;} diff --git a/source/future.tex b/source/future.tex index 294144cca4..2297568b62 100644 --- a/source/future.tex +++ b/source/future.tex @@ -1533,6 +1533,7 @@ \rSec1[depr.tuple]{Tuple} +\pnum The header \libheaderref{tuple} has the following additions: \begin{codeblock} @@ -2675,6 +2676,7 @@ \rSec2[depr.atomics.volatile]{Volatile access} +\pnum If an atomic specialization has one of the following overloads, then that overload participates in overload resolution even if \tcode{atomic::is_always_lock_free} is \tcode{false}: diff --git a/source/numerics.tex b/source/numerics.tex index a623780b79..c551fc1dca 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -1457,6 +1457,7 @@ \rSec2[bit.rotate]{Rotating} +\pnum In the following descriptions, let \tcode{N} denote \tcode{numeric_limits::digits}. diff --git a/source/support.tex b/source/support.tex index b1b581dcfa..87350bea24 100644 --- a/source/support.tex +++ b/source/support.tex @@ -3137,6 +3137,7 @@ \rSec2[source.location.syn]{Header \tcode{} synopsis} +\pnum The header \libheaderdef{source_location} defines the class \tcode{source_location} that provides a means to obtain source location information. diff --git a/source/utilities.tex b/source/utilities.tex index 380181c930..c5ff783b4f 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -21016,6 +21016,7 @@ \tcode{i < size_ ?\ data_[i] :\ basic_format_arg()}. \end{itemdescr} +\pnum \begin{note} Implementations are encouraged to optimize the representation of \tcode{basic_format_args} From 0701942724a1963a7562a9e9ae44fed2e8683ae9 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Sat, 1 Aug 2020 13:08:19 -0700 Subject: [PATCH 049/250] [ranges.syn] Properly capitalize "this Clause" (#4103) --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 8b3e676f43..cd5dd68941 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -318,7 +318,7 @@ \pnum \indextext{to-unsigned-like@\exposid{to-unsigned-like}}% \indextext{make-unsigned-like-t@\exposid{make-unsigned-like-t}}% -Within this clause, +Within this Clause, for an integer-like type \tcode{X}\iref{iterator.concept.winc}, \tcode{\placeholdernc{make-unsigned-like-t}} denotes \tcode{make_unsigned_t} if \tcode{X} is an integer type; From 5bf6611f13af189966cf3affcaedd91cd6b24d04 Mon Sep 17 00:00:00 2001 From: Billy O'Neal Date: Tue, 18 Aug 2020 13:31:30 -0700 Subject: [PATCH 050/250] [thread.condvarany.intwait] Remove reference to nonexistent variable "cv". (#4115) --- source/threads.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/threads.tex b/source/threads.tex index 782c3fd79f..332cf0eeed 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -5023,7 +5023,7 @@ while (!stoken.stop_requested()) { if (pred()) return true; - if (cv.wait_until(lock, abs_time) == cv_status::timeout) + if (wait_until(lock, abs_time) == cv_status::timeout) return pred(); } return pred(); From f692ad3d0f456180c03d2e6dfa4cb7f8d55dea75 Mon Sep 17 00:00:00 2001 From: languagelawyer <38548419+languagelawyer@users.noreply.github.com> Date: Wed, 19 Aug 2020 09:49:06 +0300 Subject: [PATCH 051/250] [std] Move \rSec to before \indextext (#4116) --- source/atomics.tex | 2 +- source/basic.tex | 2 +- source/containers.tex | 4 ++-- source/future.tex | 2 +- source/intro.tex | 4 ++-- source/support.tex | 4 ++-- source/threads.tex | 6 +++--- source/utilities.tex | 9 +++++---- 8 files changed, 17 insertions(+), 16 deletions(-) diff --git a/source/atomics.tex b/source/atomics.tex index 89b434e219..b8b446b7e8 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -2712,8 +2712,8 @@ Equivalent to: \tcode{return fetch_sub(1) - 1;} \end{itemdescr} +\rSec2[util.smartptr.atomic]{Partial specializations for smart pointers}% \indextext{atomic!smart pointers|(}% -\rSec2[util.smartptr.atomic]{Partial specializations for smart pointers} \pnum The library provides partial specializations of the \tcode{atomic} template diff --git a/source/basic.tex b/source/basic.tex index cf98384097..f4d630b30b 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -281,12 +281,12 @@ an abstract class type\iref{class.abstract}, or a (possibly multi-dimensional) array thereof. +\rSec1[basic.def.odr]{One-definition rule}% \indextext{object!definition}% \indextext{function!definition}% \indextext{class!definition}% \indextext{enumerator!definition}% \indextext{one-definition rule|(}% -\rSec1[basic.def.odr]{One-definition rule} \pnum No translation unit shall contain more than one definition of any diff --git a/source/containers.tex b/source/containers.tex index 2cbff1d95f..8f334b2680 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -2159,9 +2159,9 @@ and a type that qualifies as an allocator is deduced for that parameter. \end{itemize} +\rSec3[associative.reqmts.except]{Exception safety guarantees}% \indextext{associative containers!exception safety}% \indextext{associative containers!requirements}% -\rSec3[associative.reqmts.except]{Exception safety guarantees} \pnum For associative containers, no \tcode{clear()} function throws an exception. @@ -2178,9 +2178,9 @@ that exception is thrown by the swap of the container's \tcode{Compare} object (if any). +\rSec2[unord.req]{Unordered associative containers}% \indextext{associative containers!unordered|see{unordered associative containers}} \indextext{hash tables|see{unordered associative containers}} -\rSec2[unord.req]{Unordered associative containers} \pnum \indextext{unordered associative containers!complexity}% diff --git a/source/future.tex b/source/future.tex index 2297568b62..04d85cb641 100644 --- a/source/future.tex +++ b/source/future.tex @@ -400,8 +400,8 @@ unless the function's \throws element specifies throwing an exception when the precondition is violated. +\rSec1[depr.relops]{Relational operators}% \indexlibraryglobal{rel_ops}% -\rSec1[depr.relops]{Relational operators} \pnum The header \libheaderref{utility} has the following additions: diff --git a/source/intro.tex b/source/intro.tex index 60bee58ce0..275b1a9545 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -21,8 +21,8 @@ management operators, and additional library facilities.% \indextext{scope|)} +\rSec0[intro.refs]{Normative references}% \indextext{normative references|see{references, normative}}% -\rSec0[intro.refs]{Normative references} \pnum \indextext{references!normative|(}% @@ -376,6 +376,7 @@ \rSec0[intro]{General principles} +\rSec1[intro.compliance]{Implementation compliance}% \indextext{diagnostic message|see{message, diagnostic}}% \indexdefn{conditionally-supported behavior|see{behavior, con\-ditionally-supported}}% \indextext{dynamic type|see{type, dynamic}}% @@ -397,7 +398,6 @@ \indextext{precedence of operator|see{operator, precedence of}}% \indextext{order of evaluation in expression|see{expression, order of evaluation of}}% \indextext{multiple threads|see{threads, multiple}}% -\rSec1[intro.compliance]{Implementation compliance} \pnum \indextext{conformance requirements|(}% diff --git a/source/support.tex b/source/support.tex index 87350bea24..6e7c2573e6 100644 --- a/source/support.tex +++ b/source/support.tex @@ -2696,8 +2696,8 @@ \rSec2[alloc.errors]{Storage allocation errors} +\rSec3[bad.alloc]{Class \tcode{bad_alloc}}% \indexlibraryglobal{bad_alloc}% -\rSec3[bad.alloc]{Class \tcode{bad_alloc}} \indexlibraryctor{bad_alloc}% \begin{codeblock} @@ -2727,9 +2727,9 @@ An \impldef{return value of \tcode{bad_alloc::what}} \ntbs{}. \end{itemdescr} +\rSec3[new.badlength]{Class \tcode{bad_array_new_length}}% \indexlibraryglobal{bad_array_new_length}% \indexlibraryctor{bad_array_new_length}% -\rSec3[new.badlength]{Class \tcode{bad_array_new_length}} \begin{codeblock} namespace std { diff --git a/source/threads.tex b/source/threads.tex index 332cf0eeed..4badddf537 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -373,8 +373,8 @@ \end{codeblock} +\rSec2[stoptoken]{Class \tcode{stop_token}}% \indexlibraryglobal{stop_token}% -\rSec2[stoptoken]{Class \tcode{stop_token}} \pnum \indexlibraryglobal{stop_token}% @@ -567,8 +567,8 @@ Equivalent to: \tcode{x.swap(y)}. \end{itemdescr} +\rSec2[stopsource]{Class \tcode{stop_source}}% \indexlibraryglobal{stop_source}% -\rSec2[stopsource]{Class \tcode{stop_source}} \pnum \indexlibraryglobal{stop_source}% @@ -836,8 +836,8 @@ Equivalent to: \tcode{x.swap(y)}. \end{itemdescr} +\rSec2[stopcallback]{Class template \tcode{stop_callback}}% \indexlibraryglobal{stop_callback}% -\rSec2[stopcallback]{Class template \tcode{stop_callback}} \pnum \indexlibraryglobal{stop_callback}% diff --git a/source/utilities.tex b/source/utilities.tex index c5ff783b4f..6989d1fdd5 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -4007,8 +4007,8 @@ } \end{codeblock} +\rSec2[variant.variant]{Class template \tcode{variant}}% \indexlibraryglobal{variant}% -\rSec2[variant.variant]{Class template \tcode{variant}} \begin{codeblock} namespace std { @@ -5156,8 +5156,8 @@ no complexity requirements. \end{itemdescr} +\rSec2[variant.monostate]{Class \tcode{monostate}}% \indexlibraryglobal{monostate}% -\rSec2[variant.monostate]{Class \tcode{monostate}} \begin{itemdecl} struct monostate{}; @@ -5210,8 +5210,8 @@ The expression inside \tcode{noexcept} is equivalent to \tcode{noexcept(v.swap(w))}. \end{itemdescr} +\rSec2[variant.bad.access]{Class \tcode{bad_variant_access}}% \indexlibraryglobal{bad_variant_access}% -\rSec2[variant.bad.access]{Class \tcode{bad_variant_access}} \begin{codeblock} class bad_variant_access : public exception { @@ -9618,8 +9618,9 @@ \tcode{os}. \end{itemdescr} +\rSec2[util.smartptr.weak.bad]{Class \tcode{bad_weak_ptr}}% \indextext{smart pointers|(}% -\rSec2[util.smartptr.weak.bad]{Class \tcode{bad_weak_ptr}} + \indexlibraryglobal{bad_weak_ptr}% \begin{codeblock} namespace std { From 3e7dce381f766664320815cf9a61c056e13d3210 Mon Sep 17 00:00:00 2001 From: Eelis Date: Fri, 21 Aug 2020 23:11:14 +0200 Subject: [PATCH 052/250] [depr.conversions.string] Use proper "Returns:" markup. (#4120) --- source/future.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/future.tex b/source/future.tex index 04d85cb641..7e9fa1c768 100644 --- a/source/future.tex +++ b/source/future.tex @@ -2316,7 +2316,8 @@ \begin{itemdescr} \pnum -returns \tcode{cvtstate}. +\returns +\tcode{cvtstate}. \end{itemdescr} \indexlibrarymember{state_type}{wstring_convert}% From 7ea0248b0952b351d6d2e16a6db38cd1d492298b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Mon, 24 Aug 2020 03:04:33 -0400 Subject: [PATCH 053/250] [fs.race.behavior] Fix cross-reference to self (#4122) --- source/iostreams.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 3893f21181..dff2e9b3e0 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -11340,7 +11340,7 @@ when multiple threads, processes, or computers interleave access and modification of the same object within a file system. -Behavior is undefined if calls to functions provided by subclause~\ref{fs.race.behavior} introduce a file system race. +Behavior is undefined if calls to functions provided by subclause~\ref{filesystems} introduce a file system race. \pnum If the possibility of a file system race would make it unreliable for a From 4d5ccc9bf3695d78b79d95683da6403144704df0 Mon Sep 17 00:00:00 2001 From: stbergmann Date: Wed, 26 Aug 2020 13:18:37 +0200 Subject: [PATCH 054/250] [dcl.fct.def.general] Index __func__ (#4124) --- source/declarations.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/declarations.tex b/source/declarations.tex index 22e0824e7d..086571cdbb 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -5966,6 +5966,7 @@ storage duration that is implicitly defined (see~\ref{basic.scope.block}). \pnum +\indextext{__func__@\mname{func}}% The function-local predefined variable \mname{func} is defined as if a definition of the form \begin{codeblock} From 6e6573c310cc5fec5535ee45661026969bcf5afc Mon Sep 17 00:00:00 2001 From: Eelis Date: Wed, 26 Aug 2020 18:11:27 +0200 Subject: [PATCH 055/250] [string.syn] Index basic_string typedefs. (#4125) --- source/strings.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/strings.tex b/source/strings.tex index b56973b0b6..d28ac932e2 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -652,11 +652,11 @@ erase_if(basic_string& c, Predicate pred); // \tcode{basic_string} typedef names - using string = basic_string; - using u8string = basic_string; - using u16string = basic_string; - using u32string = basic_string; - using wstring = basic_string; + using @\libglobal{string}@ = basic_string; + using @\libglobal{u8string}@ = basic_string; + using @\libglobal{u16string}@ = basic_string; + using @\libglobal{u32string}@ = basic_string; + using @\libglobal{wstring}@ = basic_string; // \ref{string.conversions}, numeric conversions int stoi(const string& str, size_t* idx = nullptr, int base = 10); From ecbcd98f3b8350931bf47695cf286296d173b554 Mon Sep 17 00:00:00 2001 From: Eelis Date: Thu, 27 Aug 2020 09:40:12 +0200 Subject: [PATCH 056/250] [range.utility.helpers] Move template-argument-list out of \libconcept. (#4127) --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index cd5dd68941..ddf9a09db4 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1281,7 +1281,7 @@ template concept @\defexposconcept{has-arrow}@ = // \expos - @\libconcept{input_iterator}@ && (is_pointer_v || requires(I i) { i.operator->(); }); + @\libconcept{input_iterator}@ && (is_pointer_v || requires(I i) { i.operator->(); }); template concept @\defexposconcept{not-same-as}@ = // \expos From 0975c9fe156000e44fd4e3d1a09c48e8ce6f01d5 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Mon, 31 Aug 2020 03:47:32 -0700 Subject: [PATCH 057/250] [ranges.syn] Fix declaration of transform_view (#4132) ... to agree with the declaration in [range.transform.view] as modified by LWG3325. The resolution of this LWG issue failed to direct the Editor to also change the declaration in [ranges.syn]. --- source/ranges.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index ddf9a09db4..007f42c049 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -202,7 +202,8 @@ // \ref{range.transform}, transform view template<@\libconcept{input_range}@ V, @\libconcept{copy_constructible}@ F> requires view && is_object_v && - regular_invocable> + regular_invocable> && + @\exposconcept{can-reference}@>> class transform_view; namespace views { inline constexpr @\unspec@ transform = @\unspec@; } From e8db8e0d23a33d057192b8eb6724fa08e7e704a7 Mon Sep 17 00:00:00 2001 From: Eelis Date: Tue, 1 Sep 2020 21:08:28 +0200 Subject: [PATCH 058/250] [coroutine.noop.coroutine] Use code font for noop_coroutine index entry. (#4133) --- source/support.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/support.tex b/source/support.tex index 6e7c2573e6..d331b4b066 100644 --- a/source/support.tex +++ b/source/support.tex @@ -5336,7 +5336,7 @@ \rSec3[coroutine.noop.coroutine]{Function \tcode{noop_coroutine}} -\indexlibrary{noop_coroutine}% +\indexlibraryglobal{noop_coroutine}% \begin{itemdecl} noop_coroutine_handle noop_coroutine() noexcept; \end{itemdecl} From c12011d430e94a33933dd9ace0cdc074a548a7c9 Mon Sep 17 00:00:00 2001 From: Eelis Date: Thu, 3 Sep 2020 20:07:49 +0200 Subject: [PATCH 059/250] [span.syn] Add index entry for dynamic_extent. (#4136) --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 8f334b2680..1aa34f2054 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -10601,7 +10601,7 @@ \begin{codeblock} namespace std { // constants - inline constexpr size_t dynamic_extent = numeric_limits::max(); + inline constexpr size_t @\libglobal{dynamic_extent}@ = numeric_limits::max(); // \ref{views.span}, class template span template From 2f525836ff90750358d9bf2bae21e4577ac5e2ad Mon Sep 17 00:00:00 2001 From: Eelis Date: Thu, 3 Sep 2020 22:27:11 +0200 Subject: [PATCH 060/250] [tab:atomic.types.pointer.comp] Fix column captions. (#4137) --- source/atomics.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/atomics.tex b/source/atomics.tex index b8b446b7e8..0a065c3aa6 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -2564,12 +2564,12 @@ \begin{floattable} {Atomic pointer computations}{atomic.types.pointer.comp}{lll|lll} \hline -\tcode{Key} & - Op & - Computation & -\tcode{Key} & - Op & - Computation \\ \hline +\hdstyle{\tcode{\placeholder{key}}} & + \hdstyle{Op} & + \hdstyle{Computation} & +\hdstyle{\tcode{\placeholder{key}}} & + \hdstyle{Op} & + \hdstyle{Computation} \\ \hline \tcode{add} & \tcode{+} & addition & From eccdb1cbf3ce270e7d505eb5c047d0ae9559cadc Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 3 Sep 2020 22:28:13 +0200 Subject: [PATCH 061/250] [range.drop.view] Fix italics for exposition-only members. (#4135) --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 007f42c049..16e0b3dda9 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -4740,7 +4740,7 @@ \begin{itemdescr} \pnum \returns -\tcode{ranges::next(ranges::begin(base_), count_, ranges::end(base_))}. +\tcode{ranges::next(ranges::begin(\exposid{base_}), \exposid{count_}, ranges::end(\exposid{base_}))}. \pnum \remarks From 797e9ea2bf226ba04cce6be2f6fbd26f41eefc6c Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 3 Sep 2020 13:29:33 -0700 Subject: [PATCH 062/250] [ranges.syn] Remove bogus ; after requires-clause (#4128) --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 16e0b3dda9..cf9ced9115 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -275,7 +275,7 @@ // \ref{range.elements}, elements view template<@\libconcept{input_range}@ V, size_t N> - requires @\seebelow@; + requires @\seebelow@ class elements_view; template From 2f3cb8fe89ce705929b37d1f3f1d7118ef56b7ad Mon Sep 17 00:00:00 2001 From: Eelis Date: Thu, 3 Sep 2020 22:32:20 +0200 Subject: [PATCH 063/250] [std] Fix dangling index redirects. (#4110) --- source/basic.tex | 2 +- source/classes.tex | 3 ++- source/declarations.tex | 5 ++++- source/preprocessor.tex | 8 ++++---- source/templates.tex | 4 ++-- source/threads.tex | 2 +- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index f4d630b30b..b3d20cff3d 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -1010,7 +1010,7 @@ \pnum \indextext{scope!block}% -\indextext{local scope|see{block scope}}% +\indextext{local scope|see{scope, block}}% A name declared in a block\iref{stmt.block} is local to that block; it has \defnx{block scope}{block (statement)!scope}. Its potential scope begins at its point of diff --git a/source/classes.tex b/source/classes.tex index 9412e4c09e..6f324ca0cb 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3563,7 +3563,8 @@ derived object\iref{intro.object} is unspecified. \begin{note} \indextext{directed acyclic graph|see{DAG}}% -\indextext{lattice|see{DAG, subobject}}% +\indextext{lattice|see{DAG}}% +\indextext{lattice|see{subobject}}% A derived class and its base class subobjects can be represented by a directed acyclic graph (DAG) where an arrow means ``directly derived from'' (see \fref{class.dag}). diff --git a/source/declarations.tex b/source/declarations.tex index 086571cdbb..d6ebb1c4aa 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -501,7 +501,10 @@ \rSec2[dcl.fct.spec]{Function specifiers}% \indextext{specifier!function}% -\indextext{function|seealso{friend function; member function; inline function; virtual function}} +\indextext{function|seealso{friend function}} +\indextext{function|seealso{member function}} +\indextext{function|seealso{inline function}} +\indextext{function|seealso{virtual function}} \pnum A diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 50e1146b30..5fb18c0b19 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -598,7 +598,7 @@ \rSec1[cpp.include]{Source file inclusion} \indextext{preprocessing directive!header inclusion} \indextext{preprocessing directive!source-file inclusion} -\indextext{inclusion!source file|see{preprocessing directives, source-file inclusion}}% +\indextext{inclusion!source file|see{preprocessing directive, source-file inclusion}}% \indextext{\idxcode{\#include}}% \pnum @@ -1525,7 +1525,7 @@ \rSec1[cpp.line]{Line control}% \indextext{preprocessing directive!line control}% -\indextext{\idxcode{\#line}|see{preprocessing directives, line control}} +\indextext{\idxcode{\#line}|see{preprocessing directive, line control}} \pnum The \grammarterm{string-literal} of a @@ -1581,7 +1581,7 @@ \rSec1[cpp.error]{Error directive}% \indextext{preprocessing directive!error}% -\indextext{\idxcode{\#error}|see{preprocessing directives, error}} +\indextext{\idxcode{\#error}|see{preprocessing directive, error}} \pnum A preprocessing directive of the form @@ -1594,7 +1594,7 @@ \rSec1[cpp.pragma]{Pragma directive}% \indextext{preprocessing directive!pragma}% -\indextext{\idxcode{\#pragma}|see{preprocessing directives, pragma}} +\indextext{\idxcode{\#pragma}|see{preprocessing directive, pragma}} \pnum A preprocessing directive of the form diff --git a/source/templates.tex b/source/templates.tex index 8630072b29..390cdbf46e 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -3816,7 +3816,7 @@ the same set of template argument lists. \pnum -\indextext{template!function!equivalent|see{equivalent, function template}}% +\indextext{template!function!equivalent|see{equivalent, function templates}}% Two function templates are \defnx{equivalent}{equivalent!function templates} if they @@ -3830,7 +3830,7 @@ expressions involving template parameters. \indextext{equivalent!functionally|see{functionally equivalent}}% -\indextext{template!function!functionally equivalent|see{functionally equivalent, function template}}% +\indextext{template!function!functionally equivalent|see{functionally equivalent, function templates}}% Two function templates are \defnx{functionally equivalent}{functionally equivalent!function templates} if they diff --git a/source/threads.tex b/source/threads.tex index 4badddf537..ed47860b9d 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -5555,7 +5555,7 @@ the next phase starts. \end{itemize} -\indextext{phase synchronization point|see{barrier, phase synchronization point }}% +\indextext{phase synchronization point|see{barrier, phase synchronization point}}% \pnum \indextext{block (execution)}% Each phase defines a \defnx{phase synchronization point}{barrier!phase synchronization point}. From 5553cdbc7db07c331c7cd742f4db31d1f586d1f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Thu, 3 Sep 2020 16:38:22 -0400 Subject: [PATCH 064/250] [lib] Fix uses of "clause" (#4104) --- source/containers.tex | 2 +- source/iostreams.tex | 2 +- source/iterators.tex | 2 +- source/numerics.tex | 2 +- source/threads.tex | 4 ++-- source/time.tex | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index 1aa34f2054..b3aa62d87e 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -309,7 +309,7 @@ \tcode{const_iterator} type referring to the same element with no change in semantics. \pnum -Unless otherwise specified, all containers defined in this clause obtain memory +Unless otherwise specified, all containers defined in this Clause obtain memory using an allocator (see~\ref{allocator.requirements}). \begin{note} In particular, containers and iterators do not store references diff --git a/source/iostreams.tex b/source/iostreams.tex index dff2e9b3e0..4cbfc0e556 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -39,7 +39,7 @@ \pnum \begin{note} \fref{iostreams.streampos} illustrates relationships among various types -described in this clause. A line from \textbf{A} to \textbf{B} indicates that \textbf{A} +described in this Clause. A line from \textbf{A} to \textbf{B} indicates that \textbf{A} is an alias (e.g., a typedef) for \textbf{B} or that \textbf{A} is defined in terms of \textbf{B}. diff --git a/source/iterators.tex b/source/iterators.tex index a326ce9fae..0d9b57c557 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -4904,7 +4904,7 @@ \begin{itemdescr} \pnum -The expression in the requires clause is equivalent to: +The expression in the \grammarterm{requires-clause} is equivalent to: \begin{codeblock} @\libconcept{indirectly_readable}@ && (requires(const I& i) { i.operator->(); } || diff --git a/source/numerics.tex b/source/numerics.tex index c551fc1dca..fe7131fc69 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -9873,7 +9873,7 @@ for which: \begin{itemize} \item - the function description's \returns clause + the function description's \returns element explicitly specifies a domain and those argument values fall outside the specified domain, diff --git a/source/threads.tex b/source/threads.tex index ed47860b9d..04fd7a45c5 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -48,7 +48,7 @@ in~\ref{res.on.exception.handling}. \begin{example} -Consider a function in this clause that is specified to throw exceptions of type +Consider a function in this Clause that is specified to throw exceptions of type \tcode{system_error} and specifies error conditions that include \tcode{operation_not_permitted} for a thread that does not have the privilege to perform the operation. Assume that, during the execution of this function, an \tcode{errno} @@ -5954,7 +5954,7 @@ \defnx{shared state}{future!shared state} consists of some state information and some (possibly not yet evaluated) \term{result}, which can be a (possibly void) value or an exception. \begin{note} -Futures, promises, and tasks defined in this clause reference such shared state. +Futures, promises, and tasks defined in this Clause reference such shared state. \end{note} \pnum diff --git a/source/time.tex b/source/time.tex index c6fbbb9afe..2ea2ae8ac1 100644 --- a/source/time.tex +++ b/source/time.tex @@ -8754,7 +8754,7 @@ \pnum \throws If a \tcode{const time_zone*} cannot be found -as described in the \returns clause, +as described in the \returns element, throws a \tcode{runtime_error}. \begin{note} On non-exceptional return, the return value is always a pointer to a valid \tcode{time_zone}. From a424ceb9525a42cfb96686842393c1515a8a0130 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johel=20Ernesto=20Guerrero=20Pe=C3=B1a?= Date: Thu, 3 Sep 2020 16:50:18 -0400 Subject: [PATCH 065/250] [fs.class.path, fs.path.nonmember] Fix inline whitespace (#4092) --- source/iostreams.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 4cbfc0e556..c9637db702 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -11796,7 +11796,7 @@ friend bool operator==(const path& lhs, const path& rhs) noexcept; friend strong_ordering operator<=>(const path& lhs, const path& rhs) noexcept; - friend path operator/ (const path& lhs, const path& rhs); + friend path operator/(const path& lhs, const path& rhs); // \ref{fs.path.native.obs}, native format observers const string_type& native() const noexcept; @@ -13479,7 +13479,7 @@ \indexlibrarymember{hash_value}{path}% \begin{itemdecl} -size_t hash_value (const path& p) noexcept; +size_t hash_value(const path& p) noexcept; \end{itemdecl} \begin{itemdescr} @@ -13534,7 +13534,7 @@ \indexlibrarymember{operator/}{path}% \begin{itemdecl} -friend path operator/ (const path& lhs, const path& rhs); +friend path operator/(const path& lhs, const path& rhs); \end{itemdecl} \begin{itemdescr} From f6205cb1b886878513fe8f040b96a1c4e6293f0f Mon Sep 17 00:00:00 2001 From: Eelis Date: Fri, 4 Sep 2020 09:08:34 +0200 Subject: [PATCH 066/250] [re, over.match.viable] Remove bad space before full stop. (#4138) --- source/overloading.tex | 2 +- source/regex.tex | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/overloading.tex b/source/overloading.tex index 99e924d21b..be977eec0f 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -1885,7 +1885,7 @@ viable only if it has an ellipsis in its parameter list\iref{dcl.fct}. For the purposes of overload resolution, any argument for which there is no corresponding parameter is -considered to ``match the ellipsis''\iref{over.ics.ellipsis} . +considered to ``match the ellipsis''\iref{over.ics.ellipsis}. \item A candidate function having more than \textit{m} diff --git a/source/regex.tex b/source/regex.tex index a379311090..6119df4e12 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -159,7 +159,7 @@ \tcode{X::length(p)} & \tcode{size_t} & Yields the smallest \tcode{i} such that \tcode{p[i] == 0}. Complexity is - linear in \tcode{i} . + linear in \tcode{i}. \\ \rowsep \tcode{v.translate(c)} & \tcode{X::char_type} @@ -2841,7 +2841,7 @@ & For all integers \tcode{0 < n < m.size()}, the end of the sequence that matched sub-expression \tcode{n}. Alternatively, if sub-expression \tcode{n} did not -participate in the match, then \tcode{last} . +participate in the match, then \tcode{last}. \\ \rowsep \tcode{m[n].matched} & From 43cb343ffa640ee7fa2b0f7e30fd5211918ae1a8 Mon Sep 17 00:00:00 2001 From: Alisdair Meredith Date: Tue, 8 Sep 2020 10:53:12 -0400 Subject: [PATCH 067/250] [class.virtual] Add \keyword markup for 'final' and 'override' (#4139) This indexes the two paragraphs that actually specify the rules for 'final' and 'override' applied to functions. --- source/classes.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index 6f324ca0cb..a23c934032 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3839,7 +3839,7 @@ \pnum If a virtual function \tcode{f} in some class \tcode{B} is marked with the -\grammarterm{virt-specifier} \tcode{final} and in a class \tcode{D} derived from \tcode{B} +\grammarterm{virt-specifier} \keyword{final} and in a class \tcode{D} derived from \tcode{B} a function \tcode{D::f} overrides \tcode{B::f}, the program is ill-formed. \begin{example} \begin{codeblock} @@ -3854,7 +3854,7 @@ \end{example} \pnum -If a virtual function is marked with the \grammarterm{virt-specifier} \tcode{override} and +If a virtual function is marked with the \grammarterm{virt-specifier} \keyword{override} and does not override a member function of a base class, the program is ill-formed. \begin{example} \begin{codeblock} From 3511d82b85d94ba944937ea1ddf1c0f8d2d9dff5 Mon Sep 17 00:00:00 2001 From: Eelis Date: Tue, 8 Sep 2020 19:23:21 +0200 Subject: [PATCH 068/250] [std] Remove superfluous final \rowsep or \hline in tables. (#4157) --- source/atomics.tex | 4 ++-- source/containers.tex | 4 ++-- source/diagnostics.tex | 2 +- source/iostreams.tex | 6 +++--- source/lib-intro.tex | 4 ++-- source/preprocessor.tex | 2 +- source/regex.tex | 2 +- source/time.tex | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/source/atomics.tex b/source/atomics.tex index 0a065c3aa6..d021dc8127 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -2230,7 +2230,7 @@ bitwise exclusive or \\ \tcode{and} & \tcode{\&} & - bitwise and &&&\\\hline + bitwise and &&&\\ \end{floattable} \indexlibraryglobal{atomic_fetch_add}% @@ -2575,7 +2575,7 @@ addition & \tcode{sub} & \tcode{-} & - subtraction \\ \hline + subtraction \\ \end{floattable} \indexlibraryglobal{atomic_fetch_add}% diff --git a/source/containers.tex b/source/containers.tex index b3aa62d87e..9a953467d0 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -27,7 +27,7 @@ \tcode{}, \tcode{} \\ \rowsep \ref{container.adaptors} & Container adaptors & \tcode{}, \tcode{} \\ \rowsep -\ref{views} & Views & \tcode{} \\ \rowsep +\ref{views} & Views & \tcode{} \\ \end{libsumtab} @@ -411,7 +411,7 @@ \tcode{a.crend()} & \tcode{const_reverse_iterator} & \tcode{const_cast(a).rend()} & - constant \\ \rowsep + constant \\ \end{libreqtab4a} \pnum diff --git a/source/diagnostics.tex b/source/diagnostics.tex index e32db0f167..bef5929e27 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -18,7 +18,7 @@ \ref{std.exceptions} & Exception classes & \tcode{} \\ \rowsep \ref{assertions} & Assertions & \tcode{} \\ \rowsep \ref{errno} & Error numbers & \tcode{} \\ \rowsep -\ref{syserr} & System error support & \tcode{} \\ \rowsep +\ref{syserr} & System error support & \tcode{} \\ \end{libsumtab} \rSec1[std.exceptions]{Exception classes} diff --git a/source/iostreams.tex b/source/iostreams.tex index c9637db702..a88e37ee9c 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -1714,7 +1714,7 @@ \tcode{p - q} & \tcode{streamoff} & distance & - \tcode{p == q + (p - q)} \\ \rowsep + \tcode{p == q + (p - q)} \\ \end{libreqtab4c} \pnum @@ -13685,7 +13685,7 @@ For POSIX-based systems, native and generic formats are equivalent and the character sequence should always be interpreted in the same way. \end{note} -\\\rowsep +\\ \end{floattable} \rSec3[fs.enum.file.type]{Enum class \tcode{file_type}} @@ -13847,7 +13847,7 @@ \tcode{all | set_uid | set_gid | sticky_bit} \\ \rowsep \tcode{unknown} & \tcode{0xFFFF} & & The permissions are not known, such as when a \tcode{file_status} object - is created without specifying the permissions \\ \rowsep + is created without specifying the permissions \\ \end{floattable} \rSec3[fs.enum.perm.opts]{Enum class \tcode{perm_options}} diff --git a/source/lib-intro.tex b/source/lib-intro.tex index c46d2b43ba..f4e4ce81ce 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1498,7 +1498,7 @@ \ref{concepts} & Concepts library & \tcode{} \\ \rowsep \ref{meta} & Type traits & \tcode{} \\ \rowsep \ref{bit} & Bit manipulation & \tcode{} \\ \rowsep -\ref{atomics} & Atomics & \tcode{} \\ \rowsep +\ref{atomics} & Atomics & \tcode{} \\ \end{libsumtab} \pnum @@ -1926,7 +1926,7 @@ \tcode{!(a == np)} \\ \tcode{np != a} & & - \\ \rowsep + \\ \end{oldconcepttable} \rSec3[hash.requirements]{\oldconcept{Hash} requirements} diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 5fb18c0b19..2b56345b55 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -1771,7 +1771,7 @@ \defnxname{cpp_using_enum} & \tcode{201907L} \\ \rowsep \defnxname{cpp_variable_templates} & \tcode{201304L} \\ \rowsep \defnxname{cpp_variadic_templates} & \tcode{200704L} \\ \rowsep -\defnxname{cpp_variadic_using} & \tcode{201611L} \\ \rowsep +\defnxname{cpp_variadic_using} & \tcode{201611L} \\ \end{LongTable} \pnum diff --git a/source/regex.tex b/source/regex.tex index 6119df4e12..fe572842e4 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -1213,7 +1213,7 @@ \tcode{"s"} & \tcode{L"s"} & \tcode{ctype_base::space} \\ \rowsep \tcode{"upper"} & \tcode{L"upper"} & \tcode{ctype_base::upper} \\ \rowsep \tcode{"w"} & \tcode{L"w"} & \tcode{ctype_base::alnum} \\ \rowsep -\tcode{"xdigit"} & \tcode{L"xdigit"} & \tcode{ctype_base::xdigit} \\ \rowsep +\tcode{"xdigit"} & \tcode{L"xdigit"} & \tcode{ctype_base::xdigit} \\ \end{floattable} \rSec1[re.regex]{Class template \tcode{basic_regex}} diff --git a/source/time.tex b/source/time.tex index 2ea2ae8ac1..1c1193197a 100644 --- a/source/time.tex +++ b/source/time.tex @@ -21,7 +21,7 @@ \ref{time.zone} & Time zones & \\ \ref{time.format} & Formatting & \\ \ref{time.parse} & Parsing & \\ \rowsep -\ref{ctime.syn} & C library time utilities & \tcode{} \\ \rowsep +\ref{ctime.syn} & C library time utilities & \tcode{} \\ \end{libsumtab} \pnum From 0a8dc25e3d36bd6cf98e89fccf05d2ed3fc5a2ba Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 8 Sep 2020 21:02:40 +0200 Subject: [PATCH 069/250] [range.elements.iterator] Add missing 'friend' for operator-. (#4158) --- source/ranges.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index cf9ced9115..3873dba13c 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -6641,7 +6641,7 @@ \indexlibrarymember{operator-}{elements_view::iterator}% \begin{itemdecl} -constexpr @\exposid{iterator}@ operator-(const @\exposid{iterator}@& x, difference_type y) +friend constexpr @\exposid{iterator}@ operator-(const @\exposid{iterator}@& x, difference_type y) requires @\libconcept{random_access_range}@<@\exposid{Base}@>; \end{itemdecl} @@ -6653,7 +6653,7 @@ \indexlibrarymember{operator-}{elements_view::iterator}% \begin{itemdecl} -constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) +friend constexpr difference_type operator-(const @\exposid{iterator}@& x, const @\exposid{iterator}@& y) requires @\libconcept{random_access_range}@<@\exposid{Base}@>; \end{itemdecl} From 822f43677224f52ed2f6d05d55b2becdeece1d96 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 7 Sep 2020 23:13:15 +0200 Subject: [PATCH 070/250] [macros] Fix PDF links to clauses and annexes Such links were pointing to immediately after the clause or annex title, not to immediately before them. The issue was introduced with commit beb88157cc49f76677fc467db8ec4a523dbc41d0. Fixes NB JP 014 and JP 015 (C++20 DIS) --- source/macros.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/macros.tex b/source/macros.tex index a478f5f5cb..359ded1661 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -70,8 +70,7 @@ % Set the xref label for a clause to be "Clause n", not just "n". \makeatletter \newcommand{\customlabel}[2]{% -\protected@write \@auxout {}{\string \newlabel {#1}{{#2}{\thepage}{#2}{#1}{}} }% -\hypertarget{#1}{}% +\@bsphack \begingroup \protected@edef \@currentlabel {\protect \M@TitleReference{#2}{\M@currentTitle}}\MNR@label{#1}\endgroup \@esphack% } \makeatother \newcommand{\clauselabel}[1]{\customlabel{#1}{Clause \thechapter}} From b8b6f9415b311dabf1ee421770a65594d9d3b5f5 Mon Sep 17 00:00:00 2001 From: Eelis Date: Wed, 9 Sep 2020 10:50:35 +0200 Subject: [PATCH 071/250] [meta.type.synop] Fix bad indentation. (#4164) --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index 6989d1fdd5..4dce607a2d 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -16198,7 +16198,7 @@ = is_nothrow_default_constructible::value; template inline constexpr bool is_nothrow_copy_constructible_v - = is_nothrow_copy_constructible::value; + = is_nothrow_copy_constructible::value; template inline constexpr bool is_nothrow_move_constructible_v = is_nothrow_move_constructible::value; From 2131d260ffbc0662e297e1ff6d092813aa89c75a Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 7 Sep 2020 09:19:58 +0200 Subject: [PATCH 072/250] [except.uncaught] Remove parentheses when not invoking a function Fixes NB JP 013 (C++20 DIS) --- source/exceptions.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/exceptions.tex b/source/exceptions.tex index 470407df55..65e20f2d06 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -1096,7 +1096,7 @@ will eventually cause a call to the function \tcode{std::terminate}. -\rSec2[except.uncaught]{The \tcode{std::uncaught_exceptions()} function}% +\rSec2[except.uncaught]{The \tcode{std::uncaught_exceptions} function}% \indexlibraryglobal{uncaught_exceptions} \pnum @@ -1110,6 +1110,6 @@ If an exception is rethrown~(\ref{expr.throw}, \ref{propagation}), it is considered uncaught from the point of rethrow until the rethrown exception is caught. -The function \tcode{std::uncaught_exceptions()}\iref{uncaught.exceptions} +The function \tcode{std::uncaught_exceptions}\iref{uncaught.exceptions} returns the number of uncaught exceptions in the current thread.% \indextext{exception handling|)} From cbc323af34fe50f3290ad60a4efe7d9e59c70903 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 9 Sep 2020 11:55:23 -0700 Subject: [PATCH 073/250] Fix all hanging paragraphs by adding "General" sections. Fixes ISO/CS 018 (C++20 DIS). --- source/algorithms.tex | 12 +++++++++ source/atomics.tex | 6 +++++ source/basic.tex | 12 +++++++++ source/classes.tex | 18 +++++++++++++ source/compatibility.tex | 14 ++++++++++ source/containers.tex | 6 +++++ source/declarations.tex | 16 +++++++++++ source/diagnostics.tex | 8 ++++++ source/exceptions.tex | 2 ++ source/expressions.tex | 12 +++++++++ source/future.tex | 18 +++++++++++++ source/grammar.tex | 2 ++ source/intro.tex | 2 ++ source/iostreams.tex | 48 +++++++++++++++++++++++++++++++++ source/iterators.tex | 22 +++++++++++++++ source/lib-intro.tex | 16 +++++++++++ source/locales.tex | 34 +++++++++++++++++++++++ source/numerics.tex | 8 ++++++ source/overloading.tex | 14 ++++++++++ source/preprocessor.tex | 2 ++ source/ranges.tex | 14 ++++++++++ source/regex.tex | 12 +++++++++ source/statements.tex | 6 +++++ source/strings.tex | 12 +++++++++ source/support.tex | 22 +++++++++++++++ source/templates.tex | 24 +++++++++++++++++ source/threads.tex | 42 +++++++++++++++++++++++++++++ source/time.tex | 6 +++++ source/utilities.tex | 58 ++++++++++++++++++++++++++++++++++++++++ tools/fix-hanging.pl | 24 +++++++++++++++++ 30 files changed, 492 insertions(+) create mode 100644 tools/fix-hanging.pl diff --git a/source/algorithms.tex b/source/algorithms.tex index d65c597753..b31b41ab86 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -5959,6 +5959,8 @@ \rSec1[alg.sorting]{Sorting and related operations} +\rSec2[alg.sorting.general]{General} + \pnum The operations in~\ref{alg.sorting} defined directly in namespace \tcode{std} have two versions: @@ -6568,6 +6570,8 @@ \rSec2[alg.binary.search]{Binary search} +\rSec3[alg.binary.search.general]{General} + \pnum All of the algorithms in this subclause are versions of binary search and assume that the sequence being searched @@ -7273,6 +7277,8 @@ \rSec2[alg.set.operations]{Set operations on sorted structures} +\rSec3[alg.set.operations.general]{General} + \pnum This subclause defines all the basic set operations on sorted structures. They also work with \tcode{multiset}s\iref{multiset} @@ -7731,6 +7737,8 @@ \rSec2[alg.heap.operations]{Heap operations} +\rSec3[alg.heap.operations.general]{General} + \pnum A random access range \range{a}{b} is a \defnx{heap with respect to \tcode{comp} and \tcode{proj}} @@ -8996,6 +9004,8 @@ \rSec1[numeric.ops]{Generalized numeric operations} +\rSec2[numeric.ops.general]{General} + \pnum \begin{note} The use of closed ranges as well as semi-open ranges @@ -10094,6 +10104,8 @@ \rSec1[specialized.algorithms]{Specialized \tcode{} algorithms} +\rSec2[specialized.algorithms.general]{General} + \pnum The contents specified in this subclause~\ref{specialized.algorithms} are declared in the header \libheaderref{memory}. diff --git a/source/atomics.tex b/source/atomics.tex index d021dc8127..ee8985e264 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -696,6 +696,8 @@ \rSec1[atomics.ref.generic]{Class template \tcode{atomic_ref}} +\rSec2[atomics.ref.generic.general]{General} + \indexlibraryglobal{atomic_ref}% \indexlibrarymember{value_type}{atomic_ref}% \begin{codeblock} @@ -1534,6 +1536,8 @@ \rSec1[atomics.types.generic]{Class template \tcode{atomic}} +\rSec2[atomics.types.generic.general]{General} + \indexlibraryglobal{atomic}% \indexlibrarymember{value_type}{atomic}% \begin{codeblock} @@ -2715,6 +2719,8 @@ \rSec2[util.smartptr.atomic]{Partial specializations for smart pointers}% \indextext{atomic!smart pointers|(}% +\rSec3[util.smartptr.atomic.general]{General} + \pnum The library provides partial specializations of the \tcode{atomic} template for shared-ownership smart pointers\iref{smartptr}. diff --git a/source/basic.tex b/source/basic.tex index b3d20cff3d..6cd88beec6 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -1376,6 +1376,8 @@ \indextext{scope|)} \rSec1[basic.lookup]{Name lookup}% + +\rSec2[basic.lookup.general]{General}% \indextext{scope!name lookup and|(}% \indextext{lookup!name|(}% @@ -1994,6 +1996,8 @@ \rSec2[basic.lookup.qual]{Qualified name lookup} +\rSec3[basic.lookup.qual.general]{General} + \pnum \indextext{lookup!qualified name|(}% \indextext{name!qualified}% @@ -3732,6 +3736,8 @@ \rSec2[basic.stc]{Storage duration} +\rSec3[basic.stc.general]{General} + \pnum \indextext{storage duration|(}% The \defn{storage duration} is the property of an object that defines the minimum @@ -3843,6 +3849,8 @@ specified in~\ref{class.copy.elision}. \rSec3[basic.stc.dynamic]{Dynamic storage duration}% + +\rSec4[basic.stc.dynamic.general]{General}% \indextext{storage duration!dynamic|(} \pnum @@ -4653,6 +4661,8 @@ \end{example} \rSec1[basic.types]{Types}% + +\rSec2[basic.types.general]{General}% \indextext{type|(} \pnum @@ -5758,6 +5768,8 @@ \rSec2[intro.multithread]{Multi-threaded executions and data races} +\rSec3[intro.multithread.general]{General} + \pnum \indextext{threads!multiple|(}% \indextext{atomic!operation|(}% diff --git a/source/classes.tex b/source/classes.tex index a23c934032..b8ad74fcc8 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -437,6 +437,8 @@ if its \grammarterm{template-name} names a class template. \rSec1[class.mem]{Class members}% + +\rSec2[class.mem.general]{General}% \indextext{declaration!member}% \indextext{data member|see{member}} @@ -947,6 +949,8 @@ \end{note} \rSec2[class.mfct.non-static]{Non-static member functions}% + +\rSec3[class.mfct.non-static.general]{General}% \indextext{member function!non-static} \pnum @@ -1226,6 +1230,8 @@ would be a constexpr function. \rSec2[class.ctor]{Constructors}% + +\rSec3[class.ctor.general]{General}% \indextext{constructor}% \indextext{special member function|see{constructor}}% @@ -2459,6 +2465,8 @@ \rSec2[class.conv]{Conversions} +\rSec3[class.conv.general]{General} + \pnum \indextext{conversion!class}% \indextext{constructor, conversion by|see{conversion, user-defined}}% @@ -2730,6 +2738,8 @@ \end{example} \rSec2[class.static]{Static members}% + +\rSec3[class.static.general]{General}% \indextext{member!static}% \pnum @@ -3103,6 +3113,8 @@ \indextext{class|)} \rSec1[class.union]{Unions}% + +\rSec2[class.union.general]{General}% \indextext{\idxcode{union}} \pnum @@ -3428,6 +3440,8 @@ \end{note} \rSec1[class.derived]{Derived classes}% + +\rSec2[class.derived.general]{General}% \indextext{derived class|(} \indextext{virtual base class|see{base class, virtual}} @@ -4477,6 +4491,8 @@ \end{example} \rSec1[class.access]{Member access control}% + +\rSec2[class.access.general]{General}% \indextext{access control|(} \indextext{protection|see{access control}} @@ -5459,6 +5475,8 @@ \indextext{access control|)} \rSec1[class.init]{Initialization}% + +\rSec2[class.init.general]{General}% \indextext{initialization!class object|(}% \indextext{initialization!default constructor and}% \indextext{initialization!constructor and} diff --git a/source/compatibility.tex b/source/compatibility.tex index 418170206b..32e4d8e8ab 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -3,6 +3,8 @@ \rSec1[diff.cpp17]{\Cpp{} and ISO \CppXVII{}} +\rSec2[diff.cpp17.general]{General} + \pnum \indextext{summary!compatibility with ISO \CppXVII{}}% This subclause lists the differences between \Cpp{} and @@ -702,6 +704,8 @@ \rSec1[diff.cpp14]{\Cpp{} and ISO \CppXIV{}} +\rSec2[diff.cpp14.general]{General} + \pnum \indextext{summary!compatibility with ISO \CppXIV{}}% This subclause lists the differences between \Cpp{} and @@ -1059,6 +1063,8 @@ \rSec1[diff.cpp11]{\Cpp{} and ISO \CppXI{}} +\rSec2[diff.cpp11.general]{General} + \pnum \indextext{summary!compatibility with ISO \CppXI{}}% This subclause lists the differences between \Cpp{} and @@ -1213,6 +1219,8 @@ \rSec1[diff.cpp03]{\Cpp{} and ISO \CppIII{}} +\rSec2[diff.cpp03.general]{General} + \pnum \indextext{summary!compatibility with ISO \CppIII{}}% This subclause lists the differences between \Cpp{} and @@ -1753,6 +1761,8 @@ \rSec1[diff.iso]{\Cpp{} and ISO C} +\rSec2[diff.iso.general]{General} + \pnum \indextext{summary!compatibility with ISO C}% This subclause lists the differences between \Cpp{} and ISO C, @@ -2630,6 +2640,8 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \rSec1[diff.library]{C standard library} + +\rSec2[diff.library.general]{General} \indextext{library!C standard}% \pnum @@ -2782,6 +2794,8 @@ \rSec2[diff.mods.to.behavior]{Modifications to behavior} +\rSec3[diff.mods.to.behavior.general]{General} + \pnum Header \libheaderref{cstdlib}: The following functions have different behavior: diff --git a/source/containers.tex b/source/containers.tex index 9a953467d0..bccb928032 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -1528,6 +1528,8 @@ \rSec2[associative.reqmts]{Associative containers} +\rSec3[associative.reqmts.general]{General} + \pnum Associative containers provide fast retrieval of data based on keys. The library provides four basic kinds of associative containers: @@ -2182,6 +2184,8 @@ \indextext{associative containers!unordered|see{unordered associative containers}} \indextext{hash tables|see{unordered associative containers}} +\rSec3[unord.req.general]{General} + \pnum \indextext{unordered associative containers!complexity}% Unordered associative containers provide an ability for fast retrieval @@ -10326,6 +10330,8 @@ \rSec2[stack]{Class template \tcode{stack}} +\rSec3[stack.general]{General} + \pnum \indexlibraryglobal{stack}% Any sequence container supporting operations diff --git a/source/declarations.tex b/source/declarations.tex index d6ebb1c4aa..f106cc939e 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -244,6 +244,8 @@ \end{note} \rSec1[dcl.spec]{Specifiers}% + +\rSec2[dcl.spec.general]{General}% \indextext{specifier|(} \pnum @@ -1116,6 +1118,8 @@ \end{note} \rSec2[dcl.type]{Type specifiers}% + +\rSec3[dcl.type.general]{General}% \indextext{specifier!type|see{type specifier}} \pnum @@ -1661,6 +1665,8 @@ \end{example} \rSec3[dcl.spec.auto]{Placeholder type specifiers}% + +\rSec4[dcl.spec.auto.general]{General}% \indextext{type specifier!\idxcode{auto}} \indextext{type specifier!\idxcode{decltype(auto)}}% @@ -2087,6 +2093,8 @@ \indextext{specifier|)}% \rSec1[dcl.decl]{Declarators}% + +\rSec2[dcl.decl.general]{General}% \indextext{declarator|(} \indextext{initialization!class object|seealso{constructor}}% @@ -2472,6 +2480,8 @@ \end{example} \rSec2[dcl.meaning]{Meaning of declarators}% + +\rSec3[dcl.meaning.general]{General}% \indextext{declarator!meaning of|(} \pnum @@ -4043,6 +4053,8 @@ \indextext{declarator!meaning of|)} \rSec1[dcl.init]{Initializers}% + +\rSec2[dcl.init.general]{General}% \indextext{initialization|(} \pnum @@ -7001,6 +7013,8 @@ \end{note} \rSec1[basic.namespace]{Namespaces}% + +\rSec2[basic.namespace.general]{General}% \indextext{namespaces|(} \pnum @@ -7034,6 +7048,8 @@ see~\ref{basic.scope.namespace}. \rSec2[namespace.def]{Namespace definition}% + +\rSec3[namespace.def.general]{General}% \indextext{definition!namespace}% \indextext{namespace!definition} diff --git a/source/diagnostics.tex b/source/diagnostics.tex index bef5929e27..fa6af0cd30 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -23,6 +23,8 @@ \rSec1[std.exceptions]{Exception classes} +\rSec2[std.exceptions.general]{General} + \pnum The \Cpp{} standard library provides classes to be used to report certain errors\iref{res.on.exception.handling} in \Cpp{} programs. @@ -442,6 +444,8 @@ \rSec1[assertions]{Assertions} +\rSec2[assertions.general]{General} + \pnum The header \libheaderdef{cassert} provides a macro for documenting \Cpp{} program assertions and a mechanism @@ -479,6 +483,8 @@ \rSec1[errno]{Error numbers} +\rSec2[errno.general]{General} + \pnum The contents of the header \libheaderdef{cerrno} are the same as the POSIX header \libheader{errno.h}, except that \tcode{errno} shall be defined as a macro. @@ -658,6 +664,8 @@ \rSec1[syserr]{System error support} +\rSec2[syserr.general]{General} + \pnum This subclause describes components that the standard library and \Cpp{} programs may use to report error conditions originating from diff --git a/source/exceptions.tex b/source/exceptions.tex index 65e20f2d06..76526747bb 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -983,6 +983,8 @@ \rSec1[except.special]{Special functions} +\rSec2[except.special.general]{General} + \pnum The function \tcode{std::terminate}\iref{except.terminate} is used by the exception diff --git a/source/expressions.tex b/source/expressions.tex index f240f67a3e..efd1f101c5 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -468,6 +468,8 @@ \rSec1[conv]{Standard conversions} +\rSec2[conv.general]{General} + \indextext{implicit conversion|see{conversion, implicit}} \indextext{contextually converted to bool|see{conversion, contextual}} \indextext{rvalue!lvalue conversion to|see{conversion, lvalue-to-rvalue}}% @@ -1240,6 +1242,8 @@ \rSec2[expr.prim.id]{Names} +\rSec3[expr.prim.id.general]{General} + \begin{bnf} \nontermdef{id-expression}\br unqualified-id\br @@ -1522,6 +1526,8 @@ \end{example} \rSec2[expr.prim.lambda]{Lambda expressions}% + +\rSec3[expr.prim.lambda.general]{General}% \indextext{expression!lambda|(} \begin{bnf} @@ -2471,6 +2477,8 @@ \indextext{expression!fold|)}% \rSec2[expr.prim.req]{Requires expressions} + +\rSec3[expr.prim.req.general]{General} \indextext{expression!requires|(}% \pnum @@ -2800,6 +2808,8 @@ \rSec1[expr.compound]{Compound expressions} \rSec2[expr.post]{Postfix expressions}% + +\rSec3[expr.post.general]{General}% \indextext{expression!postfix|(} \pnum @@ -4113,6 +4123,8 @@ \rSec2[expr.unary]{Unary expressions} +\rSec3[expr.unary.general]{General} + \pnum \indextext{expression!unary|(}% Expressions with unary operators group right-to-left. diff --git a/source/future.tex b/source/future.tex index 7e9fa1c768..e258ad16b1 100644 --- a/source/future.tex +++ b/source/future.tex @@ -3,6 +3,8 @@ \newcommand{\requires}{\Fundesc{Requires}} +\rSec1[depr.general]{General} + \pnum This Clause describes features of the \Cpp{} Standard that are specified for compatibility with existing implementations. @@ -207,6 +209,8 @@ \rSec1[depr.c.headers]{C headers} +\rSec2[depr.c.headers.general]{General} + \pnum For compatibility with the \indextext{library!C standard}% @@ -500,6 +504,8 @@ \rSec2[depr.strstreambuf]{Class \tcode{strstreambuf}} +\rSec3[depr.strstreambuf.general]{General} + \indexlibraryglobal{strstreambuf}% \begin{codeblock} namespace std { @@ -1115,6 +1121,8 @@ \rSec2[depr.istrstream]{Class \tcode{istrstream}} +\rSec3[depr.istrstream.general]{General} + \indexlibraryglobal{istrstream}% \begin{codeblock} namespace std { @@ -1207,6 +1215,8 @@ \rSec2[depr.ostrstream]{Class \tcode{ostrstream}} +\rSec3[depr.ostrstream.general]{General} + \indexlibraryglobal{ostrstream}% \begin{codeblock} namespace std { @@ -1337,6 +1347,8 @@ \rSec2[depr.strstream]{Class \tcode{strstream}} +\rSec3[depr.strstream.general]{General} + \indexlibraryglobal{strstream}% \begin{codeblock} namespace std { @@ -2022,6 +2034,8 @@ \rSec1[depr.locale.stdcvt]{Deprecated standard code conversion facets} +\rSec2[depr.locale.stdcvt.general]{General} + \pnum The header \libheaderdef{codecvt} provides code conversion facets for various character encodings. @@ -2135,6 +2149,8 @@ \rSec1[depr.conversions]{Deprecated convenience conversion interfaces} +\rSec2[depr.conversions.general]{General} + \pnum The header \libheaderref{locale} has the following additions: @@ -2659,6 +2675,8 @@ \rSec1[depr.atomics]{Deprecated atomic operations} +\rSec2[depr.atomics.general]{General} + \pnum The header \libheaderrefx{atomic}{atomics.syn} has the following additions. diff --git a/source/grammar.tex b/source/grammar.tex index a4da2357d2..a264fbd7a1 100644 --- a/source/grammar.tex +++ b/source/grammar.tex @@ -1,5 +1,7 @@ \infannex{gram}{Grammar summary} +\rSec1[gram.general]{General} + \pnum \indextext{grammar}% \indextext{summary!syntax}% diff --git a/source/intro.tex b/source/intro.tex index 275b1a9545..6bceaa6ded 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -399,6 +399,8 @@ \indextext{order of evaluation in expression|see{expression, order of evaluation of}}% \indextext{multiple threads|see{threads, multiple}}% +\rSec2[intro.compliance.general]{General} + \pnum \indextext{conformance requirements|(}% \indextext{conformance requirements!general|(}% diff --git a/source/iostreams.tex b/source/iostreams.tex index a88e37ee9c..a26f795549 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -701,6 +701,8 @@ \end{itemdescr} \rSec2[ios.base]{Class \tcode{ios_base}} + +\rSec3[ios.base.general]{General} \indexlibraryglobal{ios_base}% \begin{codeblock} namespace std { @@ -2912,6 +2914,8 @@ \rSec2[streambuf]{Class template \tcode{basic_streambuf}} +\rSec3[streambuf.general]{General} + \indexlibraryglobal{basic_streambuf}% \begin{codeblock} namespace std { @@ -4133,12 +4137,16 @@ \rSec2[input.streams]{Input streams} +\rSec3[input.streams.general]{General} + \pnum The header \libheader{istream} defines two types and a function signature that control input from a stream buffer along with a function template that extracts from stream rvalues. \rSec3[istream]{Class template \tcode{basic_istream}} +\rSec4[istream.general]{General} + \indexlibraryglobal{basic_istream}% \begin{codeblock} namespace std { @@ -5571,6 +5579,8 @@ \rSec3[iostreamclass]{Class template \tcode{basic_iostream}} +\rSec4[iostreamclass.general]{General} + \indexlibraryglobal{basic_iostream}% \begin{codeblock} namespace std { @@ -5686,6 +5696,8 @@ \rSec2[output.streams]{Output streams} +\rSec3[output.streams.general]{General} + \pnum The header \libheader{ostream} defines a type and several function signatures that control output to a @@ -5693,6 +5705,8 @@ \rSec3[ostream]{Class template \tcode{basic_ostream}} +\rSec4[ostream.general]{General} + \indexlibraryglobal{basic_ostream}% \begin{codeblock} namespace std { @@ -7367,6 +7381,8 @@ as described in~\ref{string.classes}. \rSec2[stringbuf]{Class template \tcode{basic_stringbuf}} + +\rSec3[stringbuf.general]{General} \indexlibraryglobal{basic_stringbuf}% \begin{codeblock} namespace std { @@ -8168,6 +8184,8 @@ \rSec2[istringstream]{Class template \tcode{basic_istringstream}} +\rSec3[istringstream.general]{General} + \indexlibraryglobal{basic_istringstream}% \begin{codeblock} namespace std { @@ -8484,6 +8502,8 @@ \rSec2[ostringstream]{Class template \tcode{basic_ostringstream}} +\rSec3[ostringstream.general]{General} + \indexlibraryglobal{basic_ostringstream}% \begin{codeblock} namespace std { @@ -8805,6 +8825,8 @@ \rSec2[stringstream]{Class template \tcode{basic_stringstream}} +\rSec3[stringstream.general]{General} + \indexlibraryglobal{basic_stringstream}% \begin{codeblock} namespace std { @@ -9197,6 +9219,8 @@ \rSec2[filebuf]{Class template \tcode{basic_filebuf}} +\rSec3[filebuf.general]{General} + \indexlibraryglobal{basic_filebuf}% \begin{codeblock} namespace std { @@ -9964,6 +9988,8 @@ \rSec2[ifstream]{Class template \tcode{basic_ifstream}} +\rSec3[ifstream.general]{General} + \indexlibraryglobal{basic_ifstream}% \begin{codeblock} namespace std { @@ -10197,6 +10223,8 @@ \rSec2[ofstream]{Class template \tcode{basic_ofstream}} +\rSec3[ofstream.general]{General} + \indexlibraryglobal{basic_ofstream}% \begin{codeblock} namespace std { @@ -10428,6 +10456,8 @@ \rSec2[fstream]{Class template \tcode{basic_fstream}} +\rSec3[fstream.general]{General} + \indexlibraryglobal{basic_fstream}% \begin{codeblock} namespace std { @@ -11281,6 +11311,8 @@ \rSec2[fs.conformance]{Conformance} +\rSec3[fs.conformance.general]{General} + \pnum Conformance is specified in terms of behavior. Ideal behavior is not always implementable, so the conformance subclauses take that into account. @@ -11366,6 +11398,8 @@ \rSec2[fs.req]{Requirements} +\rSec3[fs.req.general]{General} + \pnum Throughout subclause~\ref{filesystems}, \tcode{char}, \tcode{wchar_t}, \tcode{char8_t}, \tcode{char16_t}, and \tcode{char32_t} are collectively called @@ -11666,6 +11700,8 @@ \rSec2[fs.class.path]{Class \tcode{path}} +\rSec3[fs.class.path.general]{General} + \indexlibraryglobal{path}% \pnum An object of class \tcode{path} represents a path @@ -13545,6 +13581,8 @@ \rSec2[fs.class.filesystem.error]{Class \tcode{filesystem_error}} +\rSec3[fs.class.filesystem.error.general]{General} + \indexlibraryglobal{filesystem_error}% \begin{codeblock} namespace std::filesystem { @@ -13908,6 +13946,8 @@ \rSec2[fs.class.file.status]{Class \tcode{file_status}} +\rSec3[fs.class.file.status.general]{General} + \indexlibraryglobal{file_status}% \begin{codeblock} namespace std::filesystem { @@ -14007,6 +14047,8 @@ \rSec2[fs.class.directory.entry]{Class \tcode{directory_entry}} +\rSec3[fs.class.directory.entry.general]{General} + \indexlibraryglobal{directory_entry}% \begin{codeblock} namespace std::filesystem { @@ -14488,6 +14530,8 @@ \rSec2[fs.class.directory.iterator]{Class \tcode{directory_iterator}} +\rSec3[fs.class.directory.iterator.general]{General} + \indexlibraryglobal{directory_iterator}% \pnum An object of type \tcode{directory_iterator} provides an iterator for a @@ -14723,6 +14767,8 @@ \rSec2[fs.class.rec.dir.itr]{Class \tcode{recursive_directory_iterator}} +\rSec3[fs.class.rec.dir.itr.general]{General} + \indexlibraryglobal{recursive_directory_iterator}% \pnum An object of type \tcode{recursive_directory_iterator} provides an iterator for @@ -15091,6 +15137,8 @@ \rSec2[fs.op.funcs]{Filesystem operation functions} +\rSec3[fs.op.funcs.general]{General} + \pnum Filesystem operation functions query or modify files, including directories, in external storage. diff --git a/source/iterators.tex b/source/iterators.tex index 0d9b57c557..1426e02e76 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1844,6 +1844,8 @@ \rSec2[iterator.cpp17]{\Cpp{}17 iterator requirements} +\rSec3[iterator.cpp17.general]{General} + \pnum In the following sections, \tcode{a} @@ -2602,6 +2604,8 @@ \rSec1[iterator.primitives]{Iterator primitives} +\rSec2[iterator.primitives.general]{General} + \pnum To simplify the use of iterators, the library provides several classes and functions. @@ -2796,6 +2800,8 @@ \rSec2[range.iter.ops]{Range iterator operations} +\rSec3[range.iter.ops.general]{General} + \pnum The library includes the function templates \tcode{ranges::advance}, \tcode{ranges::distance}, @@ -3063,6 +3069,8 @@ \rSec2[reverse.iterators]{Reverse iterators} +\rSec3[reverse.iterators.general]{General} + \pnum Class template \tcode{reverse_iterator} is an iterator adaptor that iterates from the end of the sequence defined by its underlying iterator to the beginning of that sequence. @@ -3648,6 +3656,8 @@ \rSec2[insert.iterators]{Insert iterators} +\rSec3[insert.iterators.general]{General} + \pnum To make it possible to deal with insertion in the same way as writing into an array, a special kind of iterator adaptors, called @@ -4043,6 +4053,8 @@ \rSec2[move.iterators]{Move iterators and sentinels} +\rSec3[move.iterators.general]{General} + \pnum Class template \tcode{move_iterator} is an iterator adaptor with the same behavior as the underlying iterator except that its @@ -5687,6 +5699,8 @@ \rSec1[stream.iterators]{Stream iterators} +\rSec2[stream.iterators.general]{General} + \pnum To make it possible for algorithmic templates to work directly with input/output streams, appropriate iterator-like @@ -5708,6 +5722,8 @@ \rSec2[istream.iterator]{Class template \tcode{istream_iterator}} +\rSec3[istream.iterator.general]{General} + \pnum \indexlibraryglobal{istream_iterator}% The class template \tcode{istream_iterator} @@ -5922,6 +5938,8 @@ \rSec2[ostream.iterator]{Class template \tcode{ostream_iterator}} +\rSec3[ostream.iterator.general]{General} + \pnum \indexlibraryglobal{ostream_iterator}% \tcode{ostream_iterator} @@ -6040,6 +6058,8 @@ \rSec2[istreambuf.iterator]{Class template \tcode{istreambuf_iterator}} +\rSec3[istreambuf.iterator.general]{General} + \pnum The class template @@ -6287,6 +6307,8 @@ \rSec2[ostreambuf.iterator]{Class template \tcode{ostreambuf_iterator}} +\rSec3[ostreambuf.iterator.general]{General} + \pnum The class template \tcode{ostreambuf_iterator} writes successive \textit{characters} onto the output stream diff --git a/source/lib-intro.tex b/source/lib-intro.tex index f4e4ce81ce..436cb69c18 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -439,6 +439,8 @@ \rSec1[description]{Method of description} +\rSec2[description.general]{General} + \pnum This subclause describes the conventions used to specify the \Cpp{} standard library. \ref{structure} describes the structure of the normative @@ -710,6 +712,8 @@ of other standards\iref{intro.refs}. \rSec2[conventions]{Other conventions} + +\rSec3[conventions.general]{General} \indextext{conventions}% \pnum @@ -911,6 +915,8 @@ \rSec4[character.seq]{Character sequences} +\rSec5[character.seq.general]{General} + \pnum The C standard library makes widespread use \indextext{library!C standard}% @@ -1102,6 +1108,8 @@ \rSec1[requirements]{Library-wide requirements} +\rSec2[requirements.general]{General} + \pnum This subclause specifies requirements that apply to the entire \Cpp{} standard library. \ref{\firstlibchapter} through \ref{\lastlibchapter} and \ref{depr} @@ -1122,6 +1130,8 @@ \rSec2[organization]{Library contents and organization} +\rSec3[organization.general]{General} + \pnum \ref{contents} describes the entities and macros defined in the \Cpp{} standard library. \ref{headers} lists the standard library headers and some constraints on those headers. @@ -1613,6 +1623,8 @@ \rSec2[utility.requirements]{Requirements on types and expressions} +\rSec3[utility.requirements.general]{General} + \pnum \ref{utility.arg.requirements} describes requirements on types and expressions used to instantiate templates @@ -1972,6 +1984,8 @@ \rSec3[allocator.requirements]{\oldconcept{Allocator} requirements} +\rSec4[allocator.requirements.general]{General} + \indextext{\idxoldconcept{Allocator}}% \pnum The library describes a standard set of requirements for \term{allocators}, @@ -2550,6 +2564,8 @@ \end{example} \rSec3[reserved.names]{Reserved names}% + +\rSec4[reserved.names.general]{General}% \indextext{name!reserved} \pnum diff --git a/source/locales.tex b/source/locales.tex index 4c34847d55..ff7495471a 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -111,6 +111,8 @@ \rSec2[locale]{Class \tcode{locale}} +\rSec3[locale.general]{General} + \begin{codeblock} namespace std { class locale { @@ -995,6 +997,8 @@ \rSec1[locale.categories]{Standard \tcode{locale} categories} +\rSec2[locale.categories.general]{General} + \pnum Each of the standard categories includes a family of facets. Some of these implement formatting or parsing of a datum, for use @@ -1044,6 +1048,8 @@ \rSec2[category.ctype]{The \tcode{ctype} category} +\rSec3[category.ctype.general]{General} + \indexlibraryglobal{ctype_base}% \begin{codeblock} namespace std { @@ -1075,6 +1081,8 @@ \rSec3[locale.ctype]{Class template \tcode{ctype}} +\rSec4[locale.ctype.general]{General} + \indexlibraryglobal{ctype}% \begin{codeblock} namespace std { @@ -1481,6 +1489,8 @@ \rSec3[facet.ctype.special]{\tcode{ctype} specialization} +\rSec4[facet.ctype.special.general]{General} + \indexlibraryglobal{ctype}% \begin{codeblock} namespace std { @@ -1772,6 +1782,8 @@ \rSec3[locale.codecvt]{Class template \tcode{codecvt}} +\rSec4[locale.codecvt.general]{General} + \indexlibraryglobal{codecvt}% \begin{codeblock} namespace std { @@ -2246,6 +2258,8 @@ \rSec2[category.numeric]{The numeric category} +\rSec3[category.numeric.general]{General} + \pnum The classes \tcode{num_get<>} @@ -2295,6 +2309,8 @@ \rSec3[locale.num.get]{Class template \tcode{num_get}} +\rSec4[locale.num.get.general]{General} + \indexlibraryglobal{num_get}% \begin{codeblock} namespace std { @@ -2703,6 +2719,8 @@ \rSec3[locale.nm.put]{Class template \tcode{num_put}} +\rSec4[locale.nm.put.general]{General} + \indexlibraryglobal{num_put}% \begin{codeblock} namespace std { @@ -3032,6 +3050,8 @@ \rSec3[locale.numpunct]{Class template \tcode{numpunct}} +\rSec4[locale.numpunct.general]{General} + \indexlibraryglobal{numpunct}% \begin{codeblock} namespace std { @@ -3287,6 +3307,8 @@ \rSec3[locale.collate]{Class template \tcode{collate}} +\rSec4[locale.collate.general]{General} + \indexlibraryglobal{collate}% \begin{codeblock} namespace std { @@ -3454,6 +3476,8 @@ \rSec2[category.time]{The time category} +\rSec3[category.time.general]{General} + \pnum Templates \tcode{time_get} @@ -3478,6 +3502,8 @@ \rSec3[locale.time.get]{Class template \tcode{time_get}} +\rSec4[locale.time.get.general]{General} + \indexlibraryglobal{time_get}% \begin{codeblock} namespace std { @@ -4072,6 +4098,8 @@ \rSec2[category.monetary]{The monetary category} +\rSec3[category.monetary.general]{General} + \pnum These templates handle monetary formats. A template parameter indicates whether @@ -4467,6 +4495,8 @@ \rSec3[locale.moneypunct]{Class template \tcode{moneypunct}} +\rSec4[locale.moneypunct.general]{General} + \indexlibraryglobal{moneypunct}% \begin{codeblock} namespace std { @@ -4809,6 +4839,8 @@ \rSec2[category.messages]{The message retrieval category} +\rSec3[category.messages.general]{General} + \pnum Class \tcode{messages} @@ -4816,6 +4848,8 @@ \rSec3[locale.messages]{Class template \tcode{messages}} +\rSec4[locale.messages.general]{General} + \indexlibraryglobal{messages}% \begin{codeblock} namespace std { diff --git a/source/numerics.tex b/source/numerics.tex index fe7131fc69..d0f38e71d8 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -180,6 +180,8 @@ \rSec1[complex.numbers]{Complex numbers} +\rSec2[complex.numbers.general]{General} + \pnum The header \libheader{complex} defines a class template, and numerous functions for representing and manipulating complex numbers. @@ -1655,6 +1657,8 @@ \rSec1[rand]{Random number generation} +\rSec2[rand.general]{General} + \indextext{random number generation|(}% \indextext{distribution|see{random number distribution}}% \indextext{engine|see{random number engine}}% @@ -2898,6 +2902,8 @@ \rSec2[rand.eng]{Random number engine class templates}% + +\rSec3[rand.eng.general]{General}% \indextext{random number generation!engines|(} \pnum @@ -9858,6 +9864,8 @@ ISO C 7.12.3, 7.12.4 \rSec2[sf.cmath]{Mathematical special functions}% + +\rSec3[sf.cmath.general]{General}% \indextext{mathematical special functions|(}% \pnum diff --git a/source/overloading.tex b/source/overloading.tex index be977eec0f..37267b30b1 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -413,6 +413,8 @@ \end{example} \rSec1[over.match]{Overload resolution}% + +\rSec2[over.match.general]{General}% \indextext{overloading!resolution|(}% \indextext{resolution|see{overloading, resolution}}% \indextext{ambiguity!overloaded function} @@ -509,6 +511,8 @@ in which overload resolution was performed. \rSec2[over.match.funcs]{Candidate functions and argument lists}% + +\rSec3[over.match.funcs.general]{General}% \indextext{overloading!candidate functions|(}% \indextext{overloading!argument lists|(} @@ -696,6 +700,8 @@ \end{example} \rSec3[over.match.call]{Function call syntax}% + +\rSec4[over.match.call.general]{General}% \indextext{overloading!resolution!function call syntax|(} \pnum @@ -1919,6 +1925,8 @@ the viability of the function (see~\ref{over.ics.ref}). \rSec2[over.match.best]{Best viable function}% + +\rSec3[over.match.best.general]{General}% \indextext{overloading!resolution!best viable function|(} \pnum @@ -2222,6 +2230,8 @@ \end{example} \rSec3[over.best.ics]{Implicit conversion sequences}% + +\rSec4[over.best.ics.general]{General}% \indextext{overloading!resolution!implicit conversions and|(} \indextext{implicit conversion sequence|see{conversion sequence, implicit}} @@ -3364,6 +3374,8 @@ \end{note} \rSec1[over.oper]{Overloaded operators}% + +\rSec2[over.oper.general]{General}% \indextext{overloading!operator|(}% \indextext{overloaded operator|see{overloading, operator}}% \indextext{operator overloading|see{overloading, operator}} @@ -3555,6 +3567,8 @@ \end{note} \rSec2[over.binary]{Binary operators}% + +\rSec3[over.binary.general]{General}% \indextext{binary operator!overloaded}% \indextext{overloading!binary operator} diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 2b56345b55..676b797d4e 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -923,6 +923,8 @@ \indextext{macro!import|)} \rSec1[cpp.replace]{Macro replacement}% + +\rSec2[cpp.replace.general]{General}% \indextext{macro!replacement|(}% \indextext{replacement!macro|see{macro, replacement}}% \indextext{preprocessing directive!macro replacement|see{macro, replacement}} diff --git a/source/ranges.tex b/source/ranges.tex index 3873dba13c..9f1d4dcd4f 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -332,6 +332,8 @@ \rSec1[range.access]{Range access} +\rSec2[range.access.general]{General} + \pnum In addition to being available via inclusion of the \libheader{ranges} header, the customization point objects in \ref{range.access} are @@ -1263,6 +1265,8 @@ \rSec1[range.utility]{Range utilities} +\rSec2[range.utility.general]{General} + \pnum The components in this subclause are general utilities for representing and manipulating ranges. @@ -1291,6 +1295,8 @@ \rSec2[view.interface]{View interface} +\rSec3[view.interface.general]{General} + \pnum The class template \tcode{view_interface} is a helper for defining \tcode{view}-like types that offer a container-like interface. It is @@ -1406,6 +1412,8 @@ \rSec2[range.subrange]{Sub-ranges} +\rSec3[range.subrange.general]{General} + \pnum The \tcode{subrange} class template combines together an iterator and a sentinel into a single object that models the @@ -1821,6 +1829,8 @@ \rSec1[range.factories]{Range factories} +\rSec2[range.factories.general]{General} + \pnum This subclause defines \term{range factories}, which are utilities to create a \libconcept{view}. @@ -2903,6 +2913,8 @@ \rSec1[range.adaptors]{Range adaptors} +\rSec2[range.adaptors.general]{General} + \pnum This subclause defines \term{range adaptors}, which are utilities that transform a \libconcept{range} into a \libconcept{view} with custom behaviors. These @@ -3023,6 +3035,8 @@ \rSec2[range.all]{All view} +\rSec3[range.all.general]{General} + \pnum \indexlibraryglobal{all}% \tcode{views::all} returns a \libconcept{view} that includes all elements of diff --git a/source/regex.tex b/source/regex.tex index fe572842e4..e0436b6cfc 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -505,6 +505,8 @@ \rSec1[re.const]{Namespace \tcode{std::regex_constants}} +\rSec2[re.const.general]{General} + \pnum \indexlibraryglobal{regex_constants}% The namespace \tcode{std::regex_constants} holds @@ -1217,6 +1219,8 @@ \end{floattable} \rSec1[re.regex]{Class template \tcode{basic_regex}} + +\rSec2[re.regex.general]{General} \indexlibraryglobal{basic_regex}% \pnum @@ -1742,6 +1746,8 @@ \end{itemdescr} \rSec1[re.submatch]{Class template \tcode{sub_match}} + +\rSec2[re.submatch.general]{General} \pnum \indexlibraryglobal{sub_match}% Class template \tcode{sub_match} denotes the sequence of characters matched @@ -1994,6 +2000,8 @@ \end{itemdescr} \rSec1[re.results]{Class template \tcode{match_results}} + +\rSec2[re.results.general]{General} \pnum \indexlibraryglobal{match_results}% Class template \tcode{match_results} denotes a collection of character @@ -3060,6 +3068,8 @@ \rSec1[re.iter]{Regular expression iterators} \rSec2[re.regiter]{Class template \tcode{regex_iterator}} + +\rSec3[re.regiter.general]{General} \pnum \indexlibraryglobal{regex_iterator}% \indexlibraryglobal{match_results}% @@ -3298,6 +3308,8 @@ \rSec2[re.tokiter]{Class template \tcode{regex_token_iterator}} +\rSec3[re.tokiter.general]{General} + \pnum \indexlibraryglobal{regex_token_iterator}% The class template \tcode{regex_token_iterator} is an iterator adaptor; that diff --git a/source/statements.tex b/source/statements.tex index 98266a4dfb..6d4f8bb62b 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -217,6 +217,8 @@ \end{note} \rSec1[stmt.select]{Selection statements}% + +\rSec2[stmt.select.general]{General}% \indextext{statement!selection|(} \pnum @@ -428,6 +430,8 @@ \indextext{statement!selection|)} \rSec1[stmt.iter]{Iteration statements}% + +\rSec2[stmt.iter.general]{General}% \indextext{statement!iteration|(} \pnum @@ -694,6 +698,8 @@ \indextext{statement!iteration|)} \rSec1[stmt.jump]{Jump statements}% + +\rSec2[stmt.jump.general]{General}% \indextext{statement!jump} \pnum diff --git a/source/strings.tex b/source/strings.tex index d28ac932e2..ab8f341f04 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -28,6 +28,8 @@ \rSec1[char.traits]{Character traits} +\rSec2[char.traits.general]{General} + \pnum This subclause defines requirements on classes representing \term{character traits}, @@ -241,6 +243,8 @@ \rSec2[char.traits.specializations]{\tcode{char_traits} specializations} +\rSec3[char.traits.specializations.general]{General} + \indexlibraryglobal{char_traits}% \begin{codeblock} namespace std { @@ -507,6 +511,8 @@ \rSec1[string.classes]{String classes} +\rSec2[string.classes.general]{General} + \pnum The header \tcode{} defines the \tcode{basic_string} class template for manipulating @@ -734,6 +740,8 @@ \rSec2[basic.string]{Class template \tcode{basic_string}} +\rSec3[basic.string.general]{General} + \pnum \indexlibraryglobal{basic_string}% The @@ -3930,6 +3938,8 @@ \rSec1[string.view]{String view classes} +\rSec2[string.view.general]{General} + \pnum The class template \tcode{basic_string_view} describes an object that can refer to a constant contiguous sequence of char-like\iref{strings.general} objects with the first element of the sequence at position zero. In the rest of this subclause, the type of the char-like objects held in a \tcode{basic_string_view} object is designated by \tcode{charT}. @@ -4006,6 +4016,8 @@ \rSec2[string.view.template]{Class template \tcode{basic_string_view}} +\rSec3[string.view.template.general]{General} + \indexlibraryglobal{basic_string_view}% \indexlibrarymember{traits_type}{basic_string_view}% \indexlibrarymember{value_type}{basic_string_view}% diff --git a/source/support.tex b/source/support.tex index d331b4b066..92db855859 100644 --- a/source/support.tex +++ b/source/support.tex @@ -814,6 +814,8 @@ \rSec2[numeric.limits]{Class template \tcode{numeric_limits}} +\rSec3[numeric.limits.general]{General} + \pnum The \indexlibraryglobal{numeric_limits}% @@ -1991,6 +1993,8 @@ \rSec1[support.dynamic]{Dynamic memory management} +\rSec2[support.dynamic.general]{General} + \pnum The header \libheaderdef{new} defines several functions that manage the allocation of dynamic storage in a program. @@ -2066,6 +2070,8 @@ \rSec2[new.delete]{Storage allocation and deallocation} +\rSec3[new.delete.general]{General} + \pnum Except where otherwise specified, the provisions of~\ref{basic.stc.dynamic} apply to the library versions of \tcode{operator new} and \tcode{operator @@ -2948,6 +2954,8 @@ \rSec1[support.rtti]{Type identification} +\rSec2[support.rtti.general]{General} + \pnum The header \libheaderdef{typeinfo} defines a type associated with type information generated by the implementation. @@ -3150,6 +3158,8 @@ \rSec2[support.srcloc.class]{Class \tcode{source_location}} +\rSec3[support.srcloc.class.general]{General} + \indexlibraryglobal{source_location}% \begin{codeblock} namespace std { @@ -3357,6 +3367,8 @@ \rSec1[support.exception]{Exception handling} +\rSec2[support.exception.general]{General} + \pnum The header \libheaderdef{exception} defines several types and functions related to the handling of exceptions in a \Cpp{} program. @@ -3851,6 +3863,8 @@ \rSec1[support.initlist]{Initializer lists} +\rSec2[support.initlist.general]{General} + \pnum The header \libheaderdef{initializer_list} defines a class template and several support functions related to list-initialization~(see \ref{dcl.init.list}). @@ -4868,6 +4882,8 @@ \rSec1[support.coroutine]{Coroutines} +\rSec2[support.coroutine.general]{General} + \pnum The header \libheaderdef{coroutine} defines several types providing @@ -4914,6 +4930,8 @@ \rSec2[coroutine.traits]{Coroutine traits} +\rSec3[coroutine.traits.general]{General} + \pnum This subclause defines requirements on classes representing \term{coroutine traits}, @@ -4944,6 +4962,8 @@ \rSec2[coroutine.handle]{Class template \tcode{coroutine_handle}} +\rSec3[coroutine.handle.general]{General} + \indexlibraryglobal{coroutine_handle}% \begin{codeblock} namespace std { @@ -5388,6 +5408,8 @@ \rSec1[support.runtime]{Other runtime support} +\rSec2[support.runtime.general]{General} + \pnum \indexlibraryglobal{getenv}% \indexlibraryglobal{system}% diff --git a/source/templates.tex b/source/templates.tex index 390cdbf46e..1fa2c646dc 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -959,6 +959,8 @@ \rSec1[temp.arg]{Template arguments} +\rSec2[temp.arg.general]{General} + \pnum \indextext{argument!template}% There are three forms of @@ -1462,6 +1464,8 @@ \rSec1[temp.constr]{Template constraints} +\rSec2[temp.constr.general]{General} + \pnum \begin{note} This subclause defines the meaning of constraints on template arguments. @@ -1473,6 +1477,8 @@ \rSec2[temp.constr.constr]{Constraints} +\rSec3[temp.constr.constr.general]{General} + \indextext{satisfy|see{constraint, satisfaction}}% \pnum @@ -2156,6 +2162,8 @@ \rSec1[temp.decls]{Template declarations} +\rSec2[temp.decls.general]{General} + \pnum A \grammarterm{template-id}, @@ -2210,6 +2218,8 @@ \rSec2[temp.class]{Class templates} +\rSec3[temp.class.general]{General} + \pnum A \defnx{class template}{template!class} @@ -3178,6 +3188,8 @@ \rSec2[temp.class.spec]{Class template partial specializations} +\rSec3[temp.class.spec.general]{General} + \pnum \indextext{specialization!class template partial}% \indextext{primary class template|see{template, primary}}% @@ -3614,6 +3626,8 @@ \rSec2[temp.fct]{Function templates} +\rSec3[temp.fct.general]{General} + \pnum A function template defines an unbounded set of related functions. \begin{example} @@ -4289,6 +4303,8 @@ \rSec1[temp.res]{Name resolution} +\rSec2[temp.res.general]{General} + \pnum \indextext{overloading!resolution!template name}% \indextext{lookup!template name}% @@ -4884,6 +4900,8 @@ \rSec2[temp.dep]{Dependent names} +\rSec3[temp.dep.general]{General} + \pnum \indextext{dependent name|see{name, dependent}}% Inside a template, some constructs have semantics which may differ from one @@ -5942,6 +5960,8 @@ \rSec1[temp.spec]{Template instantiation and specialization} +\rSec2[temp.spec.general]{General} + \pnum \indextext{specialization!template}% The act of instantiating a function, a variable, @@ -7248,6 +7268,8 @@ \rSec1[temp.fct.spec]{Function template specializations} +\rSec2[temp.fct.spec.general]{General} + \pnum \indextext{template!function}% A function instantiated from a function template is called a function template @@ -7461,6 +7483,8 @@ \rSec2[temp.deduct]{Template argument deduction} +\rSec3[temp.deduct.general]{General} + \pnum When a function template diff --git a/source/threads.tex b/source/threads.tex index 04fd7a45c5..4a350024cc 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -376,6 +376,8 @@ \rSec2[stoptoken]{Class \tcode{stop_token}}% \indexlibraryglobal{stop_token}% +\rSec3[stoptoken.general]{General} + \pnum \indexlibraryglobal{stop_token}% The class \tcode{stop_token} provides an interface for querying whether @@ -570,6 +572,8 @@ \rSec2[stopsource]{Class \tcode{stop_source}}% \indexlibraryglobal{stop_source}% +\rSec3[stopsource.general]{General} + \pnum \indexlibraryglobal{stop_source}% The class \tcode{stop_source} implements the semantics of making a stop request. @@ -839,6 +843,8 @@ \rSec2[stopcallback]{Class template \tcode{stop_callback}}% \indexlibraryglobal{stop_callback}% +\rSec3[stopcallback.general]{General} + \pnum \indexlibraryglobal{stop_callback}% \begin{codeblock} @@ -955,6 +961,8 @@ \rSec1[thread.threads]{Threads} +\rSec2[thread.threads.general]{General} + \pnum \ref{thread.threads} describes components that can be used to create and manage threads. \begin{note} @@ -989,6 +997,8 @@ \rSec2[thread.thread.class]{Class \tcode{thread}} +\rSec3[thread.thread.class.general]{General} + \pnum The class \tcode{thread} provides a mechanism to create a new thread of execution, to join with a thread (i.e., wait for a thread to complete), and to perform other operations that manage and @@ -1432,6 +1442,8 @@ \rSec2[thread.jthread.class]{Class \tcode{jthread}} +\rSec3[thread.jthread.class.general]{General} + \pnum The class \tcode{jthread} provides a mechanism to create a new thread of execution. @@ -1901,6 +1913,8 @@ \rSec1[thread.mutex]{Mutual exclusion} +\rSec2[thread.mutex.general]{General} + \pnum This subclause provides mechanisms for mutual exclusion: mutexes, locks, and call once. These mechanisms ease the production of race-free @@ -1968,6 +1982,8 @@ \rSec3[thread.mutex.requirements.mutex]{Mutex types} +\rSec4[thread.mutex.requirements.mutex.general]{General} + \pnum The \defn{mutex types} are the standard library types \tcode{mutex}, \tcode{recursive_mutex}, \tcode{timed_mutex}, \tcode{recursive_timed_mutex}, @@ -2240,6 +2256,8 @@ \rSec3[thread.timedmutex.requirements]{Timed mutex types} +\rSec4[thread.timedmutex.requirements.general]{General} + \pnum The \defn{timed mutex types} are the standard library types \tcode{timed_mutex}, \tcode{recursive_timed_mutex}, and \tcode{shared_timed_mutex}. They @@ -2455,6 +2473,8 @@ \rSec3[thread.sharedmutex.requirements]{Shared mutex types} +\rSec4[thread.sharedmutex.requirements.general]{General} + \pnum The standard library types \tcode{shared_mutex} and \tcode{shared_timed_mutex} are \defn{shared mutex types}. Shared mutex types meet the requirements of @@ -2625,6 +2645,8 @@ \rSec3[thread.sharedtimedmutex.requirements]{Shared timed mutex types} +\rSec4[thread.sharedtimedmutex.requirements.general]{General} + \pnum The standard library type \tcode{shared_timed_mutex} is a \defn{shared timed mutex type}. Shared timed mutex types meet the requirements of @@ -2778,6 +2800,8 @@ \rSec2[thread.lock]{Locks} +\rSec3[thread.lock.general]{General} + \pnum A \term{lock} is an object that holds a reference to a lockable object and may unlock the lockable object during the lock's destruction (such as when leaving block scope). An execution @@ -2981,6 +3005,8 @@ \rSec3[thread.lock.unique]{Class template \tcode{unique_lock}} +\rSec4[thread.lock.unique.general]{General} + \indexlibraryglobal{unique_lock}% \begin{codeblock} namespace std { @@ -3482,6 +3508,8 @@ \rSec3[thread.lock.shared]{Class template \tcode{shared_lock}} +\rSec4[thread.lock.shared.general]{General} + \indexlibraryglobal{shared_lock}% \begin{codeblock} namespace std { @@ -4129,6 +4157,8 @@ \rSec1[thread.condition]{Condition variables} +\rSec2[thread.condition.general]{General} + \pnum Condition variables provide synchronization primitives used to block a thread until notified by some other thread that some condition is met or until a system time is @@ -4650,6 +4680,8 @@ \rSec2[thread.condition.condvarany]{Class \tcode{condition_variable_any}} +\rSec3[thread.condition.condvarany.general]{General} + \pnum A \tcode{Lock} type shall meet the \oldconcept{BasicLockable} requirements\iref{thread.req.lockable.basic}. @@ -5078,6 +5110,8 @@ \rSec1[thread.sema]{Semaphore} +\rSec2[thread.sema.general]{General} + \pnum Semaphores are lightweight synchronization primitives used to constrain concurrent access to a shared resource. @@ -5308,6 +5342,8 @@ \rSec1[thread.coord]{Coordination types} +\rSec2[thread.coord.general]{General} + \pnum This subclause describes various concepts related to thread coordination, and defines the coordination types \tcode{latch} and \tcode{barrier}. @@ -5315,6 +5351,8 @@ \rSec2[thread.latch]{Latches} +\rSec3[thread.latch.general]{General} + \pnum A latch is a thread coordination mechanism that allows any number of threads to block @@ -5481,6 +5519,8 @@ \rSec2[thread.barrier]{Barriers} +\rSec3[thread.barrier.general]{General} + \pnum A barrier is a thread coordination mechanism whose lifetime consists of a sequence of barrier phases, @@ -7205,6 +7245,8 @@ \rSec2[futures.task]{Class template \tcode{packaged_task}} +\rSec3[futures.task.general]{General} + \pnum The class template \tcode{packaged_task} defines a type for wrapping a function or callable object so that the return value of the function or callable object is stored in diff --git a/source/time.tex b/source/time.tex index 1c1193197a..22fed11ae1 100644 --- a/source/time.tex +++ b/source/time.tex @@ -1193,6 +1193,8 @@ \rSec1[time.duration]{Class template \tcode{duration}} +\rSec2[time.duration.general]{General} + \pnum A \tcode{duration} type measures time between two points in time (\tcode{time_point}s). A \tcode{duration} has a representation which holds a count of ticks and a tick period. @@ -2169,6 +2171,8 @@ \rSec1[time.point]{Class template \tcode{time_point}} +\rSec2[time.point.general]{General} + \indexlibraryglobal{time_point}% \begin{codeblock} namespace std::chrono { @@ -2591,6 +2595,8 @@ \rSec1[time.clock]{Clocks} +\rSec2[time.clock.general]{General} + \pnum The types defined in this subclause meet the \oldconcept{TrivialClock} diff --git a/source/utilities.tex b/source/utilities.tex index 4dce607a2d..9e896515c4 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -2434,6 +2434,8 @@ \rSec2[optional.optional]{Class template \tcode{optional}} +\rSec3[optional.optional.general]{General} + \indexlibraryglobal{optional}% \indexlibrarymember{value_type}{optional}% \begin{codeblock} @@ -4010,6 +4012,8 @@ \rSec2[variant.variant]{Class template \tcode{variant}}% \indexlibraryglobal{variant}% +\rSec3[variant.variant.general]{General} + \begin{codeblock} namespace std { template @@ -5263,6 +5267,8 @@ \rSec1[any]{Storage for any type} +\rSec2[any.general]{General} + \pnum This subclause describes components that \Cpp{} programs may use to perform operations on objects of a discriminated type. @@ -5334,6 +5340,8 @@ \rSec2[any.class]{Class \tcode{any}} +\rSec3[any.class.general]{General} + \begin{codeblock} namespace std { class any { @@ -5920,6 +5928,8 @@ \end{codeblock} \rSec2[template.bitset]{Class template \tcode{bitset}}% + +\rSec3[template.bitset.general]{General}% \indexlibraryglobal{bitset}% \begin{codeblock} namespace std { @@ -7215,6 +7225,8 @@ \rSec2[pointer.traits]{Pointer traits} +\rSec3[pointer.traits.general]{General} + \pnum The class template \tcode{pointer_traits} supplies a uniform interface to certain attributes of pointer-like types. @@ -7892,6 +7904,8 @@ \rSec2[allocator.traits]{Allocator traits} +\rSec3[allocator.traits.general]{General} + \pnum The class template \tcode{allocator_traits} supplies a uniform interface to all allocator types. @@ -8183,6 +8197,8 @@ \rSec2[default.allocator]{The default allocator} +\rSec3[default.allocator.general]{General} + \pnum All specializations of the default allocator meet the allocator completeness requirements\iref{allocator.requirements.completeness}. @@ -8393,6 +8409,8 @@ \rSec2[unique.ptr]{Class template \tcode{unique_ptr}} +\rSec3[unique.ptr.general]{General} + \pnum A \defn{unique pointer} is an object that owns another object and manages that other object through a pointer. More precisely, a unique pointer @@ -8533,6 +8551,8 @@ \rSec3[unique.ptr.single]{\tcode{unique_ptr} for single objects} +\rSec4[unique.ptr.single.general]{General} + \indexlibraryglobal{unique_ptr}% \begin{codeblock} namespace std { @@ -9070,6 +9090,8 @@ \rSec3[unique.ptr.runtime]{\tcode{unique_ptr} for array objects with a runtime length} +\rSec4[unique.ptr.runtime.general]{General} + \indexlibraryglobal{unique_ptr}% \begin{codeblock} namespace std { @@ -9649,6 +9671,8 @@ \rSec2[util.smartptr.shared]{Class template \tcode{shared_ptr}} +\rSec3[util.smartptr.shared.general]{General} + \pnum \indexlibraryglobal{shared_ptr}% The \tcode{shared_ptr} class template stores a pointer, usually obtained @@ -10955,6 +10979,8 @@ \rSec2[util.smartptr.weak]{Class template \tcode{weak_ptr}} +\rSec3[util.smartptr.weak.general]{General} + \pnum \indexlibraryglobal{weak_ptr}% The \tcode{weak_ptr} class template stores a weak reference to an object @@ -11451,6 +11477,8 @@ \rSec2[mem.res.class]{Class \tcode{memory_resource}} +\rSec3[mem.res.class.general]{General} + \pnum The \tcode{memory_resource} class is an abstract interface to an unbounded set of classes encapsulating memory resources. @@ -11608,6 +11636,8 @@ \rSec2[mem.poly.allocator.class]{Class template \tcode{polymorphic_allocator}} +\rSec3[mem.poly.allocator.class.general]{General} + \pnum A specialization of class template \tcode{pmr::polymorphic_allocator} meets the \oldconcept{Allocator} requirements (\tref{cpp17.allocator}). @@ -12340,6 +12370,8 @@ \rSec2[mem.res.monotonic.buffer]{Class \tcode{monotonic_buffer_resource}} +\rSec3[mem.res.monotonic.buffer.general]{General} + \pnum A \tcode{monotonic_buffer_resource} is a special-purpose memory resource intended for very fast memory allocations in situations @@ -13007,6 +13039,8 @@ \rSec1[function.objects]{Function objects} +\rSec2[function.objects.general]{General} + \pnum A \defnx{function object type}{function object!type} is an object type\iref{basic.types} that can be the type of the @@ -13350,6 +13384,8 @@ \rSec2[refwrap]{Class template \tcode{reference_wrapper}} +\rSec3[refwrap.general]{General} + \indexlibraryglobal{reference_wrapper}% \indextext{function object!\idxcode{reference_wrapper}}% \begin{codeblock} @@ -13548,6 +13584,8 @@ \rSec2[arithmetic.operations]{Arithmetic operations} +\rSec3[arithmetic.operations.general]{General} + \pnum The library provides basic function object classes for all of the arithmetic operators in the language~(\ref{expr.mul}, \ref{expr.add}). @@ -13807,6 +13845,8 @@ \rSec2[comparisons]{Comparisons} +\rSec3[comparisons.general]{General} + \pnum The library provides basic function object classes for all of the comparison operators in the language~(\ref{expr.rel}, \ref{expr.eq}). @@ -14299,6 +14339,8 @@ \rSec2[logical.operations]{Logical operations} +\rSec3[logical.operations.general]{General} + \pnum The library provides basic function object classes for all of the logical operators in the language~(\ref{expr.log.and}, \ref{expr.log.or}, \ref{expr.unary.op}). @@ -14432,6 +14474,8 @@ \rSec2[bitwise.operations]{Bitwise operations} +\rSec3[bitwise.operations.general]{General} + \pnum The library provides basic function object classes for all of the bitwise operators in the language~(\ref{expr.bit.and}, \ref{expr.or}, @@ -14723,6 +14767,8 @@ \end{itemdescr} \rSec2[func.bind]{Function object binders}% + +\rSec3[func.bind.general]{General}% \indextext{function object!binders|(} \pnum @@ -14952,6 +14998,8 @@ \indextext{function object!\idxcode{mem_fn}|)} \rSec2[func.wrap]{Polymorphic function wrappers}% + +\rSec3[func.wrap.general]{General}% \indextext{function object!wrapper|(} \pnum @@ -14989,6 +15037,8 @@ \end{itemdescr} \rSec3[func.wrap.func]{Class template \tcode{function}} + +\rSec4[func.wrap.func.general]{General} \indexlibraryglobal{function}% \indexlibrarymember{result_type}{function}% @@ -15416,6 +15466,8 @@ \rSec2[func.search]{Searchers} +\rSec3[func.search.general]{General} + \pnum This subclause provides function object types\iref{function.objects} for operations that search for a sequence \range{pat\textunderscore\nobreak first}{pat_last} in another @@ -15767,6 +15819,8 @@ \rSec1[meta]{Metaprogramming and type traits} +\rSec2[meta.general]{General} + \pnum This subclause describes components used by \Cpp{} programs, particularly in templates, to support the widest possible range of types, optimise @@ -16302,6 +16356,8 @@ \rSec2[meta.unary]{Unary type traits} +\rSec3[meta.unary.general]{General} + \pnum This subclause contains templates that may be used to query the properties of a type at compile time. @@ -17208,6 +17264,8 @@ \end{note} \rSec2[meta.trans]{Transformations between types} + +\rSec3[meta.trans.general]{General} \pnum This subclause contains templates that may be used to transform one type to another following some predefined rule. diff --git a/tools/fix-hanging.pl b/tools/fix-hanging.pl new file mode 100644 index 0000000000..aa093deceb --- /dev/null +++ b/tools/fix-hanging.pl @@ -0,0 +1,24 @@ +$d = 0; $h = 0; +$buff = ""; +while (<>) { + if ($_ =~ /\rSec(\d)/) { + $newd = $1; + if ($newd > $d && $h) { + # found hanging paras + print " +"; + print $sec =~ s/(\d)/$1+1/er =~ s/]/.general]/r =~ s/{.*}/{General}/r; + } + print $buff; + print $_; + $buff = ""; + $d = $newd; $h = 0; $sec = $_; + } else { + $buff .= $_; + if ($_ =~ /\pnum/) { + $h = 1; + } + } +} +print $buff + From 199cf326faa994717f3b9d6726d70102f724dd98 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 9 Sep 2020 21:23:34 +0200 Subject: [PATCH 074/250] [check] Detect hanging paragraphs. A "hanging paragraph" per the ISO Directives, Part 2, is a subclause that directly contains text as well as subordinate subclauses. Those are not allowed. --- tools/check.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/check.sh b/tools/check.sh index 0a75efeb22..063df666c5 100755 --- a/tools/check.sh +++ b/tools/check.sh @@ -90,6 +90,14 @@ for f in $texfiles; do sed 's/$/ <--- "shall" inside a note/' done | grep . && exit 1 +# Hanging paragraphs +for f in $texfiles; do + sed -n '/^\\rSec/{=;p};/^[^\\]/{s/^.*$/x/;=;p}' $f | + # prefix output with filename and line + sed '/^[0-9]\+$/{N;s/\n/:/}' | sed "s/.*/$f:&/" | + awk -F: 'BEGIN { prevlevel = 0 } $3 ~ /^\\rSec./ { match($3, "[0-9]"); level=substr($3, RSTART, 1); if (text && level > prevlevel) { print prevsec " <-- Hanging paragraph follows" } prevlevel = level; prevsec = $3; text = 0 } $3 == "x" { text = 1 }' +done | grep . && exit 1 + # Library descriptive macros not immediately preceded by \pnum. for f in $texlibdesc; do sed -n '/^\\pnum/{h;:x;n;/^\\index/b x;/^\\\(constraints\|mandates\|expects\|effects\|sync\|ensures\|returns\|throws\|complexity\|remarks\|errors\)/{x;/\n/{x;=;p};d};/^\\pnum/D;H;b x}' $f | From 93eec673bad94fa3c48d08ce45701997b9c90a70 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 9 Sep 2020 23:24:40 +0200 Subject: [PATCH 075/250] [check] Ignore LaTeX comments for hanging paragraph detection. --- tools/check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check.sh b/tools/check.sh index 063df666c5..a6d04a9808 100755 --- a/tools/check.sh +++ b/tools/check.sh @@ -92,7 +92,7 @@ done | grep . && exit 1 # Hanging paragraphs for f in $texfiles; do - sed -n '/^\\rSec/{=;p};/^[^\\]/{s/^.*$/x/;=;p}' $f | + sed -n '/^\\rSec/{=;p};/^[^\\%]/{s/^.*$/x/;=;p}' $f | # prefix output with filename and line sed '/^[0-9]\+$/{N;s/\n/:/}' | sed "s/.*/$f:&/" | awk -F: 'BEGIN { prevlevel = 0 } $3 ~ /^\\rSec./ { match($3, "[0-9]"); level=substr($3, RSTART, 1); if (text && level > prevlevel) { print prevsec " <-- Hanging paragraph follows" } prevlevel = level; prevsec = $3; text = 0 } $3 == "x" { text = 1 }' From 039e1ee27f60f8227353ba69a1b574be2750299d Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 9 Sep 2020 14:56:24 -0700 Subject: [PATCH 076/250] Replace "this subclause" with an explicit reference in all formerly-hanging paragraphs. These typically mean the parent subclause now. Mechanically: "this subclause" became "\ref{parent}". "This subclause" became "Subclause \ref{parent}", because it doesn't look great to start a sentennce with a subclause number. ... with some manual fixups for cases where that didn't work out well. --- source/algorithms.tex | 12 ++++++------ source/atomics.tex | 2 +- source/compatibility.tex | 12 ++++++------ source/declarations.tex | 8 ++++---- source/diagnostics.tex | 4 ++-- source/iterators.tex | 4 ++-- source/lib-intro.tex | 10 +++++----- source/locales.tex | 4 ++-- source/numerics.tex | 24 ++++++++++++------------ source/overloading.tex | 6 +++--- source/ranges.tex | 8 ++++---- source/regex.tex | 2 +- source/strings.tex | 10 +++++----- source/support.tex | 4 ++-- source/templates.tex | 4 ++-- source/threads.tex | 10 +++++----- source/time.tex | 2 +- source/utilities.tex | 32 ++++++++++++++++---------------- 18 files changed, 79 insertions(+), 79 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index b31b41ab86..45c63a0cda 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -6573,7 +6573,7 @@ \rSec3[alg.binary.search.general]{General} \pnum -All of the algorithms in this subclause are versions of binary search and +All of the algorithms in \ref{alg.binary.search} are versions of binary search and assume that the sequence being searched is partitioned with respect to an expression formed by binding the search key to an argument of the comparison function. @@ -7280,7 +7280,7 @@ \rSec3[alg.set.operations.general]{General} \pnum -This subclause defines all the basic set operations on sorted structures. +Subclause \ref{alg.set.operations} defines all the basic set operations on sorted structures. They also work with \tcode{multiset}s\iref{multiset} containing multiple copies of equivalent elements. The semantics of the set operations are generalized to \tcode{multiset}s @@ -9009,7 +9009,7 @@ \pnum \begin{note} The use of closed ranges as well as semi-open ranges -to specify requirements throughout this subclause is intentional. +to specify requirements throughout \ref{numeric.ops} is intentional. \end{note} \rSec2[numerics.defns]{Definitions} @@ -10107,7 +10107,7 @@ \rSec2[specialized.algorithms.general]{General} \pnum -The contents specified in this subclause~\ref{specialized.algorithms} +The contents specified in \ref{specialized.algorithms} are declared in the header \libheaderref{memory}. \pnum @@ -10121,12 +10121,12 @@ \begin{note} When invoked on ranges of potentially-overlapping subobjects\iref{intro.object}, -the algorithms specified in this subclause \ref{specialized.algorithms} +the algorithms specified in \ref{specialized.algorithms} result in undefined behavior. \end{note} \pnum -Some algorithms specified in this clause make use of the exposition-only function +Some algorithms specified in \ref{specialized.algorithms} make use of the exposition-only function \tcode{\placeholdernc{voidify}}: \begin{codeblock} template diff --git a/source/atomics.tex b/source/atomics.tex index ee8985e264..767026e687 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -2730,7 +2730,7 @@ may be an incomplete type. \pnum -All changes to an atomic smart pointer in this subclause, and +All changes to an atomic smart pointer in \ref{util.smartptr.atomic}, and all associated \tcode{use_count} increments, are guaranteed to be performed atomically. Associated \tcode{use_count} decrements diff --git a/source/compatibility.tex b/source/compatibility.tex index 32e4d8e8ab..ceb65fcd6b 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -7,7 +7,7 @@ \pnum \indextext{summary!compatibility with ISO \CppXVII{}}% -This subclause lists the differences between \Cpp{} and +Subclause \ref{diff.cpp17} lists the differences between \Cpp{} and ISO \CppXVII{} (ISO/IEC 14882:2017, \doccite{Programming Languages --- \Cpp{}}), by the chapters of this document. @@ -708,7 +708,7 @@ \pnum \indextext{summary!compatibility with ISO \CppXIV{}}% -This subclause lists the differences between \Cpp{} and +Subclause \ref{diff.cpp14} lists the differences between \Cpp{} and ISO \CppXIV{} (ISO/IEC 14882:2014, \doccite{Programming Languages --- \Cpp{}}), in addition to those listed above, by the chapters of this document. @@ -1067,7 +1067,7 @@ \pnum \indextext{summary!compatibility with ISO \CppXI{}}% -This subclause lists the differences between \Cpp{} and +Subclause \ref{diff.cpp11} lists the differences between \Cpp{} and ISO \CppXI{} (ISO/IEC 14882:2011, \doccite{Programming Languages --- \Cpp{}}), in addition to those listed above, by the chapters of this document. @@ -1223,7 +1223,7 @@ \pnum \indextext{summary!compatibility with ISO \CppIII{}}% -This subclause lists the differences between \Cpp{} and +Subclause \ref{diff.cpp03} lists the differences between \Cpp{} and ISO \CppIII{} (ISO/IEC 14882:2003, \doccite{Programming Languages --- \Cpp{}}), in addition to those listed above, by the chapters of this document. @@ -1765,7 +1765,7 @@ \pnum \indextext{summary!compatibility with ISO C}% -This subclause lists the differences between \Cpp{} and ISO C, +Subclause \ref{diff.iso} lists the differences between \Cpp{} and ISO C, in addition to those listed above, by the chapters of this document. @@ -2645,7 +2645,7 @@ \indextext{library!C standard}% \pnum -This subclause summarizes the explicit changes in headers, +Subclause \ref{diff.library} summarizes the explicit changes in headers, definitions, declarations, or behavior between the C standard library in the C standard and the parts of the \Cpp{} standard library that were included from the C standard library. diff --git a/source/declarations.tex b/source/declarations.tex index f106cc939e..a9c137d8b9 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -1211,7 +1211,7 @@ \ref{class}, and \ref{temp.res}, respectively. The remaining -\grammarterm{type-specifier}{s} are discussed in the rest of this subclause. +\grammarterm{type-specifier}{s} are discussed in the rest of \ref{dcl.type}. \end{note} \rSec3[dcl.type.cv]{The \fakegrammarterm{cv-qualifier}{s}}% @@ -1759,7 +1759,7 @@ \pnum A program that uses a placeholder type in a context not -explicitly allowed in this subclause is ill-formed. +explicitly allowed in \ref{dcl.spec.auto} is ill-formed. \pnum If the \grammarterm{init-declarator-list} contains more than one @@ -4058,7 +4058,7 @@ \indextext{initialization|(} \pnum -The process of initialization described in this subclause applies to +The process of initialization described in \ref{dcl.init} applies to all initializations regardless of syntactic context, including the initialization of a function parameter\iref{expr.call}, the initialization of a return value\iref{stmt.return}, or when an @@ -4118,7 +4118,7 @@ \end{bnf} \begin{note} -The rules in this subclause apply even if the grammar permits only +The rules in \ref{dcl.init} apply even if the grammar permits only the \grammarterm{brace-or-equal-initializer} form of \grammarterm{initializer} in a given context. \end{note} diff --git a/source/diagnostics.tex b/source/diagnostics.tex index fa6af0cd30..0e305c6c45 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -667,12 +667,12 @@ \rSec2[syserr.general]{General} \pnum -This subclause describes components that the standard library and +Subclause \ref{syserr} describes components that the standard library and \Cpp{} programs may use to report error conditions originating from the operating system or other low-level application program interfaces. \pnum -Components described in this subclause shall not change the value of +Components described in \ref{syserr} shall not change the value of \tcode{errno}\iref{errno}. Implementations should leave the error states provided by other libraries unchanged. diff --git a/source/iterators.tex b/source/iterators.tex index 1426e02e76..75a01af7df 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -2818,7 +2818,7 @@ \end{example} \pnum -The function templates defined in this subclause are not found by +The function templates defined in \ref{range.iter.ops} are not found by argument-dependent name lookup\iref{basic.lookup.argdep}. When found by unqualified\iref{basic.lookup.unqual} name lookup for the \grammarterm{postfix-expression} in a function call\iref{expr.call}, they @@ -2843,7 +2843,7 @@ \pnum The number and order of deducible template parameters for the function templates defined -in this subclause is unspecified, except where explicitly stated otherwise. +in \ref{range.iter.ops} is unspecified, except where explicitly stated otherwise. \rSec3[range.iter.op.advance]{\tcode{ranges::advance}} diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 436cb69c18..bd6e78264c 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -442,7 +442,7 @@ \rSec2[description.general]{General} \pnum -This subclause describes the conventions used to specify the \Cpp{} standard +Subclause \ref{description} describes the conventions used to specify the \Cpp{} standard library. \ref{structure} describes the structure of the normative \ref{\firstlibchapter} through \ref{\lastlibchapter} and \ref{depr}. \ref{conventions} describes other editorial conventions. @@ -717,7 +717,7 @@ \indextext{conventions}% \pnum -This subclause describes several editorial conventions used to describe the contents +Subclause \ref{conventions} describes several editorial conventions used to describe the contents of the \Cpp{} standard library. These conventions are for describing implementation-defined types\iref{type.descriptions}, @@ -1111,7 +1111,7 @@ \rSec2[requirements.general]{General} \pnum -This subclause specifies requirements that apply to the entire \Cpp{} standard library. +Subclause \ref{requirements} specifies requirements that apply to the entire \Cpp{} standard library. \ref{\firstlibchapter} through \ref{\lastlibchapter} and \ref{depr} specify the requirements of individual entities within the library. @@ -1120,7 +1120,7 @@ programs having only a single thread of execution. \pnum -Within this subclause, \ref{organization} describes the library's contents and +\ref{organization} describes the library's contents and organization, \ref{using} describes how well-formed \Cpp{} programs gain access to library entities, \ref{utility.requirements} describes constraints on types and functions used with @@ -2578,7 +2578,7 @@ \pnum If a program declares or defines a name in a context where it is -reserved, other than as explicitly allowed by this Clause, its behavior is +reserved, other than as explicitly allowed by \ref{library}, its behavior is undefined.% \indextext{undefined} diff --git a/source/locales.tex b/source/locales.tex index ff7495471a..8aa37c5646 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -1043,8 +1043,8 @@ in case of a parse error. \pnum -Within this clause it is unspecified whether one virtual function calls another -virtual function. +Within subclause \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/numerics.tex b/source/numerics.tex index d0f38e71d8..9d141eb0bf 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -1666,7 +1666,7 @@ \indextext{random number generator|see{uniform random bit generator}} \pnum -This subclause defines a facility +Subclause \ref{rand} defines a facility for generating (pseudo-)random numbers. \pnum @@ -1694,7 +1694,7 @@ \pnum \indextext{\idxcode{result_type}!entity characterization based on}% -Each of the entities specified via this subclause +Each of the entities specified in \ref{rand} has an associated arithmetic type\iref{basic.fundamental} identified as \tcode{result_type}. With \tcode{T} as the \tcode{result_type} @@ -1721,11 +1721,11 @@ \pnum Unless otherwise specified, all descriptions of calculations -in this subclause +in \ref{rand} use mathematical real numbers. \pnum -Throughout this subclause, +Throughout \ref{rand}, the operators \bitand, \bitor, and \xor{} denote the respective conventional bitwise operations. @@ -2908,30 +2908,30 @@ \pnum Each type instantiated -from a class template specified in this subclause~\ref{rand.eng} +from a class template specified in \ref{rand.eng} meets the requirements of a random number engine\iref{rand.req.eng} type. \pnum Except where specified otherwise, the complexity of each function -specified in this subclause~\ref{rand.eng} +specified in \ref{rand.eng} is constant. \pnum Except where specified otherwise, -no function described in this subclause~\ref{rand.eng} +no function described in \ref{rand.eng} throws an exception. \pnum -Every function described in this subclause~\ref{rand.eng} +Every function described in \ref{rand.eng} 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.eng} +Descriptions are provided in \ref{rand.eng} only for engine operations that are not described in \ref{rand.req.eng} or for operations where there is additional semantic information. @@ -2943,7 +2943,7 @@ are not shown in the synopses. \pnum -Each template specified in this subclause~\ref{rand.eng} +Each template specified in \ref{rand.eng} 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 @@ -2952,7 +2952,7 @@ \pnum For every random number engine and for every random number engine adaptor \tcode{X} -defined in this subclause\iref{rand.eng} and in subclause~\ref{rand.adapt}: +defined in \ref{rand.eng} and in \ref{rand.adapt}: \begin{itemize} \item if the constructor @@ -9871,7 +9871,7 @@ \pnum \indextext{NaN}\indextext{domain error}% If any argument value -to any of the functions specified in this subclause +to any of the functions specified in \ref{sf.cmath} is a NaN (Not a Number), the function shall return a NaN but it shall not report a domain error. diff --git a/source/overloading.tex b/source/overloading.tex index 37267b30b1..890767ac1d 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -3466,13 +3466,13 @@ \keyword{operator} \tcode{\keyword{delete}[]}, are described completely in~\ref{basic.stc.dynamic}. The attributes and restrictions -found in the rest of this subclause do not apply to them unless explicitly +found in the rest of \ref{over.oper} do not apply to them unless explicitly stated in~\ref{basic.stc.dynamic}. \pnum The \tcode{co_await} operator is described completely in~\ref{expr.await}. The attributes and restrictions -found in the rest of this subclause do not apply to it unless explicitly +found in the rest of \ref{over.oper} do not apply to it unless explicitly stated in~\ref{expr.await}. \pnum @@ -3519,7 +3519,7 @@ Operator functions cannot have more or fewer parameters than the number required for the corresponding operator, as -described in the rest of this subclause. +described in the rest of \ref{over.oper}. \pnum Operators not mentioned explicitly in subclauses~\ref{over.ass} through~\ref{over.inc} diff --git a/source/ranges.tex b/source/ranges.tex index 9f1d4dcd4f..af0467a06c 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -340,7 +340,7 @@ available when \libheaderrefx{iterator}{iterator.synopsis} is included. \pnum -Within this subclause, +Within \ref{range.access}, the \defnadj{reified}{object} of a subexpression \tcode{E} denotes \begin{itemize} \item @@ -1268,7 +1268,7 @@ \rSec2[range.utility.general]{General} \pnum -The components in this subclause are general utilities for representing and +The components in \ref{range.utility} are general utilities for representing and manipulating ranges. \rSec2[range.utility.helpers]{Helper concepts} @@ -1832,7 +1832,7 @@ \rSec2[range.factories.general]{General} \pnum -This subclause defines \term{range factories}, +Subclause \ref{range.factories} defines \term{range factories}, which are utilities to create a \libconcept{view}. \pnum @@ -2916,7 +2916,7 @@ \rSec2[range.adaptors.general]{General} \pnum -This subclause defines \term{range adaptors}, which are utilities that transform a +Subclause \ref{range.adaptors} defines \term{range adaptors}, which are utilities that transform a \libconcept{range} into a \libconcept{view} with custom behaviors. These adaptors can be chained to create pipelines of range transformations that evaluate lazily as the resulting view is iterated. diff --git a/source/regex.tex b/source/regex.tex index e0436b6cfc..bb325661b0 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -1245,7 +1245,7 @@ \pnum \indexlibraryglobal{regex_error}% -The functions described in this Clause report errors by throwing +The functions described in \ref{re.regex} report errors by throwing exceptions of type \tcode{regex_error}. \indexlibraryglobal{basic_regex}% diff --git a/source/strings.tex b/source/strings.tex index ab8f341f04..13fe5863c7 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -31,7 +31,7 @@ \rSec2[char.traits.general]{General} \pnum -This subclause defines requirements on classes representing +Subclause \ref{char.traits} defines requirements on classes representing \term{character traits}, and defines a class template \tcode{char_traits}, @@ -49,8 +49,8 @@ and \ref{input.output} need a set of related types and functions to complete the definition of their semantics. These types and functions are provided as a set of member \grammarterm{typedef-name}{s} and functions in the template -parameter \tcode{traits} used by each such template. This subclause defines the -semantics of these members. +parameter \tcode{traits} used by each such template. +Subclause \ref{char.traits} defines the semantics of these members. \pnum To specialize those templates to generate a string, string view, or @@ -752,7 +752,7 @@ Such a sequence is also called a ``string'' if the type of the char-like objects that it holds is clear from context. -In the rest of this Clause, +In the rest of \ref{basic.string}, the type of the char-like objects held in a \tcode{basic_string} object is designated by \tcode{charT}. @@ -3942,7 +3942,7 @@ \pnum The class template \tcode{basic_string_view} describes an object that can refer to a constant contiguous sequence of char-like\iref{strings.general} objects with the first element of the sequence at position zero. -In the rest of this subclause, the type of the char-like objects held in a \tcode{basic_string_view} object is designated by \tcode{charT}. +In the rest of \ref{string.view}, the type of the char-like objects held in a \tcode{basic_string_view} object is designated by \tcode{charT}. \pnum \begin{note} diff --git a/source/support.tex b/source/support.tex index 92db855859..cd36ac7f1f 100644 --- a/source/support.tex +++ b/source/support.tex @@ -3869,7 +3869,7 @@ The header \libheaderdef{initializer_list} defines a class template and several support functions related to list-initialization~(see \ref{dcl.init.list}). \indextext{signal-safe!\idxcode{initializer_list} functions}% -All functions specified in this subclause are signal-safe\iref{support.signal}. +All functions specified in \ref{support.initlist} are signal-safe\iref{support.signal}. \rSec2[initializer.list.syn]{Header \tcode{} synopsis} \indexlibraryglobal{initializer_list}% @@ -4933,7 +4933,7 @@ \rSec3[coroutine.traits.general]{General} \pnum -This subclause defines requirements on classes representing +Subclause \ref{coroutine.traits} defines requirements on classes representing \term{coroutine traits}, and defines the class template \tcode{coroutine_traits} diff --git a/source/templates.tex b/source/templates.tex index 1fa2c646dc..1a622a017f 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -1468,7 +1468,7 @@ \pnum \begin{note} -This subclause defines the meaning of constraints on template arguments. +Subclause \ref{temp.constr} defines the meaning of constraints on template arguments. The abstract syntax and satisfaction rules are defined in \ref{temp.constr.constr}. Constraints are associated with declarations in \ref{temp.constr.decl}. @@ -4920,7 +4920,7 @@ \defnx{value-dependent}{expression!value-dependent} (that is, its value when evaluated as a constant expression\iref{expr.const} may depend on a template parameter) -as described in this subclause. +as described below. \pnum In an expression of the form: diff --git a/source/threads.tex b/source/threads.tex index 4a350024cc..c5d0b194f3 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -308,7 +308,7 @@ \rSec2[thread.stoptoken.intro]{Introduction} \pnum -This clause describes components that can be used +Subclause \ref{thread.stoptoken} describes components that can be used to asynchonously request that an operation stops execution in a timely manner, typically because the result is no longer required. Such a request is called a \defn{stop request}. @@ -1916,7 +1916,7 @@ \rSec2[thread.mutex.general]{General} \pnum -This subclause provides mechanisms for mutual exclusion: mutexes, locks, and call +Subclause \ref{thread.mutex} provides mechanisms for mutual exclusion: mutexes, locks, and call once. These mechanisms ease the production of race-free programs\iref{intro.multithread}. @@ -1988,8 +1988,8 @@ The \defn{mutex types} are the standard library types \tcode{mutex}, \tcode{recursive_mutex}, \tcode{timed_mutex}, \tcode{recursive_timed_mutex}, \tcode{shared_mutex}, and \tcode{shared_timed_mutex}. -They meet the requirements set out in this subclause. In this description, \tcode{m} -denotes an object of a mutex type. +They meet the requirements set out in \ref{thread.mutex.requirements.mutex}. +In this description, \tcode{m} denotes an object of a mutex type. \pnum The mutex types meet the \oldconcept{Lockable} requirements\iref{thread.req.lockable.req}. @@ -5345,7 +5345,7 @@ \rSec2[thread.coord.general]{General} \pnum -This subclause describes various concepts related to thread coordination, and +Subclause \ref{thread.coord} describes various concepts related to thread coordination, and defines the coordination types \tcode{latch} and \tcode{barrier}. These types facilitate concurrent computation performed by a number of threads. diff --git a/source/time.tex b/source/time.tex index 22fed11ae1..efe49c8ea9 100644 --- a/source/time.tex +++ b/source/time.tex @@ -2598,7 +2598,7 @@ \rSec2[time.clock.general]{General} \pnum -The types defined in this subclause meet the +The types defined in \ref{time.clock} meet the \oldconcept{TrivialClock} requirements\iref{time.clock.req} unless otherwise specified. diff --git a/source/utilities.tex b/source/utilities.tex index 9e896515c4..7c8715cd3f 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -5270,7 +5270,7 @@ \rSec2[any.general]{General} \pnum -This subclause describes components that \Cpp{} programs may use to perform operations on objects of a discriminated type. +Subclause \ref{any} describes components that \Cpp{} programs may use to perform operations on objects of a discriminated type. \pnum \begin{note} @@ -6035,7 +6035,7 @@ or more bits is the sum of their bit values. \pnum -The functions described in this subclause can report three kinds of +The functions described in \ref{template.bitset} can report three kinds of errors, each associated with a distinct exception: \begin{itemize} \item @@ -8433,7 +8433,7 @@ \pnum Each object of a type \tcode{U} instantiated from the \tcode{unique_ptr} template -specified in this subclause has the strict ownership semantics, specified above, +specified in \ref{unique.ptr} has the strict ownership semantics, specified above, of a unique pointer. In partial satisfaction of these semantics, each such \tcode{U} is \oldconcept{MoveConstructible} and \oldconcept{MoveAssignable}, but is not \oldconcept{CopyConstructible} nor \oldconcept{CopyAssignable}. @@ -14772,7 +14772,7 @@ \indextext{function object!binders|(} \pnum -This subclause describes a uniform mechanism for binding +Subclause \ref{func.bind} describes a uniform mechanism for binding arguments of callable objects. \rSec3[func.bind.isbind]{Class template \tcode{is_bind_expression}} @@ -15003,7 +15003,7 @@ \indextext{function object!wrapper|(} \pnum -This subclause describes a polymorphic wrapper class that +Subclause \ref{func.wrap} describes a polymorphic wrapper class that encapsulates arbitrary callable objects. \rSec3[func.wrap.badcall]{Class \tcode{bad_function_call}}% @@ -15469,7 +15469,7 @@ \rSec3[func.search.general]{General} \pnum -This subclause provides function object types\iref{function.objects} for +Subclause \ref{func.search} provides function object types\iref{function.objects} for operations that search for a sequence \range{pat\textunderscore\nobreak first}{pat_last} in another sequence \range{first}{last} that is provided to the object's function call operator. The first sequence (the pattern to be searched for) is provided to @@ -15477,7 +15477,7 @@ provided to the function call operator. \pnum -Each specialization of a class template specified in this subclause \ref{func.search} +Each specialization of a class template specified in \ref{func.search} shall meet the \oldconcept{CopyConst\-ruct\-ible} and \oldconcept{CopyAssignable} requirements. Template parameters named \begin{itemize} @@ -15489,7 +15489,7 @@ \item \tcode{RandomAccessIterator2}, and \item \tcode{BinaryPredicate} \end{itemize} -of templates specified in this subclause +of templates specified in \ref{func.search} shall meet the same requirements and semantics as specified in \ref{algorithms.general}. Template parameters named \tcode{Hash} shall meet the \oldconcept{Hash} @@ -15822,7 +15822,7 @@ \rSec2[meta.general]{General} \pnum -This subclause describes components used by \Cpp{} programs, particularly in +Subclause \ref{meta} describes components used by \Cpp{} programs, particularly in templates, to support the widest possible range of types, optimise template code usage, detect type related user errors, and perform type inference and transformation at compile time. It includes type @@ -15835,7 +15835,7 @@ \pnum \indextext{signal-safe!type traits}% -All functions specified in this subclause are signal-safe\iref{support.signal}. +All functions specified in \ref{meta} are signal-safe\iref{support.signal}. \rSec2[meta.rqmts]{Requirements} @@ -15881,16 +15881,16 @@ \pnum Unless otherwise specified, the behavior of a program that adds specializations -for any of the templates specified in this subclause~\ref{meta} +for any of the templates specified in \ref{meta} is undefined. \pnum Unless otherwise specified, an incomplete type may be used -to instantiate a template specified in this subclause. +to instantiate a template specified in \ref{meta}. The behavior of a program is undefined if: \begin{itemize} \item - an instantiation of a template specified in subclause~\ref{meta} + an instantiation of a template specified in \ref{meta} directly or indirectly depends on an incompletely-defined object type \tcode{T}, and \item @@ -16359,7 +16359,7 @@ \rSec3[meta.unary.general]{General} \pnum -This subclause contains templates that may be used to query the +Subclause \ref{meta.unary} contains templates that may be used to query the properties of a type at compile time. \pnum @@ -17267,11 +17267,11 @@ \rSec3[meta.trans.general]{General} \pnum -This subclause contains templates that may be used to transform one +Subclause \ref{meta.trans} contains templates that may be used to transform one type to another following some predefined rule. \pnum -Each of the templates in this subclause shall be a +Each of the templates in \ref{meta.trans} shall be a \oldconcept{TransformationTrait}\iref{meta.rqmts}. \rSec3[meta.trans.cv]{Const-volatile modifications} From 4762f1622e02565ae44364338d3e5d96e0371d3e Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 00:27:20 +0200 Subject: [PATCH 077/250] [check] Consider only text with \pnum as a hanging paragraph. --- tools/check.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/check.sh b/tools/check.sh index a6d04a9808..a6de4595d0 100755 --- a/tools/check.sh +++ b/tools/check.sh @@ -92,7 +92,7 @@ done | grep . && exit 1 # Hanging paragraphs for f in $texfiles; do - sed -n '/^\\rSec/{=;p};/^[^\\%]/{s/^.*$/x/;=;p}' $f | + sed -n '/^\\rSec/{=;p};/^\\pnum/{s/^.*$/x/;=;p}' $f | # prefix output with filename and line sed '/^[0-9]\+$/{N;s/\n/:/}' | sed "s/.*/$f:&/" | awk -F: 'BEGIN { prevlevel = 0 } $3 ~ /^\\rSec./ { match($3, "[0-9]"); level=substr($3, RSTART, 1); if (text && level > prevlevel) { print prevsec " <-- Hanging paragraph follows" } prevlevel = level; prevsec = $3; text = 0 } $3 == "x" { text = 1 }' From 79f6527160dd1c94c760f4bfa85a4811b848fd39 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 00:19:45 +0200 Subject: [PATCH 078/250] [intro.ack] Dissolve subclause. Integrate trademark acknowledgements into [intro.refs]. Add base works to the bibliography. Remove introductory sentence from the bibliography. Partially addresses ISO/CS 016 (C++20 DIS) --- source/back.tex | 14 +++++++++++-- source/intro.tex | 50 ++++++++++++++------------------------------ source/xrefdelta.tex | 3 +++ 3 files changed, 31 insertions(+), 36 deletions(-) diff --git a/source/back.tex b/source/back.tex index 8f5e31e82b..c474d117b2 100644 --- a/source/back.tex +++ b/source/back.tex @@ -2,10 +2,20 @@ \chapter{Bibliography} -The following documents are cited informatively in this document. - \begin{itemize} \renewcommand{\labelitemi}{---} +\item + Bjarne Stroustrup, + \doccite{The \Cpp{} Programming Language, second edition}, Chapter R. + Addison-Wesley Publishing Company, ISBN 0-201-53992-6, copyright \copyright 1991 AT\&T +\item + Brian W. Kernighan and Dennis M. Ritchie, + \doccite{The C Programming Language}, Appendix A. + Prentice-Hall, 1978, ISBN 0-13-110163-3, copyright \copyright 1978 AT\&T +\item + P.J. Plauger, + \doccite{The Draft Standard \Cpp{} Library}. + Prentice-Hall, ISBN 0-13-117003-1, copyright \copyright 1995 P.J. Plauger) \item IANA Time Zone Database, available at \url{https://www.iana.org/time-zones} diff --git a/source/intro.tex b/source/intro.tex index 6bceaa6ded..bf164563d0 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -33,7 +33,12 @@ For undated references, the latest edition of the referenced document (including any amendments) applies. \begin{itemize} -\item Ecma International, \doccite{ECMAScript Language Specification}, +\item Ecma International, \doccite{ECMAScript% +\footnote{ECMAScript\textregistered\ is a registered trademark of Ecma +International. +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.} +Language Specification}, Standard Ecma-262, third edition, 1999. \item ISO/IEC 2382 (all parts), \doccite{Information technology --- Vocabulary} @@ -41,7 +46,11 @@ Information interchange --- Representation of dates and times} \item ISO/IEC 9899:2018, \doccite{Programming languages --- C} \item ISO/IEC 9945:2003, \doccite{Information Technology --- Portable -Operating System Interface (POSIX)} +Operating System Interface (POSIX% +\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.})} \item ISO/IEC 10646, \doccite{Information technology --- Universal Coded Character Set (UCS)} \item ISO/IEC 10646-1:1993, \doccite{Information technology --- @@ -54,7 +63,11 @@ to be used in the natural sciences and technology} %%% Format for the following entry is based on that specified at %%% http://www.iec.ch/standardsdev/resources/draftingpublications/directives/principles/referencing.htm -\item The Unicode Consortium. Unicode Standard Annex, UAX \#29, \doccite{Unicode Text Segmentation} [online]. +\item The Unicode Consortium. Unicode% +\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.} +Standard Annex, UAX \#29, \doccite{Unicode Text Segmentation} [online]. Edited by Mark Davis. Revision 35; issued for Unicode 12.0.0. 2019-02-15 [viewed 2020-02-23]. Available at \url{http://www.unicode.org/reports/tr29/tr29-35.html} \end{itemize} @@ -658,34 +671,3 @@ identifiers separated by commas). \end{itemize}% \indextext{notation!syntax|)} - -\rSec1[intro.ack]{Acknowledgments} - -\pnum -The \Cpp{} programming language as described in this document -is based on the language as described in Chapter R (Reference -Manual) of Stroustrup: \doccite{The \Cpp{} Programming Language} (second -edition, Addison-Wesley Publishing Company, ISBN 0-201-53992-6, -copyright \copyright 1991 AT\&T). That, in turn, is based on the C -programming language as described in Appendix A of Kernighan and -Ritchie: \doccite{The C Programming Language} (Prentice-Hall, 1978, ISBN -0-13-110163-3, copyright \copyright 1978 AT\&T). - -\pnum -Portions of the library Clauses of this document are based -on work by P.J. Plauger, which was published as \doccite{The Draft -Standard \Cpp{} Library} (Prentice-Hall, ISBN 0-13-117003-1, copyright -\copyright 1995 P.J. Plauger). - -\pnum -POSIX\textregistered\ is a registered trademark of the Institute of Electrical and -Electronic Engineers, Inc. - -\pnum -ECMAScript\textregistered\ is a registered trademark of Ecma International. - -\pnum -Unicode\textregistered\ is a registered trademark of Unicode, Inc. - -\pnum -All rights in these originals are reserved. diff --git a/source/xrefdelta.tex b/source/xrefdelta.tex index 656ea5ccb0..3fe4fe757d 100644 --- a/source/xrefdelta.tex +++ b/source/xrefdelta.tex @@ -282,6 +282,9 @@ % Shortened label \movedxref{language.support}{support} +% Dissolved subclause +\movedxref{intro.ack}{intro.refs} + % Deprecated features. \deprxref{util.smartptr.shared.atomic} \deprxref{res.on.required} From 53be032fc915367708d4fe8b1cc6c30ddff8a4d4 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 9 Sep 2020 17:52:16 +0200 Subject: [PATCH 079/250] [std] Use prefix 'Annex' for chapters in the table of contents. Partially addresses ISO/CS 016 (C++20 DIS) --- source/macros.tex | 3 +++ source/std.tex | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/source/macros.tex b/source/macros.tex index 359ded1661..a82acd7c37 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -76,6 +76,9 @@ \newcommand{\clauselabel}[1]{\customlabel{#1}{Clause \thechapter}} \newcommand{\annexlabel}[1]{\customlabel{#1}{Annex \thechapter}} +% Use prefix "Annex" in the table of contents +\newcommand{\annexnumberlinebox}[2]{Annex #2\space} + % The basic sectioning command. Example: % \Sec1[intro.scope]{Scope} % defines a first-level section whose name is "Scope" and whose short diff --git a/source/std.tex b/source/std.tex index 3c69837f4a..f7d181b06e 100644 --- a/source/std.tex +++ b/source/std.tex @@ -135,6 +135,13 @@ %%-------------------------------------------------- %% appendices \appendix + +% \include and \addtocontents don't mix; see +% https://tex.stackexchange.com/questions/13914/toc-numbering-problem +\makeatletter +\immediate\write\@auxout{\noexpand\@writefile{toc}{\noexpand\let\noexpand\chapternumberlinebox\noexpand\annexnumberlinebox}} +\makeatother + \include{grammar} \include{limits} \include{compatibility} From 675ce485946a207bf2d6ce193720bd1b8948d815 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 9 Sep 2020 18:07:07 +0200 Subject: [PATCH 080/250] [std] Remove 'of this document' after hyperlinked clause references. Partially addresses ISO/CS 016 (C++20 DIS) --- source/expressions.tex | 3 +-- source/intro.tex | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index efd1f101c5..d6d751c19b 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -6920,7 +6920,6 @@ \item an operation that would have undefined behavior as specified in \ref{intro} through \ref{cpp} -of this document \begin{note} including, for example, signed integer overflow\iref{expr.prop}, certain @@ -7067,7 +7066,7 @@ If $E$ satisfies the constraints of a core constant expression, but evaluation of $E$ would evaluate an operation that has undefined behavior -as specified in \ref{library} through \ref{\lastlibchapter} of this document, or +as specified in \ref{library} through \ref{\lastlibchapter}, or an invocation of the \tcode{va_start} macro\iref{cstdarg.syn}, it is unspecified whether $E$ is a core constant expression. diff --git a/source/intro.tex b/source/intro.tex index bf164563d0..39c3eac43f 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -367,7 +367,7 @@ issuance of a diagnostic message). Many erroneous program constructs do not engender undefined behavior; they are required to be diagnosed. Evaluation of a constant expression never exhibits behavior explicitly -specified as undefined in \ref{intro} through \ref{cpp} of this document\iref{expr.const}. +specified as undefined in \ref{intro} through \ref{cpp}\iref{expr.const}. \end{defnote} \indexdefn{behavior!unspecified}% From 1ac2842fed6f00dcb4f96b1f0f8fd85ac5c8a573 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 9 Sep 2020 18:17:29 +0200 Subject: [PATCH 081/250] [description] Remove vacuous 'normative' statement. Partially addresses ISO/CS 016 (C++20 DIS) --- 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 bd6e78264c..9927a9eb70 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -443,7 +443,7 @@ \pnum Subclause \ref{description} describes the conventions used to specify the \Cpp{} standard -library. \ref{structure} describes the structure of the normative +library. \ref{structure} describes the structure of \ref{\firstlibchapter} through \ref{\lastlibchapter} and \ref{depr}. \ref{conventions} describes other editorial conventions. From 68fa2c7e171f718c800fc6a013f2d1cbb8760fa1 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 9 Sep 2020 23:20:39 +0200 Subject: [PATCH 082/250] [depr.c.headers.other] Fix overfull \box --- source/future.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/future.tex b/source/future.tex index e258ad16b1..4962ab2df5 100644 --- a/source/future.tex +++ b/source/future.tex @@ -357,7 +357,7 @@ other than \libdeprheaderref{complex.h}, \libdeprheaderref{iso646.h}, -\libdeprheaderref{stdalign.h}, +\libdeprheaderref{stdalign.h},\newline \libdeprheaderref{stdbool.h}, and \libdeprheaderref{tgmath.h}, each of From 657e066fd19ec68ce4e071f8771d10e76a2c32c5 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 9 Sep 2020 17:26:24 -0700 Subject: [PATCH 083/250] Fix solitary subclauses. ISO rules don't permit us to have a subclause with no siblings. We had six of these, for various reasons. Fold them together or add more subclauses to un-isolate. For ISO/CS 018 (C++20 DIS). --- source/future.tex | 4 +--- source/iterators.tex | 6 ++---- source/locales.tex | 6 +++--- source/numerics.tex | 6 ++++-- source/support.tex | 8 ++++++++ source/xrefdelta.tex | 6 ++++++ 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/source/future.tex b/source/future.tex index 4962ab2df5..44f72dabb9 100644 --- a/source/future.tex +++ b/source/future.tex @@ -1660,9 +1660,7 @@ \end{itemize} \end{itemdescr} -\rSec1[depr.iterator.primitives]{Deprecated iterator primitives} - -\rSec2[depr.iterator.basic]{Basic iterator} +\rSec1[depr.iterator]{Deprecated \tcode{iterator} class template} \pnum The header \libheaderrefx{iterator}{iterator.synopsis} has the following addition: diff --git a/source/iterators.tex b/source/iterators.tex index 75a01af7df..72e34e2f0f 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -391,7 +391,7 @@ template<@\libconcept{input_iterator}@ I> struct iterator_traits>; - // \ref{unreachable.sentinels}, unreachable sentinels + // \ref{unreachable.sentinel}, unreachable sentinel struct unreachable_sentinel_t; inline constexpr unreachable_sentinel_t @\libglobal{unreachable_sentinel}@{}; @@ -5662,9 +5662,7 @@ Equivalent to \tcode{ranges::iter_swap(x.current, y.current)}. \end{itemdescr} -\rSec2[unreachable.sentinels]{Unreachable sentinel} - -\rSec3[unreachable.sentinel]{Class \tcode{unreachable_sentinel_t}} +\rSec2[unreachable.sentinel]{Unreachable sentinel} \indexlibraryglobal{unreachable_sentinel_t}% \pnum diff --git a/source/locales.tex b/source/locales.tex index 8aa37c5646..b17f465b53 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -969,9 +969,7 @@ facet and use it directly, or use the vector form of \tcode{ctype<>::is}.} -\rSec3[conversions]{Conversions} - -\rSec4[conversions.character]{Character conversions} +\rSec3[conversions.character]{Character conversions} \indexlibraryglobal{toupper}% \begin{itemdecl} @@ -5052,6 +5050,8 @@ The contents and meaning of the header \libheaderdef{clocale} are the same as the C standard library header \libheader{locale.h}. +\rSec2[clocale.data.races]{Data races} + \pnum Calls to the function \tcode{setlocale} may introduce a data race\iref{res.on.data.races} with other calls to \tcode{setlocale} or with calls to diff --git a/source/numerics.tex b/source/numerics.tex index 9d141eb0bf..d3212286eb 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -159,6 +159,10 @@ floating-point evaluation in constant expressions. \end{note} +\xrefc{7.6} + +\rSec2[cfenv.thread]{Threads} + \pnum The floating-point environment has thread storage duration\iref{basic.stc.thread}. The initial state for a thread's floating-point @@ -176,8 +180,6 @@ A separate floating-point environment is maintained for each thread. Each function accesses the environment corresponding to its calling thread. -\xrefc{7.6} - \rSec1[complex.numbers]{Complex numbers} \rSec2[complex.numbers.general]{General} diff --git a/source/support.tex b/source/support.tex index cd36ac7f1f..ae5d3a1f5b 100644 --- a/source/support.tex +++ b/source/support.tex @@ -1694,6 +1694,14 @@ \rSec1[cstdint]{Integer types} +\rSec2[cstdint.general]{General} + +\pnum +The header +\libheaderref{cstdint} +supplies integer types having specified widths, and +macros that specify limits of integer types. + \rSec2[cstdint.syn]{Header \tcode{} synopsis} \indexheader{cstdint}% diff --git a/source/xrefdelta.tex b/source/xrefdelta.tex index 3fe4fe757d..40d502dc8e 100644 --- a/source/xrefdelta.tex +++ b/source/xrefdelta.tex @@ -290,3 +290,9 @@ \deprxref{res.on.required} \deprxref{fs.path.factory} \movedxref{operators}{depr.relops} + +% Collapsed subclauses with no siblings. +\movedxref{depr.iterator.primitives}{depr.iterator} +\movedxref{depr.iterator.basic}{depr.iterator} +\movedxref{unreachable.sentinels}{unreachable.sentinel} +\movedxref{conversions}{conversions.character} From 324075346cb2837b3d329cf4a2052bd83ff64493 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 11:05:53 +0200 Subject: [PATCH 084/250] [check] Detect subclauses without siblings. According to the ISO Directives, Part 2, each subclause is required to have at least one sibling. --- tools/check.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tools/check.sh b/tools/check.sh index a6de4595d0..7300a20910 100755 --- a/tools/check.sh +++ b/tools/check.sh @@ -98,6 +98,24 @@ for f in $texfiles; do awk -F: 'BEGIN { prevlevel = 0 } $3 ~ /^\\rSec./ { match($3, "[0-9]"); level=substr($3, RSTART, 1); if (text && level > prevlevel) { print prevsec " <-- Hanging paragraph follows" } prevlevel = level; prevsec = $3; text = 0 } $3 == "x" { text = 1 }' done | grep . && exit 1 +# Subclauses without siblings +for f in $texfiles; do + sed -n '/^\\rSec/{=;p}' $f | + # prefix output with filename and line + sed '/^[0-9]\+$/{N;s/\n/:/}' | sed "s/.*/$f:&/" | + awk -F: 'BEGIN { prevlevel = 0 } + { + match($3, "[0-9]"); + level = substr($3, RSTART, 1); + if (level < prevlevel && secs[prevlevel] == 1) { print title[prevlevel] " <-- Subclause without siblings" } + ++secs[level]; + title[level] = $0; + secs[level + 1] = 0; + prevlevel = level; + }' +done | grep . && exit 1 + + # Library descriptive macros not immediately preceded by \pnum. for f in $texlibdesc; do sed -n '/^\\pnum/{h;:x;n;/^\\index/b x;/^\\\(constraints\|mandates\|expects\|effects\|sync\|ensures\|returns\|throws\|complexity\|remarks\|errors\)/{x;/\n/{x;=;p};d};/^\\pnum/D;H;b x}' $f | From 9ecf46588d36709b577d94dd965b938b78460b6a Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 5 Sep 2020 22:39:18 +0200 Subject: [PATCH 085/250] [util.smartptr.shared.cast] Add hyphen for 'well-formed'. Fixes NB JP 007 (C++20 DIS) --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index 7c8715cd3f..dfffcd4f28 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -10852,7 +10852,7 @@ \pnum \mandates The expression \tcode{dynamic_cast((U*)nullptr)} is well-formed. -The expression \tcode{dynamic_cast::element_type*>(r.get())} is well formed. +The expression \tcode{dynamic_cast::element_type*>(r.get())} is well-formed. \pnum \expects From 6a55c3faebe6c5139299e6b0169ee21ef77a1fe1 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 7 Sep 2020 08:59:35 +0200 Subject: [PATCH 086/250] [variant.helper] Use 'struct' for variant_size and variant_alternative Fixes NB JP 005 and JP 006 (C++20 DIS) --- source/utilities.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index dfffcd4f28..89c83d6b64 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -4811,7 +4811,7 @@ \indexlibraryglobal{variant_size}% \begin{itemdecl} -template class variant_size; +template struct variant_size; \end{itemdecl} \begin{itemdescr} @@ -4831,7 +4831,7 @@ \indexlibraryglobal{variant_alternative}% \begin{itemdecl} -template class variant_alternative; +template struct variant_alternative; \end{itemdecl} \begin{itemdescr} From 7ba75545a6fce10ba602384268b59952c4ec4519 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 7 Sep 2020 09:09:30 +0200 Subject: [PATCH 087/250] [mem.res.syn] Add default template argument for polymorphic_allocator Fixes NB JP 008 (C++20 DIS) --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index 89c83d6b64..fee4634dd7 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -11455,7 +11455,7 @@ bool operator==(const memory_resource& a, const memory_resource& b) noexcept; // \ref{mem.poly.allocator.class}, class template \tcode{polymorphic_allocator} - template class polymorphic_allocator; + template class polymorphic_allocator; template bool operator==(const polymorphic_allocator& a, From 756dc5b1f029e1ed0b83d599bed37b9eb5d0fb23 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Mon, 7 Sep 2020 09:14:12 +0200 Subject: [PATCH 088/250] [mem.poly.allocator.mem] Fix syntax for variadic template declaration Fixes NB JP 009 --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index fee4634dd7..0b66f500d9 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -11857,7 +11857,7 @@ \indexlibrarymember{new_object}{polymorphic_allocator}% \begin{itemdecl} -template +template [[nodiscard]] T* new_object(CtorArgs&&... ctor_args); \end{itemdecl} From 8e90bc02d4496ce59b875d7b93971ccfc87e16dd Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 6 Sep 2020 10:55:51 +0200 Subject: [PATCH 089/250] [defns.undefined] Move cross-reference to [expr.const] Fixes NB JP 003 (C++20 DIS) --- source/intro.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/intro.tex b/source/intro.tex index 39c3eac43f..21e7a2580f 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -366,8 +366,8 @@ diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message). Many erroneous program constructs do not engender undefined behavior; they are required to be diagnosed. -Evaluation of a constant expression never exhibits behavior explicitly -specified as undefined in \ref{intro} through \ref{cpp}\iref{expr.const}. +Evaluation of a constant expression\iref{expr.const} never exhibits behavior explicitly +specified as undefined in \ref{intro} through \ref{cpp}. \end{defnote} \indexdefn{behavior!unspecified}% From 656f6b33ba3ace9182181b0f5c6e473c77c87204 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 11:43:10 +0200 Subject: [PATCH 090/250] [definitions] Integrate into [intro.defs] Partially addresses ISO/CS 016 (C++20 DIS) --- source/intro.tex | 314 ++++++++++++++++++++++++++++++++++++++++++- source/lib-intro.tex | 311 +----------------------------------------- source/xrefdelta.tex | 1 + 3 files changed, 313 insertions(+), 313 deletions(-) diff --git a/source/intro.tex b/source/intro.tex index 21e7a2580f..e2d9b1ad14 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -115,11 +115,6 @@ \item IEC Electropedia: available at \url{http://www.electropedia.org/} \end{itemize} -\pnum -\ref{definitions} -defines additional terms that are used only in \ref{library} -through \ref{\lastlibchapter} and \ref{depr}. - \pnum Terms that are used only in a small portion of this document are defined where they are used and italicized where they are @@ -141,6 +136,16 @@ although they may involve accesses of scalar subobjects. \end{defnote} +\definition{arbitrary-positional stream}{defns.arbitrary.stream} +\defncontext{library} +\indexdefn{stream!arbitrary-positional}% +stream (described in \ref{input.output}) that can seek to any integral position within +the length of the stream + +\begin{defnote} +Every arbitrary-positional stream is also a repositional stream. +\end{defnote} + \indexdefn{argument}% \indexdefn{argument!function call expression} \definition{argument}{defns.argument} @@ -179,6 +184,63 @@ \defncontext{statement} compound statement\iref{stmt.block} +\definition{character}{defns.character} +\indexdefn{character}% +\defncontext{library} +object which, +when treated sequentially, +can represent text + +\begin{defnote} +The term does not mean only +\tcode{char}, +\tcode{char8_t}, +\tcode{char16_t}, +\tcode{char32_t}, +and +\tcode{wchar_t} +objects, +but any value that can be represented by a type +that provides the definitions specified in +\ref{strings}, \ref{localization}, \ref{input.output}, or~\ref{re}. +\end{defnote} + +\definition{character container type}{defns.character.container} +\defncontext{library} +\indexdefn{type!character container}% +class or a type used to +represent a character + +\begin{defnote} +It is used for one of the template parameters of the string, +iostream, and regular expression class templates. +\end{defnote} + +\definition{comparison function}{defns.comparison} +\defncontext{library} +\indexdefn{function!comparison}% +operator function\iref{over.oper} for any of the +equality\iref{expr.eq}, +relational\iref{expr.rel}, or +three-way comparison\iref{expr.spaceship} +operators + +\definition{component}{defns.component} +\defncontext{library} +\indexdefn{component}% +group of library entities directly related as members, parameters, or +return types + +\begin{defnote} +For example, the class template +\tcode{basic_string} +and the non-member +function templates +that operate on +strings are referred to as the +\term{string component}. +\end{defnote} + \indexdefn{behavior!conditionally-supported}% \definition{conditionally-supported}{defns.cond.supp} program construct that an implementation is not required to support @@ -188,11 +250,36 @@ constructs that it does not support. \end{defnote} +\definition{constant subexpression}{defns.const.subexpr} +\indexdefn{constant subexpression}% +expression whose evaluation as subexpression of a +\grammarterm{conditional-expression} +\tcode{CE}\iref{expr.cond} would not prevent \tcode{CE} +from being a core constant expression\iref{expr.const} + +\definition{deadlock}{defns.deadlock} +\defncontext{library} +\indexdefn{deadlock}% +situation wherein +one or more threads are unable to continue execution because each is +blocked waiting for one or more of the others to satisfy some condition + +\definition{default behavior}{defns.default.behavior.impl} +\indexdefn{behavior!default}% +\defncontext{library implementation} +specific behavior provided by the implementation, +within the scope of the required behavior + \indexdefn{message!diagnostic}% \definition{diagnostic message}{defns.diagnostic} message belonging to an \impldef{diagnostic message} subset of the implementation's output messages +\definition{direct-non-list-initialization}{defns.direct-non-list-init} +\indexdefn{direct-non-list-initialization}% +direct-initialization\iref{dcl.init} +that is not list-initialization\iref{dcl.init.list} + \indexdefn{type!dynamic}% \definition{dynamic type}{defns.dynamic.type} \defncontext{glvalue} type of the most derived object\iref{intro.object} to which the @@ -210,6 +297,40 @@ \definition{dynamic type}{defns.dynamic.type.prvalue} \defncontext{prvalue} static type of the prvalue expression +\definition{expression-equivalent}{defns.expression-equivalent} +\defncontext{library} +\indexdefn{expression-equivalent}% +expressions that all have the same effects, +either +are all potentially-throwing\iref{except.spec} or +are all not potentially-throwing, +and +either +are all constant subexpressions or +are all not constant subexpressions + +\begin{example} +For a value \tcode{x} of type \tcode{int} +and a function \tcode{f} that accepts integer arguments, +the expressions +\tcode{f(x + 2)}, +\tcode{f(2 + x)}, +and +\tcode{f(1 + x + 1)} +are expression-equivalent. +\end{example} + +\definition{handler function}{defns.handler} +\defncontext{library} +\indexdefn{function!handler}% +non-reserved function whose definition may be provided by a \Cpp{} program + +\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}. +\end{defnote} + \indexdefn{program!ill-formed}% \definition{ill-formed program}{defns.ill.formed} program that is not well-formed\iref{defns.well.formed} @@ -219,15 +340,56 @@ behavior, for a well-formed program construct and correct data, that depends on the implementation and that each implementation documents +\definition{implementation-defined strict total order over pointers} +{defns.order.ptr} +\indexdefn{pointer!strict total order}% +\defncontext{library} +\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 +\tcode{<}, \tcode{>}, \tcode{<=}, \tcode{>=}, and \tcode{<=>} + \indexdefn{limits!implementation}% \definition{implementation limits}{defns.impl.limits} restrictions imposed upon programs by the implementation +\definition{iostream class templates}{defns.iostream.templates} +\defncontext{library} +templates, defined in \ref{input.output}, +that take two template arguments + +\begin{defnote} +The arguments are named \tcode{charT} and \tcode{traits}. +The argument \tcode{charT} is a character container class, and +the argument \tcode{traits} is a class +which defines additional characteristics and functions +of the character type represented by \tcode{charT} +necessary to implement the iostream class templates. +\end{defnote} + \indexdefn{behavior!locale-specific}% \definition{locale-specific behavior}{defns.locale.specific} behavior that depends on local conventions of nationality, culture, and language that each implementation documents +\definition{modifier function}{defns.modifier} +\defncontext{library} +\indexdefn{function!modifier}% +class member function\iref{class.mfct} other than a constructor, +assignment operator, or destructor +that alters the state of an object of the class + +\definition{move assignment}{defns.move.assign} +\defncontext{library} +\indexdefn{assignment!move}% +assignment of an rvalue of some object type to a modifiable lvalue of the same type + +\definition{move construction}{defns.move.constr} +\defncontext{library} +\indexdefn{construction!move}% +direct-initialization of an object of some type with an rvalue of the same type + \indexdefn{character!multibyte}% \definition{multibyte character}{defns.multibyte} sequence of one or more bytes representing a member of the extended @@ -238,6 +400,28 @@ set\iref{lex.charset}. \end{defnote} +\definition{NTCTS}{defns.ntcts} +\defncontext{library} +\indexdefn{NTCTS}% +\indexdefn{string!null-terminated character type}% +sequence of values that have +character type +that precede the terminating null character type +value +\tcode{charT()} + +\definition{observer function}{defns.observer} +\defncontext{library} +\indexdefn{function!observer}% +class member function\iref{class.mfct} that accesses the state of an object of the class +but does not alter that state + +\begin{defnote} +Observer functions are specified as +\tcode{const} +member functions\iref{class.this}. +\end{defnote} + \indexdefn{parameter}% \indexdefn{parameter!function}% \indexdefn{parameter!catch clause}% @@ -258,6 +442,96 @@ \definition{parameter}{defns.parameter.templ} \defncontext{template} member of a \grammarterm{template-parameter-list} +\definition{program-defined specialization}{defns.prog.def.spec} +\defncontext{library} +\indexdefn{specialization!program-defined}% +explicit template specialization or partial specialization +that is not part of the \Cpp{} standard library and +not defined by the implementation + +\definition{program-defined type}{defns.prog.def.type} +\defncontext{library} +\indexdefn{type!program-defined}% +non-closure class type or enumeration type +that is not part of the \Cpp{} standard library and +not defined by the implementation, +or a closure type of a non-implementation-provided lambda expression, +or an instantiation of a program-defined specialization + +\begin{defnote} +Types defined by the implementation include +extensions\iref{intro.compliance} and internal types used by the library. +\end{defnote} + +\definition{projection}{defns.projection} +\indexdefn{projection}% +\defncontext{function object argument} transformation that +an algorithm applies before inspecting the values of elements + +\begin{example} +\begin{codeblock} +std::pair pairs[] = {{2, "foo"}, {1, "bar"}, {0, "baz"}}; +std::ranges::sort(pairs, std::ranges::less{}, [](auto const& p) { return p.first; }); +\end{codeblock} +sorts the pairs in increasing order of their \tcode{first} members: +\begin{codeblock} +{{0, "baz"}, {1, "bar"}, {2, "foo"}} +\end{codeblock} +\end{example} + +\definition{referenceable type}{defns.referenceable} +\indexdefn{type!referenceable}% +type that is either an +object type, a function type that does not have cv-qualifiers or a +\grammarterm{ref-qualifier}, or a reference type + +\begin{defnote} +The term describes a type to which a reference can be created, +including reference types. +\end{defnote} + +\definition{replacement function}{defns.replacement} +\defncontext{library} +\indexdefn{function!replacement}% +non-reserved function +whose definition is provided by a \Cpp{} program + +\begin{defnote} +Only one definition for such a function is in effect for the duration of the program's +execution, as the result of creating the program\iref{lex.phases} and resolving the +definitions of all translation units\iref{basic.link}. +\end{defnote} + +\definition{repositional stream}{defns.repositional.stream} +\defncontext{library} +\indexdefn{stream!repositional}% +stream (described in \ref{input.output}) that can seek to a position that was +previously encountered + +\definition{required behavior}{defns.required.behavior} +\defncontext{library} +\indexdefn{behavior!required}% +description of replacement function and handler function semantics +applicable to both the behavior provided by the implementation and +the behavior of any such function definition in the program + +\begin{defnote} +If such a function defined in a \Cpp{} program fails to meet the required +behavior when it executes, the behavior is undefined.% +\indextext{undefined} +\end{defnote} + +\definition{reserved function}{defns.reserved.function} +\defncontext{library} +\indexdefn{function!reserved}% +function, specified as part of the \Cpp{} standard library, that is defined by the +implementation + +\begin{defnote} +If a \Cpp{} program provides a definition for any reserved function, the results are undefined.% +\indextext{undefined} +\end{defnote} + \indexdefn{signature}% \definition{signature}{defns.signature} \defncontext{function} @@ -335,6 +609,17 @@ \defncontext{class member function template specialization} signature of the member function template of which it is a specialization and its template arguments (whether explicitly specified or deduced) +\definition{stable algorithm}{defns.stable} +\defncontext{library} +\indexdefn{algorithm!stable}% +\indexdefn{stable algorithm}% +algorithm that preserves, as appropriate to the particular algorithm, the order +of elements + +\begin{defnote} +Requirements for stable algorithms are given in \ref{algorithm.stable}. +\end{defnote} + \indexdefn{type!static}% \definition{static type}{defns.static.type} type of an expression\iref{basic.types} resulting from @@ -346,6 +631,12 @@ executing. \end{defnote} +\definition{traits class}{defns.traits} +\defncontext{library} +\indexdefn{traits}% +class that encapsulates a set of types and functions necessary for class templates and +function templates to manipulate objects of types for which they are instantiated + \indexdefn{unblock}% \definition{unblock}{defns.unblock} satisfy a condition that one or more blocked threads of execution are waiting for @@ -381,6 +672,19 @@ possible behaviors is usually delineated by this document. \end{defnote} +\definition{valid but unspecified state}{defns.valid} +\defncontext{library} +\indexdefn{valid but unspecified state}% +value of an object that is not specified except that the object's invariants are +met and operations on the object behave as specified for its type + +\begin{example} +If an object \tcode{x} of type \tcode{std::vector} is in a +valid but unspecified state, \tcode{x.empty()} can be called unconditionally, +and \tcode{x.front()} can be called only if \tcode{x.empty()} returns +\tcode{false}. +\end{example} + \indexdefn{program!well-formed}% \definition{well-formed program}{defns.well.formed} \Cpp{} program constructed according to the syntax rules, diagnosable diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 9927a9eb70..cce25a2bea 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -10,8 +10,8 @@ how a conforming implementation may provide the entities in the library. \pnum -The following subclauses describe the definitions\iref{definitions}, method of -description\iref{description}, and organization\iref{organization} of the +The following subclauses describe the method of +description\iref{description} and organization\iref{organization} of the library. \ref{requirements}, \ref{\firstlibchapter} through \ref{\lastlibchapter}, and \ref{depr} specify the contents of the library, as well as library requirements and constraints on both well-formed @@ -132,311 +132,6 @@ ISO C \tcode{restrict} qualifier) are the same unless otherwise stated. -\rSec1[definitions]{Definitions} - -\pnum -\begin{note} -\ref{intro.defs} defines additional terms used elsewhere in this document. -\end{note} - -\definition{arbitrary-positional stream}{defns.arbitrary.stream} -\indexdefn{stream!arbitrary-positional}% -stream (described in \ref{input.output}) that can seek to any integral position within -the length of the stream - -\begin{defnote} -Every arbitrary-positional stream is also a repositional stream. -\end{defnote} - -\definition{character}{defns.character} -\indexdefn{character}% -\defncontext{\ref{strings}, \ref{localization}, \ref{input.output}, and~\ref{re}} -object which, -when treated sequentially, -can represent text - -\begin{defnote} -The term does not mean only -\tcode{char}, -\tcode{char8_t}, -\tcode{char16_t}, -\tcode{char32_t}, -and -\tcode{wchar_t} -objects, -but any value that can be represented by a type -that provides the definitions specified in these Clauses. -\end{defnote} - -\definition{character container type}{defns.character.container} -\indexdefn{type!character container}% -class or a type used to -represent a character - -\begin{defnote} -It is used for one of the template parameters of the string, -iostream, and regular expression class templates. -\end{defnote} - -\definition{comparison function}{defns.comparison} -\indexdefn{function!comparison}% -operator function\iref{over.oper} for any of the -equality\iref{expr.eq}, -relational\iref{expr.rel}, or -three-way comparison\iref{expr.spaceship} -operators - -\definition{component}{defns.component} -\indexdefn{component}% -group of library entities directly related as members, parameters, or -return types - -\begin{defnote} -For example, the class template -\tcode{basic_string} -and the non-member -function templates -that operate on -strings are referred to as the -\term{string component}. -\end{defnote} - -\definition{constant subexpression}{defns.const.subexpr} -\indexdefn{constant subexpression}% -expression whose evaluation as subexpression of a -\grammarterm{conditional-expression} -\tcode{CE}\iref{expr.cond} would not prevent \tcode{CE} -from being a core constant expression\iref{expr.const} - -\definition{deadlock}{defns.deadlock} -\indexdefn{deadlock}% -situation wherein -one or more threads are unable to continue execution because each is -blocked waiting for one or more of the others to satisfy some condition - -\definition{default behavior}{defns.default.behavior.impl} -\indexdefn{behavior!default}% -\defncontext{implementation} -specific behavior provided by the implementation, -within the scope of the required behavior - -\definition{default behavior}{defns.default.behavior.func} -\indexdefn{behavior!default}% -\defncontext{specification} -description of replacement function and handler function -semantics - -\definition{direct-non-list-initialization}{defns.direct-non-list-init} -\indexdefn{direct-non-list-initialization}% -direct-initialization\iref{dcl.init} -that is not list-initialization\iref{dcl.init.list} - -\definition{expression-equivalent}{defns.expression-equivalent} -\indexdefn{expression-equivalent}% -expressions that all have the same effects, -either -are all potentially-throwing\iref{except.spec} or -are all not potentially-throwing, -and -either -are all constant subexpressions or -are all not constant subexpressions - -\begin{example} -For a value \tcode{x} of type \tcode{int} -and a function \tcode{f} that accepts integer arguments, -the expressions -\tcode{f(x + 2)}, -\tcode{f(2 + x)}, -and -\tcode{f(1 + x + 1)} -are expression-equivalent. -\end{example} - -\definition{handler function}{defns.handler} -\indexdefn{function!handler}% -non-reserved function whose definition may be provided by a \Cpp{} program - -\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}. -\end{defnote} - -\definition{implementation-defined strict total order over pointers} -{defns.order.ptr} -\indexdefn{pointer!strict total order}% -\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 -\tcode{<}, \tcode{>}, \tcode{<=}, \tcode{>=}, and \tcode{<=>} - -\definition{iostream class templates}{defns.iostream.templates} -templates, defined in \ref{input.output}, -that take two template arguments - -\begin{defnote} -The arguments are named -\tcode{charT} -and -\tcode{traits}. -The argument -\tcode{charT} -is a character container class, -and the argument -\tcode{traits} -is a class which defines additional characteristics and functions -of the character type represented by -\tcode{charT} -necessary to implement the iostream class templates. -\end{defnote} - -\definition{modifier function}{defns.modifier} -\indexdefn{function!modifier}% -class member function\iref{class.mfct} other than a constructor, -assignment operator, or destructor -that alters the state of an object of the class - -\definition{move assignment}{defns.move.assign} -\indexdefn{assignment!move}% -assignment of an rvalue of some object type to a modifiable lvalue of the same type - -\definition{move construction}{defns.move.constr} -\indexdefn{construction!move}% -direct-initialization of an object of some type with an rvalue of the same type - -\definition{NTCTS}{defns.ntcts} -\indexdefn{NTCTS}% -\indexdefn{string!null-terminated character type}% -sequence of values that have -character type -that precede the terminating null character type -value -\tcode{charT()} - -\definition{observer function}{defns.observer} -\indexdefn{function!observer}% -class member function\iref{class.mfct} that accesses the state of an object of the class -but does not alter that state - -\begin{defnote} -Observer functions are specified as -\tcode{const} -member functions\iref{class.this}. -\end{defnote} - -\definition{program-defined specialization}{defns.prog.def.spec} -\indexdefn{specialization!program-defined}% -explicit template specialization or partial specialization -that is not part of the \Cpp{} standard library and -not defined by the implementation - -\definition{program-defined type}{defns.prog.def.type} -\indexdefn{type!program-defined}% -non-closure class type or enumeration type -that is not part of the \Cpp{} standard library and -not defined by the implementation, -or a closure type of a non-implementation-provided lambda expression, -or an instantiation of a program-defined specialization - -\begin{defnote} -Types defined by the implementation include -extensions\iref{intro.compliance} and internal types used by the library. -\end{defnote} - -\definition{projection}{defns.projection} -\indexdefn{projection}% -\defncontext{function object argument} transformation that -an algorithm applies before inspecting the values of elements - -\begin{example} -\begin{codeblock} -std::pair pairs[] = {{2, "foo"}, {1, "bar"}, {0, "baz"}}; -std::ranges::sort(pairs, std::ranges::less{}, [](auto const& p) { return p.first; }); -\end{codeblock} -sorts the pairs in increasing order of their \tcode{first} members: -\begin{codeblock} -{{0, "baz"}, {1, "bar"}, {2, "foo"}} -\end{codeblock} -\end{example} - -\definition{referenceable type}{defns.referenceable} -\indexdefn{type!referenceable}% -type that is either an -object type, a function type that does not have cv-qualifiers or a -\grammarterm{ref-qualifier}, or a reference type - -\begin{defnote} -The term describes a type to which a reference can be created, -including reference types. -\end{defnote} - -\definition{replacement function}{defns.replacement} -\indexdefn{function!replacement}% -non-reserved function -whose definition is provided by a \Cpp{} program - -\begin{defnote} -Only one definition for such a function is in effect for the duration of the program's -execution, as the result of creating the program\iref{lex.phases} and resolving the -definitions of all translation units\iref{basic.link}. -\end{defnote} - -\definition{repositional stream}{defns.repositional.stream} -\indexdefn{stream!repositional}% -stream (described in \ref{input.output}) that can seek to a position that was -previously encountered - -\definition{required behavior}{defns.required.behavior} -\indexdefn{behavior!required}% -description of replacement function and handler function semantics -applicable to both the behavior provided by the implementation and -the behavior of any such function definition in the program - -\begin{defnote} -If such a function defined in a \Cpp{} program fails to meet the required -behavior when it executes, the behavior is undefined.% -\indextext{undefined} -\end{defnote} - -\definition{reserved function}{defns.reserved.function} -\indexdefn{function!reserved}% -function, specified as part of the \Cpp{} standard library, that is defined by the -implementation - -\begin{defnote} -If a \Cpp{} program provides a definition for any reserved function, the results are undefined.% -\indextext{undefined} -\end{defnote} - -\definition{stable algorithm}{defns.stable} -\indexdefn{algorithm!stable}% -\indexdefn{stable algorithm}% -algorithm that preserves, as appropriate to the particular algorithm, the order -of elements - -\begin{defnote} -Requirements for stable algorithms are given in \ref{algorithm.stable}. -\end{defnote} - -\definition{traits class}{defns.traits} -\indexdefn{traits}% -class that encapsulates a set of types and functions necessary for class templates and -function templates to manipulate objects of types for which they are instantiated - -\definition{valid but unspecified state}{defns.valid} -\indexdefn{valid but unspecified state}% -value of an object that is not specified except that the object's invariants are -met and operations on the object behave as specified for its type - -\begin{example} -If an object \tcode{x} of type \tcode{std::vector} is in a -valid but unspecified state, \tcode{x.empty()} can be called unconditionally, -and \tcode{x.front()} can be called only if \tcode{x.empty()} returns -\tcode{false}. -\end{example} - \rSec1[description]{Method of description} \rSec2[description.general]{General} @@ -2789,7 +2484,7 @@ Under some circumstances, \indextext{library!\Cpp{} standard}% however, certain of these function descriptions also apply to replacement functions defined -in the program\iref{definitions}. +in the program. \pnum A \Cpp{} program may provide the definition for any of the following diff --git a/source/xrefdelta.tex b/source/xrefdelta.tex index 40d502dc8e..aab569f664 100644 --- a/source/xrefdelta.tex +++ b/source/xrefdelta.tex @@ -284,6 +284,7 @@ % Dissolved subclause \movedxref{intro.ack}{intro.refs} +\movedxref{definitions}{intro.defs} % Deprecated features. \deprxref{util.smartptr.shared.atomic} From b91875150f1563eabc27b57208638e807a01a8e1 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 16:17:38 +0200 Subject: [PATCH 091/250] [lib] Replace 'comparison function' with 'comparison operator function'. --- source/diagnostics.tex | 4 ++-- source/intro.tex | 9 --------- source/lib-intro.tex | 8 ++++---- source/regex.tex | 2 +- source/strings.tex | 2 +- source/utilities.tex | 8 ++++---- 6 files changed, 12 insertions(+), 21 deletions(-) diff --git a/source/diagnostics.tex b/source/diagnostics.tex index 0e305c6c45..87c4492a5d 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -798,7 +798,7 @@ // \ref{syserr.errcondition.nonmembers}, non-member functions error_condition make_error_condition(errc e) noexcept; - // \ref{syserr.compare}, comparison functions + // \ref{syserr.compare}, comparison operator functions bool operator==(const error_code& lhs, const error_code& rhs) noexcept; bool operator==(const error_code& lhs, const error_condition& rhs) noexcept; bool operator==(const error_condition& lhs, const error_condition& rhs) noexcept; @@ -1460,7 +1460,7 @@ \tcode{error_condition(static_cast(e), generic_category())}. \end{itemdescr} -\rSec2[syserr.compare]{Comparison functions} +\rSec2[syserr.compare]{Comparison operator functions} \indexlibrarymember{operator==}{error_code}% \begin{itemdecl} diff --git a/source/intro.tex b/source/intro.tex index e2d9b1ad14..4f21bc1fd2 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -216,15 +216,6 @@ iostream, and regular expression class templates. \end{defnote} -\definition{comparison function}{defns.comparison} -\defncontext{library} -\indexdefn{function!comparison}% -operator function\iref{over.oper} for any of the -equality\iref{expr.eq}, -relational\iref{expr.rel}, or -three-way comparison\iref{expr.spaceship} -operators - \definition{component}{defns.component} \defncontext{library} \indexdefn{component}% diff --git a/source/lib-intro.tex b/source/lib-intro.tex index cce25a2bea..a23f6cbd2f 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -269,13 +269,13 @@ \pnum Descriptions of class member functions follow the order (as appropriate):\footnote{To save space, items that do not apply to a class are omitted. -For example, if a class does not specify any comparison functions, there -will be no ``Comparison functions'' subclause.} +For example, if a class does not specify any comparison operator functions, there +will be no ``Comparison operator functions'' subclause.} \begin{itemize} \item constructor(s) and destructor \item copying, moving \& assignment functions -\item comparison functions +\item comparison operator functions \item modifier functions \item observer functions \item operators and other non-member functions @@ -1990,7 +1990,7 @@ \tcode{X::const_void_pointer} types shall meet the \oldconcept{Nullable\-Pointer} requirements (\tref{cpp17.nullablepointer}). No constructor, -comparison function, copy operation, move operation, or swap operation on +comparison operator function, copy operation, move operation, or swap operation on these pointer types shall exit via an exception. \tcode{X::pointer} and \tcode{X::const_pointer} shall also meet the requirements for a \oldconcept{RandomAccessIterator}\iref{random.access.iterators} and diff --git a/source/regex.tex b/source/regex.tex index bb325661b0..a1eed19a51 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -2021,7 +2021,7 @@ move assignment, and operations defined for const-qualified sequence containers are supported and -that the semantics of comparison functions are different from those +that the semantics of the comparison operator functions are different from those required for a container. \pnum diff --git a/source/strings.tex b/source/strings.tex index 13fe5863c7..2780e3b1e3 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -3399,7 +3399,7 @@ \end{codeblock} \end{itemdescr} -\rSec3[string.cmp]{Non-member comparison functions} +\rSec3[string.cmp]{Non-member comparison operator functions} \begin{itemdecl} template constexpr bool diff --git a/source/utilities.tex b/source/utilities.tex index 0b66f500d9..80e17e1218 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -2290,7 +2290,7 @@ The above definition does not require \tcode{t$_{\mathrm{tail}}$} (or \tcode{u$_{\mathrm{tail}}$}) to be constructed. It may not even be possible, as \tcode{t} and \tcode{u} are not required to be copy -constructible. Also, all comparison functions are short circuited; +constructible. Also, all comparison operator functions are short circuited; they do not perform element accesses beyond what is required to determine the result of the comparison. \end{note} @@ -10777,7 +10777,7 @@ \pnum \begin{note} -Defining a comparison function allows \tcode{shared_ptr} objects +Defining a comparison operator function allows \tcode{shared_ptr} objects to be used as keys in associative containers. \end{note} \end{itemdescr} @@ -15086,7 +15086,7 @@ template function(F) -> function<@\seebelow@>; - // \ref{func.wrap.func.nullptr}, null pointer comparison functions + // \ref{func.wrap.func.nullptr}, null pointer comparison operator functions template bool operator==(const function&, nullptr_t) noexcept; @@ -15435,7 +15435,7 @@ a pointer to the stored function target; otherwise a null pointer. \end{itemdescr} -\rSec4[func.wrap.func.nullptr]{Null pointer comparison functions} +\rSec4[func.wrap.func.nullptr]{Null pointer comparison operator functions} \indexlibrarymember{operator==}{function}% \begin{itemdecl} From 12c2b1347860549cbfc49b98ed8e59cab436dcc3 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 21:40:58 +0200 Subject: [PATCH 092/250] [defns.projection] Fix context to 'library'. --- source/intro.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/intro.tex b/source/intro.tex index 4f21bc1fd2..e9f0b0fde6 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -456,8 +456,9 @@ \definition{projection}{defns.projection} \indexdefn{projection}% -\defncontext{function object argument} transformation that -an algorithm applies before inspecting the values of elements +\defncontext{library} +transformation that an algorithm applies +before inspecting the values of elements \begin{example} \begin{codeblock} From 2782a8013fb0235e21c92bed6563c0cf641a863b Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 16:35:56 +0200 Subject: [PATCH 093/250] [intro.refs] Fix clause reference to ISO/IEC 9899. --- source/intro.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/intro.tex b/source/intro.tex index e9f0b0fde6..6875f8695e 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -73,7 +73,7 @@ \end{itemize} \pnum -The library described in Clause 7 of ISO/IEC 9899:2018 +The library described in ISO/IEC 9899:2018, Clause 7, is hereinafter called the \defnx{C standard library}{C!standard library}.% \footnote{With the qualifications noted in \ref{\firstlibchapter} From e741acc74d861c6afa490ebebee05acd29163a43 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 17:00:14 +0200 Subject: [PATCH 094/250] [intro.refs] Update from ISO/IEC 10646-1:1993 to ISO/IEC 10646:2003. This is the most recent version of ISO/IEC 10646 that specifies the encoding form UCS-2. Partially addresses ISO/CS 016 (C++20 DIS) --- source/future.tex | 2 +- source/intro.tex | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/source/future.tex b/source/future.tex index 44f72dabb9..5d6aae54a3 100644 --- a/source/future.tex +++ b/source/future.tex @@ -2143,7 +2143,7 @@ \pnum The encoding forms UTF-8, UTF-16, and UTF-32 are specified in ISO/IEC 10646. -The encoding form UCS-2 is specified in ISO/IEC 10646-1:1993. +The encoding form UCS-2 is specified in ISO/IEC 10646:2003. \rSec1[depr.conversions]{Deprecated convenience conversion interfaces} diff --git a/source/intro.tex b/source/intro.tex index 6875f8695e..67f5819a19 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -53,9 +53,8 @@ does not constitute an endorsement by ISO or IEC of this product.})} \item ISO/IEC 10646, \doccite{Information technology --- Universal Coded Character Set (UCS)} -\item ISO/IEC 10646-1:1993, \doccite{Information technology --- -Universal Multiple-Octet Coded Character Set (UCS) --- Part 1: -Architecture and Basic Multilingual Plane} +\item ISO/IEC 10646:2003, \doccite{Information technology --- +Universal Multiple-Octet Coded Character Set (UCS)} \item ISO/IEC/IEEE 60559:2011, \doccite{Information technology --- Microprocessor Systems --- Floating-Point arithmetic} \item ISO 80000-2:2009, \doccite{Quantities and units --- @@ -91,7 +90,7 @@ \pnum \begin{note} -References to ISO/IEC 10646-1:1993 are used only +References to ISO/IEC 10646:2003 are used only to support deprecated features\iref{depr.locale.stdcvt}. \end{note} From 11321e1ead6d1d4a6a0df798c8bdb4c3fe20df4d Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 21:19:27 +0200 Subject: [PATCH 095/250] [intro.defs] Refer to undated ISO/IEC 2382 for the terminology. Partially addresses ISO/CS 016 (C++20 DIS) --- source/intro.tex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/intro.tex b/source/intro.tex index 67f5819a19..f13c09d965 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -40,8 +40,7 @@ does not constitute an endorsement by ISO or IEC of this product.} Language Specification}, Standard Ecma-262, third edition, 1999. -\item ISO/IEC 2382 (all parts), \doccite{Information technology --- -Vocabulary} +\item ISO/IEC 2382, \doccite{Information technology --- Vocabulary} \item ISO 8601:2004, \doccite{Data elements and interchange formats --- Information interchange --- Representation of dates and times} \item ISO/IEC 9899:2018, \doccite{Programming languages --- C} @@ -100,7 +99,7 @@ \indextext{definitions|(}% For the purposes of this document, the terms and definitions -given in ISO/IEC 2382-1:1993, +given in ISO/IEC 2382, the terms, definitions, and symbols given in ISO 80000-2:2009, and the following apply. From 8377c25e297f0f547f847ec9e75b8171f0920954 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 10 Sep 2020 19:12:52 -0700 Subject: [PATCH 096/250] [ranges.syn] Update iota_view constraints ... to agree with [range.iota.view] as modified by LWG3292. --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index af0467a06c..da54402a26 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -162,7 +162,7 @@ // \ref{range.iota}, iota view template<@\libconcept{weakly_incrementable}@ W, @\libconcept{semiregular}@ Bound = unreachable_sentinel_t> - requires @\exposconcept{weakly-equality-comparable-with}@ + requires @\exposconcept{weakly-equality-comparable-with}@ && semiregular class iota_view; template From 696d5a1cf2efe19f8643d072246f741aa04e490c Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 22:23:52 +0200 Subject: [PATCH 097/250] [intro.refs,time.format] Fix normative references. ISO/IEC/IEEE 60559:2011 and UAX#29 are not normative requirements of C++ and thus were moved to the bibliography. For ISO 8601:2004, highlighted its normative impact on time formatting. Move the footnote about the Unicode trademark to the new first mention of the term in [intro.memory]. Fixes ISO/CS 002 (C++20 DIS) --- source/back.tex | 10 ++++++++++ source/basic.tex | 6 +++++- source/intro.tex | 11 ----------- source/time.tex | 3 ++- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/source/back.tex b/source/back.tex index c474d117b2..47de6a01f3 100644 --- a/source/back.tex +++ b/source/back.tex @@ -26,6 +26,16 @@ \chapter{Bibliography} \item ISO 4217:2015, \doccite{Codes for the representation of currencies} +\item + ISO/IEC/IEEE 60559:2011, \doccite{Information technology --- + Microprocessor Systems --- Floating-Point arithmetic} +\item + %%% Format for the following entry is based on that specified at + %%% http://www.iec.ch/standardsdev/resources/draftingpublications/directives/principles/referencing.htm + The Unicode Consortium. Unicode Standard Annex, UAX \#29, + \doccite{Unicode Text Segmentation} [online]. + Edited by Mark Davis. Revision 35; issued for Unicode 12.0.0. 2019-02-15 [viewed 2020-02-23]. + Available at \url{http://www.unicode.org/reports/tr29/tr29-35.html} \end{itemize} The arithmetic specification described in ISO/IEC 10967-1:2012 is diff --git a/source/basic.tex b/source/basic.tex index 6cd88beec6..be7b7517a0 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -3056,7 +3056,11 @@ A byte is at least large enough to contain any member of the basic \indextext{character set!basic execution}% execution character set\iref{lex.charset} -and the eight-bit code units of the Unicode UTF-8 encoding form +and the eight-bit code units of the Unicode% + \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.} +UTF-8 encoding form and is composed of a contiguous sequence of bits,\footnote{The number of bits in a byte is reported by the macro \tcode{CHAR_BIT} in the header \libheaderref{climits}.} diff --git a/source/intro.tex b/source/intro.tex index f13c09d965..a773983f3d 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -54,20 +54,9 @@ Universal Coded Character Set (UCS)} \item ISO/IEC 10646:2003, \doccite{Information technology --- Universal Multiple-Octet Coded Character Set (UCS)} -\item ISO/IEC/IEEE 60559:2011, \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} -%%% Format for the following entry is based on that specified at -%%% http://www.iec.ch/standardsdev/resources/draftingpublications/directives/principles/referencing.htm -\item The Unicode Consortium. Unicode% -\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.} -Standard Annex, UAX \#29, \doccite{Unicode Text Segmentation} [online]. -Edited by Mark Davis. Revision 35; issued for Unicode 12.0.0. 2019-02-15 [viewed 2020-02-23]. -Available at \url{http://www.unicode.org/reports/tr29/tr29-35.html} \end{itemize} \pnum diff --git a/source/time.tex b/source/time.tex index efe49c8ea9..32ac1fa8a0 100644 --- a/source/time.tex +++ b/source/time.tex @@ -10490,7 +10490,8 @@ \pnum Each conversion specifier \fmtgrammarterm{conversion-spec} is replaced by appropriate characters -as described in \tref{time.format.spec}. +as described in \tref{time.format.spec}; +the formats specified in ISO 8601:2004 shall be used where so described. Some of the conversion specifiers depend on the locale that is passed to the formatting function if the latter takes one, From 77585b7d18bbc758def6bfc6c66b027f31586558 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 22:41:34 +0200 Subject: [PATCH 098/250] [intro.compliance.general] Properly reference normative clauses including Annex D. Partially addresses ISO/CS 016 (C++20 DIS) --- source/intro.tex | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/source/intro.tex b/source/intro.tex index a773983f3d..296b02801f 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -715,8 +715,9 @@ execution of programs. Such requirements have the following meaning: \begin{itemize} \item -If a program contains no violations of the rules in this -document, a conforming implementation shall, +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, accept and correctly execute\footnote{``Correct execution'' can include undefined behavior, depending on the data being processed; see \ref{intro.defs} and~\ref{intro.execution}.} that program. From 06cf0cac951779f4e7c748437e7ceea43f73da46 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 10 Sep 2020 23:41:07 +0200 Subject: [PATCH 099/250] [intro.defs] Remove cross-references from the Terms and Definitions Definitions of terms cannot refer to subclauses in the main body of the standard. Partially addresses ISO/CS 016 (C++20 DIS) --- source/intro.tex | 72 ++++++++++++++++++++++++------------------------ 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/source/intro.tex b/source/intro.tex index 296b02801f..6839e0ae34 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -110,12 +110,13 @@ \indexdefn{access}% \definition{access}{defns.access} \defncontext{execution-time action} -read\iref{conv.lval} or -modify (\ref{expr.ass}, \ref{expr.post.incr}, \ref{expr.pre.incr}) -the value of an object +read or modify the value of an object \begin{defnote} Only objects of scalar type can be accessed. +Reads of scalar objects are described in \ref{conv.lval} and +modifications of scalar objects are describred in +\ref{expr.ass}, \ref{expr.post.incr}, and \ref{expr.pre.incr}. Attempts to read or modify an object of class type typically invoke a constructor\iref{class.ctor} or assignment operator\iref{class.copy.assign}; @@ -126,29 +127,29 @@ \definition{arbitrary-positional stream}{defns.arbitrary.stream} \defncontext{library} \indexdefn{stream!arbitrary-positional}% -stream (described in \ref{input.output}) that can seek to any integral position within +stream that can seek to any integral position within the length of the stream \begin{defnote} -Every arbitrary-positional stream is also a repositional stream. +Every arbitrary-positional stream is also a repositional stream\iref{defns.repositional.stream}. \end{defnote} \indexdefn{argument}% \indexdefn{argument!function call expression} \definition{argument}{defns.argument} \defncontext{function call expression} expression in the -comma-separated list bounded by the parentheses\iref{expr.call} +comma-separated list bounded by the parentheses \indexdefn{argument}% \indexdefn{argument!function-like macro}% \definition{argument}{defns.argument.macro} \defncontext{function-like macro} sequence of preprocessing tokens in the -comma-separated list bounded by the parentheses\iref{cpp.replace} +comma-separated list bounded by the parentheses \indexdefn{argument}% \indexdefn{argument!throw expression}% \definition{argument}{defns.argument.throw} -\defncontext{throw expression} operand of \tcode{throw}\iref{expr.throw} +\defncontext{throw expression} operand of \keyword{throw} \indexdefn{argument}% \indexdefn{argument!template instantiation}% @@ -157,7 +158,7 @@ \grammarterm{constant-expression}, \grammarterm{type-id}, or \grammarterm{id-expression} in the comma-separated -list bounded by the angle brackets\iref{temp.arg} +list bounded by the angle brackets \indexdefn{block (execution)}% \definition{block}{defns.block} @@ -169,7 +170,7 @@ \indexdefn{block (statement)}% \definition{block}{defns.block.stmt} \defncontext{statement} -compound statement\iref{stmt.block} +compound statement \definition{character}{defns.character} \indexdefn{character}% @@ -186,7 +187,7 @@ \tcode{char32_t}, and \tcode{wchar_t} -objects, +objects\iref{basic.fundamental}, but any value that can be represented by a type that provides the definitions specified in \ref{strings}, \ref{localization}, \ref{input.output}, or~\ref{re}. @@ -232,8 +233,8 @@ \indexdefn{constant subexpression}% expression whose evaluation as subexpression of a \grammarterm{conditional-expression} -\tcode{CE}\iref{expr.cond} would not prevent \tcode{CE} -from being a core constant expression\iref{expr.const} +\tcode{CE} would not prevent \tcode{CE} +from being a core constant expression \definition{deadlock}{defns.deadlock} \defncontext{library} @@ -255,12 +256,12 @@ \definition{direct-non-list-initialization}{defns.direct-non-list-init} \indexdefn{direct-non-list-initialization}% -direct-initialization\iref{dcl.init} -that is not list-initialization\iref{dcl.init.list} +direct-initialization +that is not list-initialization \indexdefn{type!dynamic}% \definition{dynamic type}{defns.dynamic.type} -\defncontext{glvalue} type of the most derived object\iref{intro.object} to which the +\defncontext{glvalue} type of the most derived object to which the glvalue refers \begin{example} @@ -280,7 +281,7 @@ \indexdefn{expression-equivalent}% expressions that all have the same effects, either -are all potentially-throwing\iref{except.spec} or +are all potentially-throwing or are all not potentially-throwing, and either @@ -334,8 +335,8 @@ \definition{iostream class templates}{defns.iostream.templates} \defncontext{library} -templates, defined in \ref{input.output}, -that take two template arguments +templates that are declared in header \libheader{iosfwd} and +take two template arguments \begin{defnote} The arguments are named \tcode{charT} and \tcode{traits}. @@ -354,7 +355,7 @@ \definition{modifier function}{defns.modifier} \defncontext{library} \indexdefn{function!modifier}% -class member function\iref{class.mfct} other than a constructor, +class member function other than a constructor, assignment operator, or destructor that alters the state of an object of the class @@ -391,7 +392,7 @@ \definition{observer function}{defns.observer} \defncontext{library} \indexdefn{function!observer}% -class member function\iref{class.mfct} that accesses the state of an object of the class +class member function that accesses the state of an object of the class but does not alter that state \begin{defnote} @@ -484,8 +485,7 @@ \definition{repositional stream}{defns.repositional.stream} \defncontext{library} \indexdefn{stream!repositional}% -stream (described in \ref{input.output}) that can seek to a position that was -previously encountered +stream that can seek to a position that was previously encountered \definition{required behavior}{defns.required.behavior} \defncontext{library} @@ -515,7 +515,7 @@ \definition{signature}{defns.signature} \defncontext{function} name, -parameter-type-list\iref{dcl.fct}, +parameter-type-list, and enclosing namespace (if any) \begin{defnote} @@ -527,32 +527,32 @@ \definition{signature}{defns.signature.friend} \defncontext{non-template friend function with trailing \grammarterm{requires-clause}} name, -parameter-type-list\iref{dcl.fct}, +parameter-type-list, enclosing class, and -trailing \grammarterm{requires-clause}\iref{dcl.decl} +trailing \grammarterm{requires-clause} \indexdefn{signature}% \definition{signature}{defns.signature.templ} \defncontext{function template} name, -parameter-type-list\iref{dcl.fct}, +parameter-type-list, enclosing namespace (if any), return type, \grammarterm{template-head}, and -trailing \grammarterm{requires-clause}\iref{dcl.decl} (if any) +trailing \grammarterm{requires-clause} (if any) \indexdefn{signature}% \definition{signature}{defns.signature.templ.friend} \defncontext{friend function template with constraint involving enclosing template parameters} name, -parameter-type-list\iref{dcl.fct}, +parameter-type-list, return type, enclosing class, \grammarterm{template-head}, and -trailing \grammarterm{requires-clause}\iref{dcl.decl} (if any) +trailing \grammarterm{requires-clause} (if any) \indexdefn{signature}% \definition{signature}{defns.signature.spec} @@ -563,25 +563,25 @@ \definition{signature}{defns.signature.member} \defncontext{class member function} name, -parameter-type-list\iref{dcl.fct}, +parameter-type-list, class of which the function is a member, \cv-qualifiers (if any), \grammarterm{ref-qualifier} (if any), and -trailing \grammarterm{requires-clause}\iref{dcl.decl} (if any) +trailing \grammarterm{requires-clause} (if any) \indexdefn{signature}% \definition{signature}{defns.signature.member.templ} \defncontext{class member function template} name, -parameter-type-list\iref{dcl.fct}, +parameter-type-list, class of which the function is a member, \cv-qualifiers (if any), \grammarterm{ref-qualifier} (if any), return type (if any), \grammarterm{template-head}, and -trailing \grammarterm{requires-clause}\iref{dcl.decl} (if any) +trailing \grammarterm{requires-clause} (if any) \indexdefn{signature}% \definition{signature}{defns.signature.member.spec} @@ -601,7 +601,7 @@ \indexdefn{type!static}% \definition{static type}{defns.static.type} -type of an expression\iref{basic.types} resulting from +type of an expression resulting from analysis of the program without considering execution semantics \begin{defnote} @@ -667,7 +667,7 @@ \indexdefn{program!well-formed}% \definition{well-formed program}{defns.well.formed} \Cpp{} program constructed according to the syntax rules, diagnosable -semantic rules, and the one-definition rule\iref{basic.def.odr}% +semantic rules, and the one-definition rule% \indextext{definitions|)} \rSec0[intro]{General principles} From 5e54de278cb1b68bb0191d505f2dfe9bc4ed88e9 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 15 Sep 2020 14:42:23 -0700 Subject: [PATCH 100/250] [time.format] Date reference to ISO 8601 to match the normative reference. --- source/time.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/time.tex b/source/time.tex index 32ac1fa8a0..dedbbc87ab 100644 --- a/source/time.tex +++ b/source/time.tex @@ -10748,7 +10748,7 @@ the locale's alternative full year representation. \\ \rowsep \tcode{\%z} & -The offset from UTC in the ISO 8601 format. +The offset from UTC in the ISO 8601:2004 format. 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 737d98374d5455bd3863fbd11f1b1582e2308f15 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 15 Sep 2020 15:03:47 -0700 Subject: [PATCH 101/250] [depr] Don't claim this Annex is a Clause. --- source/future.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/future.tex b/source/future.tex index 5d6aae54a3..9acb269baf 100644 --- a/source/future.tex +++ b/source/future.tex @@ -6,7 +6,7 @@ \rSec1[depr.general]{General} \pnum -This Clause describes features of the \Cpp{} Standard that are specified for compatibility with +This Annex describes features of the \Cpp{} Standard that are specified for compatibility with existing implementations. \pnum From b4a9dd408e175501c8ad3d648ba1c512ebdead83 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 15 Sep 2020 15:18:05 -0700 Subject: [PATCH 102/250] [xrefs] Don't claim this appendix is an annex. ISO has a special definition for "Annex" that this doesn't conform to. --- source/back.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/back.tex b/source/back.tex index 47de6a01f3..b7d5a27eef 100644 --- a/source/back.tex +++ b/source/back.tex @@ -48,7 +48,7 @@ \chapter{Bibliography} \clearpage \renewcommand{\glossaryname}{Cross references} -\renewcommand{\preglossaryhook}{This annex lists each clause or subclause label and the +\renewcommand{\preglossaryhook}{Each clause and subclause label is listed below along with the corresponding clause or subclause number and page number, in alphabetical order by label.\\} \twocolglossary \renewcommand{\leftmark}{\glossaryname} From 5bf0ea7b54ec44c24f30ddaf1b14e2ac8b12522f Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 10 Sep 2020 13:50:34 -0700 Subject: [PATCH 103/250] [everywhere] Number notes and examples, make them one point smaller, and move them to (un-numbered) paragraphs of their own. Partially addresses ISO/CS 016 (C++20 DIS). --- source/algorithms.tex | 6 +++--- source/containers.tex | 10 +++++++--- source/expressions.tex | 2 +- source/future.tex | 6 +++--- source/intro.tex | 7 ------- source/iostreams.tex | 5 +++-- source/layout.tex | 9 +++++++-- source/locales.tex | 4 +++- source/macros.tex | 17 +++++++++++++---- source/ranges.tex | 6 +++--- source/time.tex | 2 +- source/utilities.tex | 9 +++++---- tools/check.sh | 4 ++-- 13 files changed, 51 insertions(+), 36 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 45c63a0cda..aaa81b5a5f 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -4400,7 +4400,7 @@ \begin{note} For the overload with an \tcode{ExecutionPolicy}, there may be a performance cost -if \tcode{iterator_traits::value_type} +if \tcode{iterator_traits::value_type} is not \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}). \end{note} @@ -9737,7 +9737,7 @@ \pnum \begin{note} The difference between \tcode{transform_exclusive_scan} and -\tcode{transform_inclusive_scan} is that \tcode{transform_exclusive_scan} +\tcode{transform_inclusive_scan} is that \tcode{trans\-form\-_\-exclusive_scan} excludes the $i^\text{th}$ input element from the $i^\text{th}$ sum. If \tcode{binary_op} is not mathematically associative, the behavior of \tcode{transform_exclusive_scan} may be nondeterministic. @@ -9841,7 +9841,7 @@ \pnum \begin{note} The difference between \tcode{transform_exclusive_scan} and -\tcode{transform_inclusive_scan} is that \tcode{transform_inclusive_scan} +\tcode{transform_inclusive_scan} is that \tcode{trans\-form\-_\-inclusive_scan} includes the $i^\text{th}$ input element in the $i^\text{th}$ sum. If \tcode{binary_op} is not mathematically associative, the behavior of \tcode{transform_inclusive_scan} may be nondeterministic. diff --git a/source/containers.tex b/source/containers.tex index bccb928032..74d65dcc9c 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -336,9 +336,13 @@ or until the allocator is replaced. The allocator may be replaced only via assignment or \tcode{swap()}. Allocator replacement is performed by copy assignment, move assignment, or swapping of the allocator only if -\tcode{allocator_traits::propagate_on_container_copy_assignment::value}, -\tcode{allocator_traits::propagate_on_container_move_assignment::value}, -or \tcode{alloca\-tor_traits::propagate_on_container_swap::value} is \tcode{true} +\begin{itemize} +\item \tcode{allocator_traits::propagate_on_container_copy_assignment::value}, +\item \tcode{allocator_traits::propagate_on_container_move_assignment::value}, +or +\item \tcode{allocator_traits::propagate_on_container_swap::value} +\end{itemize} +is \tcode{true} within the implementation of the corresponding container operation. In all container types defined in this Clause, the member \tcode{get_allocator()} returns a copy of the allocator used to construct the container or, if that allocator diff --git a/source/expressions.tex b/source/expressions.tex index d6d751c19b..608aa54020 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -4549,7 +4549,7 @@ fundamental types other than \tcode{char}, \tcode{signed char}, and \tcode{unsigned char}}. \begin{note} -In particular, \tcode{sizeof(bool)}, \tcode{sizeof(char16_t)}, +In particular, the values of \tcode{sizeof(bool)}, \tcode{sizeof(char16_t)}, \tcode{sizeof(char32_t)}, and \tcode{sizeof(wchar_t)} are implementation-defined.\footnote{\tcode{sizeof(bool)} is not required to be \tcode{1}.} \end{note} diff --git a/source/future.tex b/source/future.tex index 9acb269baf..f1aa0ec0a6 100644 --- a/source/future.tex +++ b/source/future.tex @@ -2665,9 +2665,9 @@ \begin{note} The example above is representative of a historical use of \tcode{filesystem::u8path}. -Passing a \tcode{std::u8string} to \tcode{path}'s constructor is preferred -for an indication of UTF-8 encoding more consistent with -\tcode{path}'s handling of other encodings. +To indicate a UTF-8 encoding, +passing a \tcode{std::u8string} to \tcode{path}'s constructor is preferred +as it is consistent with \tcode{path}'s handling of other encodings. \end{note} \end{itemdescr} diff --git a/source/intro.tex b/source/intro.tex index 6839e0ae34..401e767b09 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -913,13 +913,6 @@ published description, and explains in detail the differences between \Cpp{} and C\@. Certain features of \Cpp{} exist solely for compatibility purposes; \ref{depr} describes those features. - -\pnum -Throughout this document, each example is introduced by -``\noteintro{Example}'' and terminated by ``\noteoutro{example}''. Each note is -introduced by ``\noteintro{Note}'' or ``\noteintro{Note $n$ to entry}'' and -terminated by ``\noteoutro{note}''. Examples -and notes may be nested.% \indextext{standard!structure of|)} \rSec1[syntax]{Syntax notation} diff --git a/source/iostreams.tex b/source/iostreams.tex index a26f795549..2acca9b8f0 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -14883,8 +14883,9 @@ \pnum \begin{note} -To iterate over the current directory, use \tcode{recursive_directory_iterator(".")} - rather than \tcode{recursive_directory_iterator("")}. +Use \tcode{recursive_directory_iterator(".")} +rather than \tcode{recursive_directory_iterator("")} +to iterate over the current directory. \end{note} \pnum diff --git a/source/layout.tex b/source/layout.tex index fdbaeb806b..33e9e354a8 100644 --- a/source/layout.tex +++ b/source/layout.tex @@ -65,8 +65,13 @@ }}} \makeatother -\def\pnum -{\parabullnum{Paras}{0pt}} +% Register our intent to number the next paragraph. Don't actually number it +% yet, because we might have a paragraph break before we see its contents (for +% example, if the paragraph begins with a note or example). +\def\pnum{% +\global\def\maybeaddpnum{\global\def\maybeaddpnum{}\parabullnum{Paras}{0pt}}% +\everypar=\expandafter{\the\everypar\maybeaddpnum}% +} % Leave more room for section numbers in TOC \cftsetindents{section}{1.5em}{3.0em} diff --git a/source/locales.tex b/source/locales.tex index b17f465b53..659313642e 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -228,7 +228,9 @@ \begin{itemize} \item A member operator template -\tcode{operator()(const basic_string\&, const basic_string<\brk{}C, T, A>\&)} +\begin{codeblock} +operator()(const basic_string&, const basic_string&) +\end{codeblock} is provided so that a locale may be used as a predicate argument to the standard collections, to collate strings. \item diff --git a/source/macros.tex b/source/macros.tex index a82acd7c37..4b95facd52 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -91,7 +91,8 @@ \or\let\s=\paragraph\let\l=\label \or\let\s=\subparagraph\let\l=\label \fi% -\s[#3]{#3\hfill[#2]}\l{#2}\addxref{#2}} +\s[#3]{#3\hfill[#2]}\l{#2}\addxref{#2}% +\setcounter{note}{0}\setcounter{example}{0}} % A convenience feature (mostly for the convenience of the Project % Editor, to make it easy to move around large blocks of text): @@ -265,10 +266,16 @@ \newcommand{\leftshift}[1]{\ensuremath{\mathbin{\mathsf{lshift}_{#1}}}} %% Notes and examples +\newcounter{note} +\newcounter{example} \newcommand{\noteintro}[1]{[\textit{#1}:\space} \newcommand{\noteoutro}[1]{\textit{\,---\,end #1}\kern.5pt]} -\newenvironment{note}[1][Note]{\noteintro{#1}}{\noteoutro{note}\space} -\newenvironment{example}[1][Example]{\noteintro{#1}}{\noteoutro{example}\space} +\newenvironment{note}[1][Note] +{\par\small\addtocounter{note}{1}\noteintro{#1 \thenote}} +{\noteoutro{note}\par} +\newenvironment{example}[1][Example] +{\par\small\addtocounter{example}{1}\noteintro{#1 \theexample}} +{\noteoutro{example}\par} %% Library function descriptions \newcommand{\Fundescx}[1]{\textit{#1}} @@ -634,4 +641,6 @@ \let\addcontentsline\oldcontentsline% } \newcommand{\defncontext}[1]{\textlangle#1\textrangle} -\newenvironment{defnote}{\addtocounter{termnote}{1}\noteintro{Note \thetermnote{} to entry}}{\noteoutro{note}\space} +\newenvironment{defnote} +{\small\addtocounter{termnote}{1}\noteintro{Note \thetermnote{} to entry}} +{\noteoutro{note}\space} diff --git a/source/ranges.tex b/source/ranges.tex index da54402a26..2de5769fff 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -516,7 +516,7 @@ \pnum \begin{note} Whenever \tcode{ranges::cend(E)} is a valid expression, -the types \tcode{S} and \tcode{I} of +the types \tcode{S} and \tcode{I} of the expressions \tcode{ranges::cend(E)} and \tcode{ranges::cbegin(E)} model \tcode{\libconcept{sentinel_for}}. \end{note} @@ -652,7 +652,7 @@ \pnum \begin{note} Whenever \tcode{ranges::rend(E)} is a valid expression, -the types \tcode{S} and \tcode{I} of +the types \tcode{S} and \tcode{I} of the expressions \tcode{ranges::rend(E)} and \tcode{ranges::rbegin(E)} model \tcode{\libconcept{sentinel_for}}. \end{note} @@ -690,7 +690,7 @@ \pnum \begin{note} Whenever \tcode{ranges::crend(E)} is a valid expression, -the types \tcode{S} and \tcode{I} of +the types \tcode{S} and \tcode{I} of the expressions \tcode{ranges::crend(E)} and \tcode{ranges::crbegin(E)} model \tcode{\libconcept{sentinel_for}}. \end{note} diff --git a/source/time.tex b/source/time.tex index dedbbc87ab..5079a699f1 100644 --- a/source/time.tex +++ b/source/time.tex @@ -3349,7 +3349,7 @@ \begin{note} The type that \tcode{file_clock} denotes may be in a different namespace than \tcode{std::chrono}, -such as \tcode{std::filesystem}. +such as \tcode{std::file\-sys\-tem}. \end{note} \rSec3[time.clock.file.members]{Member functions} diff --git a/source/utilities.tex b/source/utilities.tex index 80e17e1218..87a35f3dcf 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -11303,10 +11303,11 @@ \begin{itemize} \item \tcode{operator()} defines a strict weak ordering as defined in~\ref{alg.sorting}; -\item under the equivalence relation defined by \tcode{operator()}, -\tcode{!operator()(a, b) \&\& !operator()(b, a)}, two \tcode{shared_ptr} or -\tcode{weak_ptr} instances are equivalent if and only if they share ownership or are -both empty. +\item +two \tcode{shared_ptr} or \tcode{weak_ptr} instances are equivalent +under the equivalence relation defined by \tcode{operator()}, +\tcode{!operator()(a, b) \&\& !operator()(b, a)}, +if and only if they share ownership or are both empty. \end{itemize} \end{note} diff --git a/tools/check.sh b/tools/check.sh index 7300a20910..cd4e161821 100755 --- a/tools/check.sh +++ b/tools/check.sh @@ -5,9 +5,9 @@ texfiles=$(ls *.tex | grep -v macros.tex | grep -v layout.tex | grep -v tables.t texlibdesc="support.tex concepts.tex diagnostics.tex utilities.tex strings.tex containers.tex iterators.tex ranges.tex algorithms.tex numerics.tex time.tex locales.tex iostreams.tex regex.tex atomics.tex threads.tex" texlib="lib-intro.tex $texlibdesc" -# Discover "Overfull \hbox" and "Reference ... undefined" messages from LaTeX. +# Discover "Overfull \[hv]box" and "Reference ... undefined" messages from LaTeX. sed -n '/\.tex/{s/^.*\/\([-a-z0-9]\+\.tex\).*$/\1/;h}; -/Overfull [\\]hbox\|LaTeX Warning..Reference/{x;p;x;p}' std.log | +/Overfull [\\][hv]box\|LaTeX Warning..Reference/{x;p;x;p}' std.log | sed '/^.\+\.tex$/{N;s/\n/:/}' | grep . && exit 1 # Find non-ASCII (Unicode) characters in the source From 60e2651bf4ad8c60c7b6e38c32d1f48bd18d1996 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 10 Sep 2020 19:33:05 -0700 Subject: [PATCH 104/250] [lex.string] Fix excessive whitespace stretching by allowing a linebreak in the middle of the interval "[E000, 10FFFF]". --- source/lex.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/lex.tex b/source/lex.tex index 683d645bbe..f2afd5bf66 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -1786,7 +1786,7 @@ \begin{note} Any \grammarterm{universal-character-name}{s} are required to correspond to a code point in the range -$[0, \mathrm{D800})$ or $[\mathrm{E000}, \mathrm{10FFFF}]$ (hexadecimal)\iref{lex.charset}. +$[0,$ $\mathrm{D800})$ or $[\mathrm{E000},$ $\mathrm{10FFFF}]$ (hexadecimal)\iref{lex.charset}. \end{note} The size of a narrow string literal is the total number of escape sequences and other characters, plus at least From 63ded2bc38c61d6b5f77f4780f4c90dfc8f38af1 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 15 Sep 2020 14:13:12 -0700 Subject: [PATCH 105/250] [iterator.concepts] Stop using LongTable for tables that aren't long. Fixes an overfull hbox and reduces the risk of tables running off the bottom of the page. --- source/iterators.tex | 43 +++++++++++-------------------------------- source/tables.tex | 9 +++++---- 2 files changed, 16 insertions(+), 36 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index 72e34e2f0f..25eb383c69 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1901,18 +1901,12 @@ the indicated semantics. \end{itemize} -\begin{libreqtab4b} +\begin{libreqtab4b}[floattable] {\oldconcept{Iterator} requirements} {iterator} -\\ \topline -\lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ - & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep -\endfirsthead -\continuedcaption\\ -\hline +\topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep -\endhead \tcode{*r} & unspecified & @@ -2043,18 +2037,13 @@ and the expressions in \tref{outputiterator} are valid and have the indicated semantics. -\begin{libreqtab4b} +\begin{libreqtab4b}[floattable] {\oldconcept{OutputIterator} requirements (in addition to \oldconcept{Iterator})} {outputiterator} -\\ \topline -\lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ - & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep -\endfirsthead -\continuedcaption\\ -\hline +\topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep -\endhead + \tcode{*r = o} & result is not used & & @@ -2145,18 +2134,13 @@ allows the use of multi-pass one-directional algorithms with forward iterators. \end{note} -\begin{libreqtab4b} +\begin{libreqtab4b}[floattable] {\oldconcept{ForwardIterator} requirements (in addition to \oldconcept{InputIterator})} {forwarditerator} -\\ \topline -\lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ - & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep -\endfirsthead -\continuedcaption\\ -\hline +\topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep -\endhead + \tcode{r++} & convertible to \tcode{const X\&} & \tcode{\{ X tmp = r;}\br @@ -2186,18 +2170,13 @@ in addition to meeting the \oldconcept{ForwardIterator} requirements, the following expressions are valid as shown in \tref{bidirectionaliterator}. -\begin{libreqtab4b} +\begin{libreqtab4b}[floattable] {\oldconcept{BidirectionalIterator} requirements (in addition to \oldconcept{ForwardIterator})} {bidirectionaliterator} -\\ \topline -\lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ - & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep -\endfirsthead -\continuedcaption\\ -\hline +\topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ & & \chdr{semantics} & \rhdr{pre-/post-condition} \\ \capsep -\endhead + \tcode{\dcr r} & \tcode{X\&} & & diff --git a/source/tables.tex b/source/tables.tex index d97a35d790..b5c14fa689 100644 --- a/source/tables.tex +++ b/source/tables.tex @@ -301,14 +301,15 @@ \end{LongTable} } -\newenvironment{libreqtab4b}[2] +\newenvironment{libreqtab4b}[3][LongTable] { - \begin{LongTable} - {#1}{#2} + \def\libreqtabenv{#1} + \begin{\libreqtabenv} + {#2}{#3} {x{.13\hsize}x{.15\hsize}x{.29\hsize}x{.27\hsize}} } { - \end{LongTable} + \end{\libreqtabenv} } \newenvironment{libreqtab4c}[2] From bd366780ed8e185746e28efb1a1e1413077e7d33 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 15 Sep 2020 14:14:22 -0700 Subject: [PATCH 106/250] Factor out duplication between note and example macros. --- source/layout.tex | 18 +++++++++++------- source/macros.tex | 33 ++++++++++++++++++--------------- 2 files changed, 29 insertions(+), 22 deletions(-) diff --git a/source/layout.tex b/source/layout.tex index 33e9e354a8..65c53124f9 100644 --- a/source/layout.tex +++ b/source/layout.tex @@ -32,14 +32,18 @@ %%-------------------------------------------------- %% Paragraph and bullet numbering -\newcounter{Paras} -\counterwithin{Paras}{chapter} -\counterwithin{Paras}{section} -\counterwithin{Paras}{subsection} -\counterwithin{Paras}{subsubsection} -\counterwithin{Paras}{paragraph} -\counterwithin{Paras}{subparagraph} +% create a new counter that resets for each new subclause +\newcommand{\newsubclausecounter}[1]{ +\newcounter{#1} +\counterwithin{#1}{chapter} +\counterwithin{#1}{section} +\counterwithin{#1}{subsection} +\counterwithin{#1}{subsubsection} +\counterwithin{#1}{paragraph} +\counterwithin{#1}{subparagraph} +} +\newsubclausecounter{Paras} \newcounter{Bullets1}[Paras] \newcounter{Bullets2}[Bullets1] \newcounter{Bullets3}[Bullets2] diff --git a/source/macros.tex b/source/macros.tex index 4b95facd52..e7b2ac6e8a 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -92,7 +92,7 @@ \or\let\s=\subparagraph\let\l=\label \fi% \s[#3]{#3\hfill[#2]}\l{#2}\addxref{#2}% -\setcounter{note}{0}\setcounter{example}{0}} +} % A convenience feature (mostly for the convenience of the Project % Editor, to make it easy to move around large blocks of text): @@ -266,16 +266,23 @@ \newcommand{\leftshift}[1]{\ensuremath{\mathbin{\mathsf{lshift}_{#1}}}} %% Notes and examples -\newcounter{note} -\newcounter{example} \newcommand{\noteintro}[1]{[\textit{#1}:\space} -\newcommand{\noteoutro}[1]{\textit{\,---\,end #1}\kern.5pt]} -\newenvironment{note}[1][Note] -{\par\small\addtocounter{note}{1}\noteintro{#1 \thenote}} -{\noteoutro{note}\par} -\newenvironment{example}[1][Example] -{\par\small\addtocounter{example}{1}\noteintro{#1 \theexample}} -{\noteoutro{example}\par} +\newcommand{\noteoutro}[1]{\textit{\,---\,#1}\kern.5pt]} + +% \newnoteenvironment{ENVIRON}{BEGIN TEXT}{END TEXT} +% Creates a note-like environment beginning with BEGIN TEXT and +% ending with END TEXT. A counter with name ENVIRON indicates the +% number of this kind of note / example that has occurred in this +% subclause. +\newcommand{\newnoteenvironment}[3]{ +\newsubclausecounter{#1} +\newenvironment{#1} +{\def\noteend{#3}\par\small\stepcounter{#1}\noteintro{#2}} +{\noteoutro{\noteend}\par} +} + +\newnoteenvironment{note}{Note \arabic{note}}{end note} +\newnoteenvironment{example}{Example \arabic{example}}{end example} %% Library function descriptions \newcommand{\Fundescx}[1]{\textit{#1}} @@ -623,11 +630,9 @@ %%-------------------------------------------------- %% Definitions section for "Terms and definitions" -\newcounter{termnote} \newcommand{\nocontentsline}[3]{} \newcommand{\definition}[2]{% \addxref{#2}% -\setcounter{termnote}{0}% \let\oldcontentsline\addcontentsline% \let\addcontentsline\nocontentsline% \ifcase\value{SectionDepth} @@ -641,6 +646,4 @@ \let\addcontentsline\oldcontentsline% } \newcommand{\defncontext}[1]{\textlangle#1\textrangle} -\newenvironment{defnote} -{\small\addtocounter{termnote}{1}\noteintro{Note \thetermnote{} to entry}} -{\noteoutro{note}\space} +\newnoteenvironment{defnote}{Note \arabic{defnote} to entry}{end note} From dd856fe8704441cfe30a05ea81530ba093efd58c Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 15 Sep 2020 16:01:06 -0700 Subject: [PATCH 107/250] [everywhere] Stop talking about C++ International Standards. As far as ISO is concerned, there is only one International Standard for C++, and in any case, we don't mean the document here, we mean the language in the abstract and don't care whether that's an ISO standard or not. Refer to "revisions of C++" instead of revisions of particular ISO documents. Partially addresses ISO/CS 016 (C++20 DIS). --- source/compatibility.tex | 219 +++++++++++++++++++-------------------- source/future.tex | 10 +- source/preprocessor.tex | 4 +- source/support.tex | 2 +- source/utilities.tex | 2 +- 5 files changed, 117 insertions(+), 120 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index ceb65fcd6b..24007b71d8 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -22,7 +22,7 @@ Logical lines beginning with \tcode{module} or \tcode{import} may be interpreted differently -in this International Standard. +in this revision of \Cpp{}. \begin{example} \begin{codeblock} class module {}; @@ -86,7 +86,7 @@ \tcode{constinit}, \tcode{co_await}, \tcode{co_yield}, \tcode{co_return}, or \tcode{requires} -as an identifier is not valid in this International Standard. +as an identifier is not valid in this revision of \Cpp{}. \diffref{lex.operators} \change @@ -96,7 +96,7 @@ \effect Valid \CppXVII{} code that contains a \tcode{<=} token immediately followed by a \tcode{>} token -may be ill-formed or have different semantics in this International Standard: +may be ill-formed or have different semantics in this revision of \Cpp{}: \begin{codeblock} namespace N { struct X {}; @@ -117,7 +117,7 @@ Valid \CppXVII{} code that depends on 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 International Standard. +is not valid in this revision of \Cpp{}. \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 @@ -147,7 +147,7 @@ Increase consistency of the language model. \effect Valid ISO \CppXVII{} code may be ill-formed or -have undefined behavior in this International Standard. +have undefined behavior in this revision of \Cpp{}. \begin{example} \begin{codeblock} int f() { @@ -195,7 +195,7 @@ \rationale Necessary for implementability. \effect -Valid \CppXVII{} code may be ill-formed in this International Standard. +Valid \CppXVII{} code may be ill-formed in this revision of \Cpp{}. \begin{codeblock} typedef struct { void f() {} // ill-formed; previously well-formed @@ -209,7 +209,7 @@ \rationale Required for modules support. \effect -Valid \CppXVII{} code may be ill-formed in this International Standard, +Valid \CppXVII{} code may be ill-formed in this revision of \Cpp{}, with no diagnostic required. \begin{codeblock} // Translation unit 1 @@ -232,7 +232,7 @@ Valid \CppXVII{} code that aggregate-initializes a type with a user-declared constructor may be ill-formed or have different semantics -in this International Standard. +in this revision of \Cpp{}. \begin{codeblock} struct A { // not an aggregate; previously an aggregate A() = delete; @@ -274,7 +274,7 @@ Catches bugs. \effect Valid \CppXVII{} code may fail to compile -in this International Standard. For example: +in this revision of \Cpp{}. For example: \begin{codeblock} bool y[] = { "bc" }; // ill-formed; previously well-formed \end{codeblock} @@ -293,7 +293,7 @@ Necessary for new functionality. \effect Valid \CppXVII{} code may fail to compile -in this International Standard. For example: +in this revision of \Cpp{}. For example: \begin{codeblock} struct S { explicit (S)(const S&); // ill-formed; previously well-formed @@ -310,7 +310,7 @@ Remove potentially error-prone option for redundancy. \effect Valid \CppXVII{} code may fail to compile -in this International Standard. For example: +in this revision of \Cpp{}. For example: \begin{codeblock} template struct A { @@ -331,7 +331,7 @@ more efficient code that takes advantage of moves. \effect Valid \CppXVII{} code may fail to compile or have different semantics -in this International Standard. +in this revision of \Cpp{}. For example: \begin{codeblock} struct base { @@ -438,11 +438,11 @@ A valid \CppXVII{} function declaration, member function declaration, function pointer declaration, or function reference declaration that uses \tcode{throw()} for its exception specification will be rejected as ill-formed in this -International Standard. It should simply be replaced with \tcode{noexcept} for no +revision of \Cpp{}. It should simply be replaced with \tcode{noexcept} for no change of meaning since \CppXVII{}. \begin{note} There is no way to write a function declaration -that is non-throwing in this International Standard +that is non-throwing in this revision of \Cpp{} and is also non-throwing in \CppIII{} except by using the preprocessor to generate a different token sequence in each case. @@ -474,7 +474,7 @@ \libheaderref{syncstream}, and \libheaderrefx{version}{support.limits.general}. Valid \CppXVII{} code that \tcode{\#include}{s} headers with these names may be -invalid in this International Standard. +invalid in this revision of \Cpp{}. \diffref{headers} \change @@ -515,7 +515,7 @@ \rationale Improve efficiency and convenience of finding number of removed elements. \effect -Code that depends on the return types might have different semantics in this International Standard. +Code that depends on the return types might have different semantics in this revision of \Cpp{}. Translation units compiled against this version of \Cpp{} may be incompatible with translation units compiled against \CppXVII{}, either failing to link or having undefined behavior. @@ -554,7 +554,7 @@ \rationale Increase safety via preventing buffer overflow at compile time. \effect -Valid \CppXVII{} code may fail to compile in this International Standard: +Valid \CppXVII{} code may fail to compile in this revision of \Cpp{}: \begin{codeblock} auto p = new char[100]; char q[100]; @@ -605,7 +605,7 @@ \effect 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 International Standard. +returning \tcode{std::string} is not valid in this revision of \Cpp{}. \begin{codeblock} std::filesystem::path p; std::string s1 = p.u8string(); // ill-formed; previously well-formed @@ -723,7 +723,7 @@ Prevents accidental uses of trigraphs in non-raw string literals and comments. \effect Valid \CppXIV{} code that uses trigraphs may not be valid or may have different -semantics in this International Standard. Implementations may choose to +semantics in this revision of \Cpp{}. Implementations may choose to translate trigraphs as specified in \CppXIV{} if they appear outside of a raw string literal, as part of the \impldef{mapping from physical source file characters to basic source character set} mapping from physical source file characters to @@ -737,9 +737,9 @@ Necessary to enable \grammarterm{hexadecimal-floating-point-literal}s. \effect Valid \CppXIV{} code may fail to compile or produce different results in -this International Standard. Specifically, character sequences like \tcode{0p+0} +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 International Standard. +in this revision of \Cpp{}. For example: \begin{codeblock} #define F(a) b ## a @@ -755,7 +755,7 @@ Obsolete feature with occasionally surprising semantics. \effect A valid \CppXIV{} expression utilizing the increment operator on -a \tcode{bool} lvalue is ill-formed in this International Standard. +a \tcode{bool} lvalue is ill-formed in this revision of \Cpp{}. Note that this might occur when the lvalue has a type given by a template parameter. @@ -770,7 +770,7 @@ where that class has no allocation functions of its own, \tcode{::operator new(std::size_t)} is used to allocate the memory. -In this International Standard, +In this revision of \Cpp{}, \tcode{::operator new(std::size_t, std::align_val_t)} is used instead. @@ -781,10 +781,10 @@ \change Removal of \tcode{register} \grammarterm{storage-class-specifier}. \rationale -Enable repurposing of deprecated keyword in future revisions of this International Standard. +Enable repurposing of deprecated keyword in future revisions of \Cpp{}. \effect A valid \CppXIV{} declaration utilizing the \tcode{register} -\grammarterm{storage-class-specifier} is ill-formed in this International Standard. +\grammarterm{storage-class-specifier} is ill-formed in this revision of \Cpp{}. The specifier can simply be removed to retain the original meaning. \diffref{dcl.spec.auto} @@ -794,7 +794,7 @@ More intuitive deduction behavior. \effect Valid \CppXIV{} code may fail to compile or may change meaning -in this International Standard. For example: +in this revision of \Cpp{}. For 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 @@ -807,7 +807,7 @@ Improve type-safety. \effect Valid \CppXIV{} code may fail to compile or change meaning in this -International Standard. +revision of \Cpp{}. For example: \begin{codeblock} void g1() noexcept; @@ -824,7 +824,7 @@ To increase convenience of aggregate initialization. \effect Valid \CppXIV{} code may fail to compile or produce different results in this -International Standard; initialization from an empty initializer list will +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: @@ -880,7 +880,7 @@ from the type deduced for the non-type template argument. \effect Valid \CppXIV{} code may fail to compile -or produce different results in this International Standard. +or produce different results in this revision of \Cpp{}. For example: \begin{codeblock} template struct A; @@ -900,7 +900,7 @@ Dynamic exception specifications were a deprecated feature that was complex and brittle in use. They interacted badly with the type system, -which became a more significant issue in this International Standard +which became a more significant issue in this revision of \Cpp{} where (non-dynamic) exception specifications are part of the function type. \effect A valid \CppXIV{} function declaration, @@ -908,9 +908,9 @@ function pointer declaration, or function reference declaration, if it has a potentially throwing dynamic exception specification, -will be rejected as ill-formed in this International Standard. +is rejected as ill-formed in this revision of \Cpp{}. Violating a non-throwing dynamic exception specification -will call \tcode{terminate} +calls \tcode{terminate} rather than \tcode{unexpected} and might not perform stack unwinding prior to such a call. @@ -933,7 +933,7 @@ and \libheaderref{variant}. Valid \CppXIV{} code that \tcode{\#include}{s} headers with these names may be -invalid in this International Standard. +invalid in this revision of \Cpp{}. \diffref{namespace.future} \change @@ -946,7 +946,7 @@ followed by an arbitrary sequence of \grammarterm{digit}{s}\iref{lex.name} are reserved for future standardization. Valid \CppXIV{} code that uses such a top-level namespace, -e.g., \tcode{std2}, may be invalid in this International Standard. +e.g., \tcode{std2}, may be invalid in this revision of \Cpp{}. \rSec2[diff.cpp14.utilities]{\ref{utilities}: general utilities library} @@ -957,9 +957,9 @@ No implementation consensus. \effect Valid \CppXIV{} code may fail to compile or may change meaning in this -International Standard. Specifically, constructing a \tcode{std::function} with +revision of \Cpp{}. Specifically, constructing a \tcode{std::function} with an allocator is ill-formed and uses-allocator construction will not pass an -allocator to \tcode{std::function} constructors in this International Standard. +allocator to \tcode{std::function} constructors in this revision of \Cpp{}. \diffref{util.smartptr.shared} \change @@ -969,7 +969,7 @@ via the syntax \tcode{shared_ptr} and \tcode{shared_ptr}. \effect Valid \CppXIV{} code may fail to compile or may change meaning in this -International Standard. +revision of \Cpp{}. For example: \begin{codeblock} #include @@ -985,13 +985,13 @@ \rationale The lack of a non-const \tcode{.data()} differed from the similar member of \tcode{std::vector}. -This change regularizes behavior for this International Standard. +This change regularizes behavior. \effect Overloaded functions which have differing code paths for \tcode{char*} and \tcode{const char*} arguments will execute differently when called with a non-const string's \tcode{.data()} member -in this International Standard. +in this revision of \Cpp{}. \begin{codeblock} int f(char *) = delete; @@ -1010,7 +1010,7 @@ \effect 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 International Standard: +may fail to compile in this revision of \Cpp{}: \begin{codeblock} #include @@ -1049,7 +1049,7 @@ Superseded by new features. \effect Valid \CppXIV{} code that uses these class templates -and function templates may fail to compile in this International Standard. +and function templates may fail to compile in this revision of \Cpp{}. \nodiffref \change @@ -1059,7 +1059,7 @@ has served its time. \effect A valid \CppXIV{} program using these identifiers -may be ill-formed in this International Standard. +may be ill-formed in this revision of \Cpp{}. \rSec1[diff.cpp11]{\Cpp{} and ISO \CppXI{}} @@ -1081,16 +1081,16 @@ Necessary to enable single quotes as digit separators. \effect Valid \CppXI{} code may fail to compile or may change meaning in this -International Standard. For example, the following code is valid both in \CppXI{} and in -this International Standard, but the macro invocation produces different outcomes +revision of \Cpp{}. For example, the following code is valid both in \CppXI{} and in +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 International Standard: +separators in this revision of \Cpp{}: \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 International Standard +// \tcode{int x[2] = \{ 3'4, 5 \};} --- this revision of \Cpp{} \end{codeblock} \rSec2[diff.cpp11.basic]{\ref{basic}: basics} @@ -1108,7 +1108,7 @@ void operator delete(void*, std::size_t) noexcept; \end{codeblock} -In this International Standard, however, the declaration of \tcode{operator delete} +In this revision of \Cpp{}, however, the declaration of \tcode{operator delete} might match a predefined usual (non-placement) \tcode{operator delete}\iref{basic.stc.dynamic}. If so, the program is ill-formed, as it was for class member allocation functions and @@ -1127,7 +1127,7 @@ lvalue-to-rvalue conversion, were considered gratuitous and surprising. \effect Valid \CppXI{} code that relies on the conversions may behave differently -in this International Standard: +in this revision of \Cpp{}: \begin{codeblock} struct S { @@ -1141,7 +1141,7 @@ } \end{codeblock} -In \CppXI{}, \tcode{f(true)} returns \tcode{1}. In this International Standard, +In \CppXI{}, \tcode{f(true)} returns \tcode{1}. In this revision of \Cpp{}, it returns \tcode{2}. \begin{codeblock} @@ -1149,7 +1149,7 @@ \end{codeblock} In \CppXI{}, the expression yields \tcode{sizeof(const char*)}. In this -International Standard, it yields \tcode{sizeof(const char[1])}. +revision of \Cpp{}, it yields \tcode{sizeof(const char[1])}. \rSec2[diff.cpp11.dcl.dcl]{\ref{dcl.dcl}: declarations} @@ -1161,9 +1161,9 @@ Necessary to allow \tcode{constexpr} member functions to mutate the object. \effect -Valid \CppXI{} code may fail to compile in this International Standard. +Valid \CppXI{} code may fail to compile in this revision of \Cpp{}. For example, the following code is valid in \CppXI{} -but invalid in this International Standard because it declares the same member +but invalid in this revision of \Cpp{} because it declares the same member function twice with different return types: \begin{codeblock} struct S { @@ -1179,7 +1179,7 @@ Necessary to allow default member initializers to be used by aggregate initialization. \effect -Valid \CppXI{} code may fail to compile or may change meaning in this International Standard. +Valid \CppXI{} code may fail to compile or may change meaning in this revision of \Cpp{}. For example: \begin{codeblock} struct S { // Aggregate in \CppXIV{} onwards. @@ -1191,7 +1191,7 @@ }; X a{}; S b{a}; // uses copy constructor in \CppXI{}, - // performs aggregate initialization in this International Standard + // performs aggregate initialization in this revision of \Cpp{} \end{codeblock} \rSec2[diff.cpp11.library]{\ref{library}: library introduction} @@ -1204,7 +1204,7 @@ \effect The \Cpp{} header \libheaderrefx{shared_mutex}{shared.mutex.syn} is new. Valid \CppXI{} code that \tcode{\#include}{s} a header with that name may be -invalid in this International Standard. +invalid in this revision of \Cpp{}. \rSec2[diff.cpp11.input.output]{\ref{input.output}: input/output library} @@ -1215,7 +1215,7 @@ Use of \tcode{gets} is considered dangerous. \effect Valid \CppXI{} code that uses the \tcode{gets} function may fail to compile -in this International Standard. +in this revision of \Cpp{}. \rSec1[diff.cpp03]{\Cpp{} and ISO \CppIII{}} @@ -1237,7 +1237,7 @@ Required for new features. \effect Valid \CppIII{} code may fail to compile or produce different results in -this International Standard. Specifically, macros named \tcode{R}, \tcode{u8}, +this revision of \Cpp{}. Specifically, macros named \tcode{R}, \tcode{u8}, \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: @@ -1253,7 +1253,7 @@ Required for new features. \effect Valid \CppIII{} code may fail to compile or produce different results in -this International Standard. +this revision of \Cpp{}. For example: \begin{codeblock} #define _x "there" @@ -1261,7 +1261,7 @@ \end{codeblock} Previously, \#1 would have consisted of two separate preprocessing tokens and -the macro \tcode{_x} would have been expanded. In this International Standard, +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. \diffref{lex.key} @@ -1282,8 +1282,7 @@ \tcode{static_assert}, and \tcode{thread_local}. -Valid \CppIII{} code using these identifiers is invalid in this International -Standard. +Valid \CppIII{} code using these identifiers is invalid in this revision of \Cpp{}. \diffref{lex.icon} \change @@ -1304,7 +1303,7 @@ expressions. \effect Valid \CppIII{} code may fail to compile or produce different results in -this International Standard. +this revision of \Cpp{}. For example: \begin{codeblock} void f(void *); // \#1 @@ -1321,7 +1320,7 @@ Increase portability, C99 compatibility. \effect Valid \CppIII{} code that uses integer division rounds the result toward 0 or -toward negative infinity, whereas this International Standard always rounds +toward negative infinity, whereas this revision of \Cpp{} always rounds the result toward 0. \diffref{expr.log.and} @@ -1331,7 +1330,7 @@ Required for new features. \effect Valid \CppIII{} code may fail to compile or produce different results in -this International Standard. +this revision of \Cpp{}. For example: \begin{codeblock} bool b1 = new int && false; // previously \tcode{false}, now ill-formed @@ -1348,8 +1347,10 @@ New feature. \effect Valid \CppIII{} code that uses the keyword \tcode{auto} as a storage class -specifier may be invalid in this International Standard. In this International -Standard, \tcode{auto} indicates that the type of a variable is to be deduced +specifier +may be invalid in this revision of \Cpp{}. +In this revision of \Cpp{}, +\tcode{auto} indicates that the type of a variable is to be deduced from its initializer expression. \diffref{dcl.init.list} @@ -1358,9 +1359,9 @@ \rationale Catches bugs. \effect -Valid \CppIII{} code may fail to compile in this International Standard. For +Valid \CppIII{} code may fail to compile in this revision of \Cpp{}. For example, the following code is valid in \CppIII{} but invalid in this -International Standard because \tcode{double} to \tcode{int} is a narrowing +revision of \Cpp{} because \tcode{double} to \tcode{int} is a narrowing conversion: \begin{codeblock} int x[] = { 2.0 }; @@ -1385,7 +1386,7 @@ \rationale Clarification of destructor requirements. \effect -Valid \CppIII{} code may execute differently in this International Standard. In +Valid \CppIII{} code may execute differently in this revision of \Cpp{}. In particular, destructors that throw exceptions will call \tcode{std::terminate} (without calling \tcode{std::unexpected}) if their exception specification is non-throwing. @@ -1399,7 +1400,7 @@ No implementation consensus. \effect A valid \CppIII{} declaration containing \tcode{export} is ill-formed in this -International Standard. +revision of \Cpp{}. \diffref{temp.arg} \change @@ -1413,7 +1414,7 @@ containing a right angle bracket (``\tcode{>}'') followed immediately by another right angle bracket may now be treated as closing two templates. For example, the following code is valid in \CppIII{} because ``\tcode{>>}'' -is a right-shift operator, but invalid in this International Standard because +is a right-shift operator, but invalid in this revision of \Cpp{} because ``\tcode{>>}'' closes two templates. \begin{codeblock} @@ -1428,8 +1429,8 @@ \rationale Overly constrained, simplify overload resolution rules. \effect -A valid \CppIII{} program could get a different result than this -International Standard. +A valid \CppIII{} program could get a different result than in this +revision of \Cpp{}. \rSec2[diff.cpp03.library]{\ref{library}: library introduction} @@ -1441,10 +1442,10 @@ Required by new features. \effect Valid \CppIII{} code that uses any identifiers added to the \Cpp{} standard -library by this International Standard may fail to compile or produce different -results in this International Standard. A comprehensive list of identifiers used +library by later revisions of \Cpp{} may fail to compile or produce different +results in this revision of \Cpp{}. A comprehensive list of identifiers used by the \Cpp{} standard library can be found in the Index of Library Names in this -International Standard. +document. \diffref{headers} \change @@ -1481,7 +1482,7 @@ and \libheaderref{cuchar}. Valid \CppIII{} code that \tcode{\#include}{s} headers with these names may be -invalid in this International Standard. +invalid in this revision of \Cpp{}. \diffref{swappable.requirements} \effect @@ -1500,7 +1501,7 @@ \effect The global namespace \tcode{posix} is now reserved for standardization. Valid \CppIII{} code that uses a top-level namespace \tcode{posix} may be invalid in -this International Standard. +this revision of \Cpp{}. \diffref{res.on.macro.definitions} \change @@ -1511,7 +1512,7 @@ Names of attribute identifiers may not be used as macro names. Valid \CppIII{} code that defines \tcode{override}, \tcode{final}, \tcode{carries_dependency}, or \tcode{noreturn} as macros is invalid in this -International Standard. +revision of \Cpp{}. \rSec2[diff.cpp03.language.support]{\ref{support}: language support library} @@ -1524,10 +1525,9 @@ Consistent application of \tcode{noexcept}. \effect Valid \CppIII{} code that assumes that global \tcode{operator new} only -throws \tcode{std::bad_alloc} may execute differently in this International -Standard. +throws \tcode{std::bad_alloc} may execute differently in this revision of \Cpp{}. Valid \CppIII{} code that replaces the global replaceable \tcode{operator new} -is ill-formed in this International Standard, +is ill-formed in this revision of \Cpp{}, because the exception specification of \tcode{throw(std::bad_alloc)} was removed. @@ -1541,7 +1541,7 @@ \effect Valid but implementation-specific \CppIII{} code that relies on \tcode{errno} being the same across threads may change behavior in this -International Standard. +revision of \Cpp{}. \rSec2[diff.cpp03.utilities]{\ref{utilities}: general utilities library} @@ -1565,7 +1565,7 @@ \effect Valid \CppIII{} code that depends on function object types being derived from \tcode{unary_function} or \tcode{binary_function} may fail to compile -in this International Standard. +in this revision of \Cpp{}. \rSec2[diff.cpp03.strings]{\ref{strings}: strings library} @@ -1575,9 +1575,9 @@ strings. \rationale Invalidation is subtly different with reference-counted strings. -This change regularizes behavior for this International Standard. +This change regularizes behavior. \effect -Valid \CppIII{} code may execute differently in this International Standard. +Valid \CppIII{} code may execute differently in this revision of \Cpp{}. \diffref{string.require} \change @@ -1585,7 +1585,7 @@ \rationale Allow small-string optimization. \effect -Valid \CppIII{} code may execute differently in this International Standard. +Valid \CppIII{} code may execute differently in this revision of \Cpp{}. Some \tcode{const} member functions, such as \tcode{data} and \tcode{c_str}, no longer invalidate iterators. @@ -1599,7 +1599,7 @@ divergent implementations with inconsistent performance characteristics. \effect Some container implementations that conform to \CppIII{} may not conform to the -specified \tcode{size()} requirements in this International Standard. Adjusting +specified \tcode{size()} requirements in this revision of \Cpp{}. Adjusting containers such as \tcode{std::list} to the stricter requirements may require incompatible changes. @@ -1645,7 +1645,7 @@ Valid \CppIII{} code that relies on these functions returning \tcode{void} (e.g., code that creates a pointer to member function that points to one -of these functions) will fail to compile with this International Standard. +of these functions) will fail to compile with this revision of \Cpp{}. \diffref{sequence.reqmts,associative.reqmts} \change @@ -1668,7 +1668,7 @@ \end{itemize} Valid \CppIII{} code that uses these functions may fail to compile with this -International Standard. +revision of \Cpp{}. \diffref{sequence.reqmts,associative.reqmts} \change @@ -1679,8 +1679,7 @@ For \tcode{vector}, \tcode{deque}, and \tcode{list} the fill value passed to \tcode{resize} is now passed by reference instead of by value, and an additional overload of \tcode{resize} has been added. Valid -\CppIII{} code that uses this function may fail to compile with this International -Standard. +\CppIII{} code that uses this function may fail to compile with this revision of \Cpp{}. \rSec2[diff.cpp03.algorithms]{\ref{algorithms}: algorithms library} @@ -1692,7 +1691,7 @@ \effect A valid \CppIII{} program may detect that an object with a valid but unspecified state has a different valid but unspecified state with this -International Standard. For example, \tcode{std::remove} and +revision of \Cpp{}. For example, \tcode{std::remove} and \tcode{std::remove_if} may leave the tail of the input sequence with a different set of values than previously. @@ -1706,7 +1705,7 @@ \effect Valid \CppIII{} code that uses implementation-specific knowledge about the binary representation of the required template specializations of -\tcode{std::complex} may not be compatible with this International Standard. +\tcode{std::complex} may not be compatible with this revision of \Cpp{}. \rSec2[diff.cpp03.input.output]{\ref{input.output}: input/output library} @@ -1717,7 +1716,7 @@ Clarify intentions, avoid workarounds. \effect Valid \CppIII{} code that relies on implicit boolean conversions will fail to -compile with this International Standard. Such conversions occur in the +compile with this revision of \Cpp{}. Such conversions occur in the following conditions: \begin{itemize} @@ -1738,7 +1737,7 @@ \tcode{std::exception}, but is now derived from \tcode{std::system_error}, which in turn is derived from \tcode{std::runtime_error}. Valid \CppIII{} code that assumes that \tcode{std::ios_base::failure} is derived directly from -\tcode{std::exception} may execute differently in this International Standard. +\tcode{std::exception} may execute differently in this revision of \Cpp{}. \diffref{ios.base} \change @@ -1749,7 +1748,7 @@ \effect 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 International Standard. For example: +with this revision of \Cpp{}. For example: \begin{codeblock} #include @@ -2026,7 +2025,7 @@ A valid ISO C expression utilizing the decrement operator on a \tcode{bool} lvalue (for instance, via the C typedef in \libdeprheaderref{stdbool.h}) -is ill-formed in this International Standard. +is ill-formed in \Cpp{}. \diffref{expr.sizeof,expr.cast} \change @@ -2678,7 +2677,7 @@ The types \tcode{char16_t} and \tcode{char32_t} are distinct types rather than typedefs to existing integral types. The tokens \tcode{char16_t} and \tcode{char32_t} -are keywords in this International Standard\iref{lex.key}. +are keywords in \Cpp{}\iref{lex.key}. They do not appear as macro or type names defined in \libheaderref{cuchar}. @@ -2688,7 +2687,7 @@ The type \tcode{wchar_t} is a distinct type rather than a typedef to an existing integral type. The token \tcode{wchar_t} -is a keyword in this International Standard\iref{lex.key}. +is a keyword in \Cpp{}\iref{lex.key}. It does not appear as a macro or type name defined in any of \libheaderref{cstddef}, \libheaderref{cstdlib}, @@ -2698,8 +2697,8 @@ \indexhdr{assert.h}% \pnum -The token \tcode{static_assert} is a keyword in this International -Standard\iref{lex.key}. It does not appear as a macro name defined +The token \tcode{static_assert} is a keyword in \Cpp{}. +It does not appear as a macro name defined in \libheaderref{cassert}. \rSec3[diff.header.iso646.h]{Header \tcode{}} @@ -2718,8 +2717,7 @@ \tcode{xor}, and \tcode{xor_eq} -are keywords in this International -Standard\iref{lex.key}, +are keywords in \Cpp{}\iref{lex.key}, and are not introduced as macros by \libdeprheaderref{iso646.h}. @@ -2727,8 +2725,7 @@ \indexhdr{stdalign.h}% \pnum -The token \tcode{alignas} is a keyword in this International -Standard\iref{lex.key}, +The token \tcode{alignas} is a keyword in \Cpp{}\iref{lex.key}, and is not introduced as a macro by \libdeprheaderref{stdalign.h}. @@ -2737,7 +2734,7 @@ \pnum The tokens \tcode{bool}, \tcode{true}, and \tcode{false} -are keywords in this International Standard\iref{lex.key}, +are keywords in \Cpp{}\iref{lex.key}, and are not introduced as macros by \libdeprheaderref{stdbool.h}. @@ -2754,8 +2751,8 @@ \libheaderref{cstring}, \libheaderref{ctime}, or \libheaderref{cwchar}, -is an \impldef{definition of \tcode{NULL}} \Cpp{} null pointer constant in -this International Standard\iref{support.types}. +is an \impldef{definition of \tcode{NULL}} null pointer constant in +\Cpp{}\iref{support.types}. \rSec2[diff.mods.to.declarations]{Modifications to declarations} @@ -2823,7 +2820,7 @@ \pnum The macro \tcode{offsetof}, defined in \libheaderref{cstddef}, -accepts a restricted set of \tcode{\placeholder{type}} arguments in this International Standard. +accepts a restricted set of \tcode{\placeholder{type}} arguments in \Cpp{}. Subclause \ref{support.types.layout} describes the change. \rSec3[diff.malloc]{Memory allocation functions} @@ -2835,5 +2832,5 @@ \indexlibraryglobal{malloc}\tcode{malloc}, and \indexlibraryglobal{realloc}\tcode{realloc} -are restricted in this International Standard. +are restricted in \Cpp{}. Subclause \ref{c.malloc} describes the changes. diff --git a/source/future.tex b/source/future.tex index f1aa0ec0a6..d29ad12f4f 100644 --- a/source/future.tex +++ b/source/future.tex @@ -13,7 +13,7 @@ These are deprecated features, where \term{deprecated} is defined as: -Normative for the current edition of this International Standard, +Normative for the current revision of \Cpp{}, but having been identified as a candidate for removal from future revisions. An implementation may declare library names and entities described in this Clause with the \tcode{deprecated} attribute\iref{dcl.attr.deprecated}. @@ -42,7 +42,7 @@ \rSec1[depr.capture.this]{Implicit capture of \tcode{*this} by reference} \pnum -For compatibility with prior \Cpp{} International Standards, +For compatibility with prior revisions of \Cpp{}, a \grammarterm{lambda-expression} with \grammarterm{capture-default} \tcode{=}\iref{expr.prim.lambda.capture} may implicitly capture \tcode{*this} by reference. @@ -160,7 +160,7 @@ \rSec1[depr.static.constexpr]{Redeclaration of \tcode{static constexpr} data members} \pnum -For compatibility with prior \Cpp{} International Standards, a \tcode{constexpr} +For compatibility with prior revisions of \Cpp{}, a \tcode{constexpr} static data member may be redundantly redeclared outside the class with no initializer. This usage is deprecated. \begin{example} @@ -204,7 +204,7 @@ as defaulted is deprecated if the class has a user-declared copy constructor or a user-declared destructor. -In a future revision of this International Standard, these implicit definitions +In a future revision of \Cpp{}, these implicit definitions could become deleted\iref{dcl.fct.def.delete}. \rSec1[depr.c.headers]{C headers} @@ -286,7 +286,7 @@ \tcode{or_eq}, \tcode{xor}, and \tcode{xor_eq} -are keywords in this International Standard\iref{lex.key}. +are keywords in \Cpp{}\iref{lex.key}. \end{note} \rSec2[depr.stdalign.h.syn]{Header \tcode{} synopsis} diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 676b797d4e..c4f9582458 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -1634,7 +1634,7 @@ The integer literal \tcode{\cppver}. \begin{note} It is intended that future -versions of this International Standard will +revisions of \Cpp{} will replace the value of this macro with a greater value. \end{note} @@ -1703,7 +1703,7 @@ The macros defined in \tref{cpp.predefined.ft} shall be defined to the corresponding integer literal. \begin{note} -Future versions of this International Standard might replace +Future revisions of \Cpp{} might replace the values of these macros with greater values. \end{note} \end{description} diff --git a/source/support.tex b/source/support.tex index ae5d3a1f5b..02e8a5bab8 100644 --- a/source/support.tex +++ b/source/support.tex @@ -542,7 +542,7 @@ after inclusion of any member of the set of library headers indicated in the corresponding comment in this synopsis. \begin{note} -Future versions of this International Standard might replace +Future revisions of \Cpp{} might replace the values of these macros with greater values. \end{note} diff --git a/source/utilities.tex b/source/utilities.tex index 87a35f3dcf..4fcca52091 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -15122,7 +15122,7 @@ \pnum \begin{note} The types deduced by the deduction guides for \tcode{function} -may change in future versions of this International Standard. +might change in future revisions of \Cpp{}. \end{note} \rSec4[func.wrap.func.con]{Constructors and destructor} From d5fe04193a022cd4e826f28b9be23f86d780dd1b Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 16 Sep 2020 21:39:28 +0200 Subject: [PATCH 108/250] [dcl.fct.def.coroutine] Add missing 'noexcept' for final_suspend. The invocation of final_suspend is guaranteed to be non-throwing, thus final_suspend in the example needs to be declared 'noexcept'. --- source/declarations.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/declarations.tex b/source/declarations.tex index a9c137d8b9..e4ef496387 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -6404,7 +6404,7 @@ static auto get_return_object_on_allocation_failure() { return generator{nullptr}; } auto get_return_object() { return generator{handle::from_promise(*this)}; } auto initial_suspend() { return std::suspend_always{}; } - auto final_suspend() { return std::suspend_always{}; } + auto final_suspend() noexcept { return std::suspend_always{}; } void unhandled_exception() { std::terminate(); } void return_void() {} auto yield_value(int value) { From a3ff33bd71668632912988349cacaf4a5213d5a6 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 9 Jun 2020 08:58:28 +0200 Subject: [PATCH 109/250] [predef.iterators] Singularize heading of singular sentinels. Also adjust stable labels. --- source/iterators.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index 25eb383c69..cb30e19c4d 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -378,7 +378,7 @@ template<@\libconcept{input_iterator}@ I, class S> struct iterator_traits>; - // \ref{default.sentinels}, default sentinels + // \ref{default.sentinel}, default sentinel struct default_sentinel_t; inline constexpr default_sentinel_t @\libglobal{default_sentinel}@{}; @@ -5084,7 +5084,7 @@ Equivalent to \tcode{ranges::iter_swap(get(x.v_), get(y.v_))}. \end{itemdescr} -\rSec2[default.sentinels]{Default sentinels} +\rSec2[default.sentinel]{Default sentinel} \indexlibraryglobal{default_sentinel_t}% \begin{itemdecl} From d77bb116163129c7fe36e7f093b9c16b737b6440 Mon Sep 17 00:00:00 2001 From: Eelis van der Weegen Date: Fri, 28 Aug 2020 18:35:00 +0200 Subject: [PATCH 110/250] [std] Fix dangling \grammarterms. --- source/compatibility.tex | 2 +- source/declarations.tex | 2 +- source/expressions.tex | 2 +- source/modules.tex | 2 +- source/templates.tex | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index 24007b71d8..0f3de98456 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -30,7 +30,7 @@ module *m2; // variable declaration class import {}; -import j1; // was variable declaration; now \grammarterm{import-declaration} +import j1; // was variable declaration; now \grammarterm{module-import-declaration} ::import j2; // variable declaration \end{codeblock} \end{example} diff --git a/source/declarations.tex b/source/declarations.tex index e4ef496387..bea737fb13 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -6384,7 +6384,7 @@ and if a global allocation function is selected, the \tcode{::operator new(size_t, nothrow_t)} form is used. The allocation function used in this case shall have a non-throwing -\grammarterm{noexcept-specification}. +\grammarterm{noexcept-specifier}. If the allocation function returns \tcode{nullptr}, the coroutine returns control to the caller of the coroutine and the return value is obtained by a call to \tcode{T::get_return_object_on_allocation_failure()}, where \tcode{T} diff --git a/source/expressions.tex b/source/expressions.tex index 608aa54020..8c03ac557f 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -4363,7 +4363,7 @@ \grammarterm{function-body} outside of a \grammarterm{handler}\iref{except.pre}. In a \grammarterm{declaration-statement} or in the \grammarterm{simple-declaration} (if any) -of a \grammarterm{for-init-statement}, an \grammarterm{await-expression} +of an \grammarterm{init-statement}, an \grammarterm{await-expression} shall appear only in an \grammarterm{initializer} of that \grammarterm{declaration-statement} or \grammarterm{simple-declaration}. An \grammarterm{await-expression} shall not appear in a diff --git a/source/modules.tex b/source/modules.tex index 5895871c7f..5d6a98e133 100644 --- a/source/modules.tex +++ b/source/modules.tex @@ -673,7 +673,7 @@ \grammarterm{alias-declaration}, \tcode{typedef} declaration, \grammarterm{using-declaration}, or -\grammarterm{namespace-alias-declaration} +\grammarterm{namespace-alias-definition} is replaced by the declarations they name prior to this determination, diff --git a/source/templates.tex b/source/templates.tex index 1a622a017f..b57d6a23a6 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -2720,7 +2720,7 @@ }; } -foo(); // \tcode{xs} contains zero \grammarterm{init-captures} +foo(); // \tcode{xs} contains zero \grammarterm{init-capture}s foo(1); // \tcode{xs} contains one \grammarterm{init-capture} \end{codeblock} \end{example} From 4388f084b01fdef1f25dac8603dfac3951272a24 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 8 Sep 2020 19:52:50 +0200 Subject: [PATCH 111/250] [expr.const] Disambiguate 'it' by introducing the name V. --- source/expressions.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 8c03ac557f..6fda15f3e0 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -6860,12 +6860,12 @@ it has reference or const-qualified integral or enumeration type. \pnum -A constant-initialized potentially-constant variable is +A constant-initialized potentially-constant variable $V$ is \defn{usable in constant expressions} at a point $P$ if -its initializing declaration $D$ is reachable from $P$ and +$V$'s initializing declaration $D$ is reachable from $P$ and \begin{itemize} -\item it is constexpr, -\item it is not initialized to a TU-local value, or +\item $V$ is constexpr, +\item $V$ is not initialized to a TU-local value, or \item $P$ is in the same translation unit as $D$. \end{itemize} An object or reference is \defn{usable in constant expressions} if it is From 7dfb89d2761409826f0ac1d0db2d19172ba7aaa1 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 10 Jul 2020 00:06:58 +0200 Subject: [PATCH 112/250] [expr.const] Add cross-reference for 'constant initialization'. --- source/expressions.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/expressions.tex b/source/expressions.tex index 6fda15f3e0..7dac1ede21 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -7311,7 +7311,8 @@ to determine whether it is satisfied\iref{temp.constr.atomic}, or \item the initializer of a variable that is usable in constant expressions or -has constant initialization.\footnote{Testing this condition +has constant initialization\iref{basic.start.static}.% +\footnote{Testing this condition may involve a trial evaluation of its initializer as described above.} \begin{example} \begin{codeblock} From d948a00dc0181a053240ce34fab7ae967b240b22 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 22 May 2020 23:31:59 +0200 Subject: [PATCH 113/250] [class.derived] Clean up cross-references. --- source/classes.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index b8ad74fcc8..44a623292b 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3600,14 +3600,14 @@ \pnum \begin{note} -A base class subobject might have a layout\iref{basic.stc} different +A base class subobject might have a layout different from the layout of a most derived object of the same type. A base class subobject might have a polymorphic behavior\iref{class.cdtor} different from the polymorphic behavior of a most derived object of the -same type. A base class subobject may be of zero size\iref{class}; +same type. A base class subobject may be of zero size; however, two subobjects that have the same class type and that belong to the same most derived object must not be allocated at the same -address\iref{expr.eq}. +address\iref{intro.object}. \end{note} \rSec2[class.mi]{Multiple base classes} From 2d7a1205d74a9aad6730b6fbaf75ba1e67fc0672 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Wed, 10 Jun 2020 10:56:09 +0200 Subject: [PATCH 114/250] [module.reach] Clarify that only TUs with an interface dependency may be incidentally reachable I think this is the intent of that sentence. Another possible reading, and the one my rewording attempts to prevent, is that because it doesn't say that no other TUs may be reachable, any TU may be, and it is just giving an example of a specific likely case of incidental reachability. But if that is the intent, then we probably shouldn't have it in normative text. There is an existing issue in the wording in that http://eel.is/c++draft/module#import-10 defines "has an interface dependency" as a relationship between two TUs, but this uses it as a relationship between "point with the program" and a TU. This makes it ambiguous about whether TU imported later in a file may be reachable at an earlier point. I am not trying to resolve that ambiguity with this change. --- source/modules.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/modules.tex b/source/modules.tex index 5d6a98e133..e534fd837c 100644 --- a/source/modules.tex +++ b/source/modules.tex @@ -982,9 +982,9 @@ \pnum All translation units that are necessarily reachable are \defnx{reachable}{reachable!translation unit}. -It is unspecified whether additional translation units on which the -point within the program has an interface dependency are considered reachable, -and under what circumstances.% +Additional translation units on which the +point within the program has an interface dependency may be considered reachable, +but it is unspecified which are and under what circumstances.% \footnote{Implementations are therefore not required to prevent the semantic effects of additional translation units involved in the compilation from being observed.} From 96525ff7023f059b5e2f1190d4bd9f859def0688 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 15 May 2020 22:04:07 +0200 Subject: [PATCH 115/250] [module.import] Clarify that only header imports make macros visible. --- source/modules.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/modules.tex b/source/modules.tex index e534fd837c..3f5c04a721 100644 --- a/source/modules.tex +++ b/source/modules.tex @@ -497,6 +497,8 @@ preprocessor, and results in macros defined at the end of phase 4 of translation of the header unit being made visible as described in \ref{cpp.import}. +Any other \grammarterm{module-import-declaration} +does not make macros visible. \end{note} \pnum From 3f4089fe54eccad8c51e3c2243f7fed630f89b87 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Sun, 3 May 2020 00:55:16 -0400 Subject: [PATCH 116/250] [basic.def.odr] Change "is required" to "shall" --- source/basic.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index be7b7517a0..47bde5be9e 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -514,7 +514,7 @@ \pnum \indextext{type!incomplete}% -A definition of a class is required to be reachable in every context in which +A definition of a class shall be reachable in every context in which the class is used in a way that requires the class type to be complete. \begin{example} The following complete translation unit is well-formed, From 39b6e3c0156463c95024b2b8a2e32532cd18a6a9 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Sun, 3 May 2020 00:44:14 -0400 Subject: [PATCH 117/250] [over.ics.user] Small grammatical nit-picks --- source/overloading.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/overloading.tex b/source/overloading.tex index 890767ac1d..b40c6d4408 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -2478,13 +2478,13 @@ conversion sequence. If the user-defined conversion is specified by a constructor\iref{class.conv.ctor}, the initial standard -conversion sequence converts the source type to the type required -by the argument of the constructor. +conversion sequence converts the source type to the type of the +first parameter of that constructor. If the user-defined conversion is specified by a conversion function\iref{class.conv.fct}, the initial standard conversion sequence -converts the source type to the implicit object parameter of the -conversion function. +converts the source type to the type of the +implicit object parameter of that conversion function. \pnum The second standard conversion sequence converts the result of From 89558373fe837d4746c62d9eb2dcdc0ab179234e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 29 Apr 2020 00:29:02 -0400 Subject: [PATCH 118/250] [class.dtor] Remove incorrect uses of virtual as a keyword --- source/classes.tex | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index 44a623292b..2f7e0a6d65 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -2233,7 +2233,7 @@ \pnum A destructor is trivial if it is not user-provided and if: \begin{itemize} -\item the destructor is not \tcode{virtual}, +\item the destructor is not virtual, \item all of the direct base classes of its class have trivial destructors, and @@ -2265,10 +2265,9 @@ \pnum \indextext{destructor!virtual}% \indextext{destructor!pure virtual}% -A prospective destructor can be declared -\tcode{virtual}\iref{class.virtual} -or pure -\tcode{virtual}\iref{class.abstract}. +A prospective destructor can be +declared \keyword{virtual}\iref{class.virtual} +and with a \grammarterm{pure-specifier}\iref{class.abstract}. If the destructor of a class is virtual and any objects of that class or any derived class are created in the program, the destructor shall be defined. From 734d1941bce42d655f8cab72ff8e7bdde75aa9f9 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 17 Apr 2020 11:44:35 +0200 Subject: [PATCH 119/250] [std] Remove cross-references to the very same subclause and add an automatic check. --- source/classes.tex | 2 +- source/declarations.tex | 2 +- source/iostreams.tex | 2 +- source/time.tex | 2 +- tools/check.sh | 7 +++++++ 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index 2f7e0a6d65..0ca6760568 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -2347,7 +2347,7 @@ \pnum At the point of definition of a virtual destructor (including an implicit -definition\iref{class.dtor}), the non-array deallocation function is +definition), the non-array deallocation function is determined as if for the expression \tcode{delete this} appearing in a non-virtual destructor of the destructor's class (see~\ref{expr.delete}). If the lookup fails or if the deallocation function has diff --git a/source/declarations.tex b/source/declarations.tex index bea737fb13..756aa69af7 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -3641,7 +3641,7 @@ The invented type \grammarterm{template-parameter} is a template parameter pack if the corresponding \grammarterm{parameter-declaration} -declares a function parameter pack\iref{dcl.fct}. +declares a function parameter pack. If the placeholder contains \tcode{decltype(auto)}, the program is ill-formed. The adjusted function parameters of an abbreviated function template diff --git a/source/iostreams.tex b/source/iostreams.tex index 2acca9b8f0..6a4a4a4aa1 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -12054,7 +12054,7 @@ \item Replace each slash character in the \grammarterm{root-name} with a \grammarterm{preferred-separator}. \item Replace each \grammarterm{directory-separator} with a \grammarterm{preferred-separator}. \begin{note} -The generic pathname grammar\iref{fs.path.generic} defines \grammarterm{directory-separator} as one or more slashes and \grammarterm{preferred-separator}{s}. +The generic pathname grammar defines \grammarterm{directory-separator} as one or more slashes and \grammarterm{preferred-separator}{s}. \end{note} \item Remove each dot filename and any immediately following \grammarterm{directory-separator}. \item As long as any appear, remove a non-dot-dot filename immediately followed by a \grammarterm{directory-separator} and a dot-dot filename, along with any immediately following \grammarterm{directory-separator}. diff --git a/source/time.tex b/source/time.tex index 5079a699f1..a4c63f6eb3 100644 --- a/source/time.tex +++ b/source/time.tex @@ -998,7 +998,7 @@ \pnum A type \tcode{TC} meets the \oldconcept{TrivialClock} requirements if: \begin{itemize} -\item \tcode{TC} meets the \oldconcept{Clock} requirements\iref{time.clock.req}, +\item \tcode{TC} meets the \oldconcept{Clock} requirements, \item the types \tcode{TC::rep}, \tcode{TC::duration}, and \tcode{TC::time_point} meet the \oldconcept{EqualityComparable} (\tref{cpp17.equalitycomparable}) and diff --git a/tools/check.sh b/tools/check.sh index cd4e161821..b6beddb6c6 100755 --- a/tools/check.sh +++ b/tools/check.sh @@ -124,6 +124,13 @@ for f in $texlibdesc; do sed 's/$/ <--- \\pnum missing/' done | grep . && exit 1 +# Cross-references pointing to their own section. +for f in $texfiles; do + sed -n '/^\\rSec/{s/^.rSec.\[/S /;s/\].*$//;=;p};/\\iref{/{s/^.*\\.\?ref{\([-a-z.0-9]\+\)}.*/R \1/g;=;p}' $f | + sed '/^[0-9]\+$/{N;s/\n/: /}' | sed "s/.*/$f:&/" | + awk '$2 == "S" { seclabel = $3 } $2 == "R" && $3 == seclabel { print $1 " section self-reference to [" $3 "]" }' +done | grep . && exit 1 + # \placeholder before ( #egrep 'placeholder{[-A-Za-z]*}@?\(' *.tex # to fix: sed -i 's/placeholder\({[-A-Za-z]*}@\?(\)/placeholdernc\1/g' *.tex From cca7a87826af74b42c12265de33b19f08f1330ea Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 13 Apr 2020 18:42:34 -0400 Subject: [PATCH 120/250] [expr.reinterpret.cast] Strike definition in footnote --- source/expressions.tex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/expressions.tex b/source/expressions.tex index 7dac1ede21..3b923ef5ab 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -3993,6 +3993,7 @@ \pnum \indextext{cast!reinterpret!reference}% \indextext{cast!reference}% +\indextext{type pun}% A glvalue of type \tcode{T1}, designating an object \placeholder{x}, can be cast to the type ``reference to \tcode{T2}'' @@ -4005,7 +4006,7 @@ No temporary is created, no copy is made, and no constructors\iref{class.ctor} or conversion functions\iref{class.conv} are called.% -\footnote{This is sometimes referred to as a \defn{type pun} +\footnote{This is sometimes referred to as a type pun when the result refers to the same object as the source glvalue.} \rSec3[expr.const.cast]{Const cast} From 65c8bdca8a2f38a4cec2b14252d8d8c77f32e79b Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Mon, 13 Apr 2020 18:52:22 -0400 Subject: [PATCH 121/250] [expr.comma] Turn redundant normative wording into a note --- source/expressions.tex | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 3b923ef5ab..2f925f112b 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -6787,14 +6787,11 @@ right operand is a bit-field. \pnum -In contexts where comma is given a special meaning, -\begin{example} -in -lists of arguments to functions\iref{expr.call} and lists of -initializers\iref{dcl.init} -\end{example} -the comma operator as -described in this subclause can appear only in parentheses. +\begin{note} +In contexts where the comma token is given special meaning +(e.g. function calls\iref{expr.call}, lists of initializers\iref{dcl.init}, +or \grammarterm{template-argument-list}{s}\iref{temp.names}), +the comma operator as described in this subclause can appear only in parentheses. \begin{example} \begin{codeblock} f(a, (t=3, t+2), c); @@ -6802,6 +6799,7 @@ has three arguments, the second of which has the value \tcode{5}. \end{example} +\end{note} \pnum \begin{note} From 40f15ca8791f6d1c17e99c660878e30e681320ba Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 9 Apr 2020 08:25:35 +0200 Subject: [PATCH 122/250] [core] Use \keyword to introduce 'template'. --- source/basic.tex | 2 +- source/expressions.tex | 6 +++--- source/grammar.tex | 2 +- source/templates.tex | 46 +++++++++++++++++++++--------------------- source/utilities.tex | 2 +- 5 files changed, 29 insertions(+), 29 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 47bde5be9e..219f68a828 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -310,7 +310,7 @@ an array operand, the set contains the potential results of that operand. \item If $E$ is a class member access expression\iref{expr.ref} of the form -$E_1$ \tcode{.} \opt{\tcode{template}} $E_2$ +$E_1$ \tcode{.} \opt{\keyword{template}} $E_2$ naming a non-static data member, the set contains the potential results of $E_1$. \item If $E$ is a class member access expression diff --git a/source/expressions.tex b/source/expressions.tex index 2f925f112b..16f5c14ff4 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -1434,7 +1434,7 @@ \pnum A \grammarterm{nested-name-specifier} that denotes a class, optionally -followed by the keyword \tcode{template}\iref{temp.names}, and then +followed by the keyword \keyword{template}\iref{temp.names}, and then followed by the name of a member of either that class\iref{class.mem} or one of its base classes\iref{class.derived}, is a \indextext{id!qualified}% @@ -1459,7 +1459,7 @@ The \grammarterm{nested-name-specifier} \tcode{::} names the global namespace. A \grammarterm{nested-name-specifier} that names a namespace\iref{basic.namespace}, optionally followed by the keyword -\tcode{template}\iref{temp.names}, and then followed by the name of a member +\keyword{template}\iref{temp.names}, and then followed by the name of a member of that namespace (or the name of a member of a namespace made visible by a \grammarterm{using-directive}), is a \indextext{id!qualified}% @@ -3211,7 +3211,7 @@ \indextext{arrow operator|see{operator, class member access}}% A postfix expression followed by a dot \tcode{.} or an arrow \tcode{->}, optionally followed by the keyword -\tcode{template}\iref{temp.names}, and then followed by an +\keyword{template}\iref{temp.names}, and then followed by an \grammarterm{id-expression}, is a postfix expression. The postfix expression before the dot or arrow is evaluated;\footnote{If the class member access expression is evaluated, the subexpression evaluation happens even if the diff --git a/source/grammar.tex b/source/grammar.tex index a264fbd7a1..8f776393ca 100644 --- a/source/grammar.tex +++ b/source/grammar.tex @@ -22,7 +22,7 @@ \tcode{typedef}\iref{dcl.typedef}, \tcode{namespace}\iref{namespace.def}, class\iref{class}, enumeration\iref{dcl.enum}, and -\tcode{template}\iref{temp} +\keyword{template}\iref{temp} declarations. \begin{ncbnf} diff --git a/source/templates.tex b/source/templates.tex index b57d6a23a6..51947a4d2e 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -319,11 +319,11 @@ to be a \grammarterm{typedef-name} (if declared without -\tcode{template}) +\keyword{template}) or \grammarterm{template-name} (if declared with -\tcode{template}) +\keyword{template}) in the scope of the template declaration. \begin{note} A template argument may be a class template or alias template. @@ -764,25 +764,25 @@ \end{example} \pnum -The keyword \tcode{template} is said to appear at the top level in +The keyword \keyword{template} is said to appear at the top level in a \grammarterm{qualified-id} if it appears outside of a \grammarterm{template-argument-list} or \grammarterm{decltype-specifier}. In a \grammarterm{qualified-id} of a \grammarterm{declarator-id} or in a \grammarterm{qualified-id} formed by a \grammarterm{class-head-name}\iref{class.pre} or \grammarterm{enum-head-name}\iref{dcl.enum}, -the keyword \tcode{template} shall not appear at the top level. +the keyword \keyword{template} shall not appear at the top level. In a \grammarterm{qualified-id} used as the name in a \grammarterm{typename-specifier}\iref{temp.res}, \grammarterm{elaborated-type-specifier}\iref{dcl.type.elab}, \grammarterm{using-declaration}\iref{namespace.udecl}, or \grammarterm{class-or-decltype}\iref{class.derived}, -an optional keyword \tcode{template} appearing at the top level is ignored. +an optional keyword \keyword{template} appearing at the top level is ignored. In these contexts, a \tcode{<} token is always assumed to introduce a \grammarterm{template-argument-list}. In all other contexts, when naming a template specialization of a member of an unknown specialization\iref{temp.dep.type}, -the member template name shall be prefixed by the keyword \tcode{template}. +the member template name shall be prefixed by the keyword \keyword{template}. \begin{example} \begin{codeblock} struct X { @@ -800,19 +800,19 @@ \pnum A name prefixed by the keyword -\tcode{template} +\keyword{template} shall be a \grammarterm{template-id} or the name shall refer to a class template or an alias template. \begin{note} The keyword -\tcode{template} +\keyword{template} may not be applied to non-template members of class templates. \end{note} \begin{note} As is the case with the \tcode{typename} prefix, the -\tcode{template} +\keyword{template} prefix is allowed in cases where it is not strictly necessary; i.e., when the \grammarterm{nested-name-specifier} or the expression on the left of @@ -2245,7 +2245,7 @@ T& elem(int i) { return v[i]; } }; \end{codeblock} -The prefix \tcode{template} +The prefix \tcode{\keyword{template}} specifies that a template is being declared and that a \grammarterm{type-name} \tcode{T} @@ -3255,7 +3255,7 @@ \pnum The template parameters are specified in the angle bracket enclosed list that immediately follows the keyword -\tcode{tem\-plate}. +\keyword{template}. For partial specializations, the template argument list is explicitly written immediately following the class template name. For primary templates, this list is implicitly described by the @@ -5991,7 +5991,7 @@ a variable template, a class template, a member of a class template, or a member template. An explicit specialization declaration is introduced by -\tcode{template<>}. +\tcode{\keyword{template}<>}. In an explicit specialization declaration for a variable template, a class template, a member of a class template or a class member template, @@ -6839,7 +6839,7 @@ member function template of a class or class template \end{itemize} can be declared by a declaration introduced by -\tcode{template<>}; +\tcode{\keyword{template}<>}; that is: \indextext{\idxgram{explicit-specialization}}% @@ -6935,9 +6935,9 @@ specialization. Members of an explicitly specialized class template are defined in the same manner as members of normal classes, and -not using the \tcode{template<>} syntax. +not using the \tcode{\keyword{template}<>} syntax. The same is true when defining a member of an explicitly specialized member -class. However, \tcode{template<>} is used in defining a member of an explicitly +class. However, \tcode{\keyword{template}<>} is used in defining a member of an explicitly specialized member class template that is specialized as a class template. \begin{example} \begin{codeblock} @@ -6955,19 +6955,19 @@ a.f(16); // \tcode{A::f} must be defined somewhere } -// \tcode{template<>} not used for a member of an explicitly specialized class template +// \tcode{\keyword{template}<>} not used for a member of an explicitly specialized class template void A::f(int) { @\commentellip@ } template<> struct A::B { void f(); }; -// \tcode{template<>} also not used when defining a member of an explicitly specialized member class +// \tcode{\keyword{template}<>} also not used when defining a member of an explicitly specialized member class void A::B::f() { @\commentellip@ } template<> template struct A::C { void f(); }; -// \tcode{template<>} is used when defining a member of an explicitly specialized member class template +// \tcode{\keyword{template}<>} is used when defining a member of an explicitly specialized member class template // specialized as a class template template<> template void A::C::f() { @\commentellip@ } @@ -6975,12 +6975,12 @@ template<> struct A::B { void f(); }; -template<> void A::B::f() { @\commentellip@ } // error: \tcode{template<>} not permitted +template<> void A::B::f() { @\commentellip@ } // error: \tcode{\keyword{template}<>} not permitted template<> template struct A::C { void f(); }; -template void A::C::f() { @\commentellip@ } // error: \tcode{template<>} required +template void A::C::f() { @\commentellip@ } // error: \tcode{\keyword{template}<>} required \end{codeblock} \end{example} @@ -7185,7 +7185,7 @@ templates. In an explicit specialization for such a member, the member declaration shall be preceded by a -\tcode{template<>} +\tcode{\keyword{template}<>} for each enclosing class template that is explicitly specialized. \begin{example} \begin{codeblock} @@ -7208,11 +7208,11 @@ template if its enclosing class templates are not explicitly specialized as well. In such an explicit specialization declaration, the keyword -\tcode{template} +\keyword{template} followed by a \grammarterm{template-parameter-list} shall be provided instead of the -\tcode{template<>} +\tcode{\keyword{template}<>} preceding the explicit specialization declaration of the member. The types of the \grammarterm{template-parameter}{s} diff --git a/source/utilities.tex b/source/utilities.tex index 4fcca52091..b3bb30024a 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -2228,7 +2228,7 @@ non-member function is that if this functionality had been provided as a member function, code where the type depended on a template parameter would have required using -the \tcode{template} keyword. +the \keyword{template} keyword. \end{note} \rSec2[tuple.rel]{Relational operators} From 92cdf915cde523670dde4006f9f32848835ba8a0 Mon Sep 17 00:00:00 2001 From: Eelis van der Weegen Date: Mon, 29 Jun 2020 13:04:19 +0200 Subject: [PATCH 123/250] [std] Use \defnadj to improve/add many index entries. --- source/basic.tex | 34 ++++++++++++---------------------- source/classes.tex | 21 ++++++++------------- source/declarations.tex | 13 +++++-------- source/iostreams.tex | 4 ++-- source/lib-intro.tex | 2 +- source/templates.tex | 2 +- source/threads.tex | 4 ++-- 7 files changed, 31 insertions(+), 49 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 219f68a828..1e3f4edb42 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -1015,7 +1015,7 @@ \defnx{block scope}{block (statement)!scope}. Its potential scope begins at its point of declaration\iref{basic.scope.pdecl} and ends at the end of its block. -A variable declared at block scope is a \defn{local variable}. +A variable declared at block scope is a \defnadj{local}{variable}. \pnum \indextext{scope!exception declaration}% @@ -2634,15 +2634,12 @@ \end{bnf} \pnum -\indextext{linkage}% \indextext{translation unit}% -\indextext{linkage!internal}% -\indextext{linkage!external}% A name is said to have \defn{linkage} when it might 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 \indextext{linkage!external}\defn{external linkage}, +\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. @@ -2652,7 +2649,7 @@ 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 \indextext{linkage!internal}\defn{internal linkage}, +\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. @@ -3399,8 +3396,7 @@ \indextext{object lifetime|(}% The \defn{lifetime} of an object or reference is a runtime property of the object or reference. -\indextext{initialization!vacuous}% -A variable is said to have \defn{vacuous initialization} +A variable is said to have \defnadj{vacuous}{initialization} if it is default-initialized and, if it is of class type or a (possibly multi-dimensional) array thereof, that class type has a trivial default constructor. @@ -4114,7 +4110,7 @@ \end{itemize} \pnum -A pointer value is a \defn{safely-derived pointer} to an object with dynamic storage duration +A pointer value is a \defnadj{safely-derived}{pointer} to an object with dynamic storage duration only if the pointer value has an object pointer type and is one of the following: \begin{itemize} @@ -4211,8 +4207,7 @@ using the alignment specifier\iref{dcl.align}. \pnum -\indextext{alignment!fundamental}% -A \defn{fundamental alignment} is represented by an alignment +A \defnadj{fundamental}{alignment} is represented by an alignment less than or equal to the greatest alignment supported by the implementation in all contexts, which is equal to \tcode{alignof(std::max_align_t)}\iref{support.types}. @@ -4234,10 +4229,7 @@ requirement of the type in the complete-object case. \pnum -\indextext{alignment!extended}% -\indextext{alignment!new-extended}% -\indextext{over-aligned type|see{type, over-aligned}}% -An \defn{extended alignment} is represented by an alignment +An \defnadj{extended}{alignment} is represented by an alignment greater than \tcode{alignof(std::max_align_t)}. It is \impldef{support for extended alignments} whether any extended alignments are supported and the contexts in which they are supported\iref{dcl.align}. A type having an extended alignment @@ -4246,7 +4238,7 @@ Every over-aligned type is or contains a class type to which extended alignment applies (possibly through a non-static data member). \end{note} -A \defn{new-extended alignment} is represented by +A \defnadj{new-extended}{alignment} is represented by an alignment greater than \mname{STDCPP_DEFAULT_NEW_ALIGNMENT}\iref{cpp.predefined}. \pnum @@ -4836,7 +4828,7 @@ are collectively called \defnadjx{implicit-lifetime}{types}{type}. \pnum -A type is a \defn{literal type} if it is: +A type is a \defnadj{literal}{type} if it is: \begin{itemize} \item \cv{}~\tcode{void}; or \item a scalar type; or @@ -5001,9 +4993,8 @@ \defnx{extended integer types}{extended integer type}. \pnum -\indextext{underlying type|see{type, underlying}}% A fundamental type specified to have -a signed or unsigned integer type as its \defn{underlying type} has +a signed or unsigned integer type as its \defnadj{underlying}{type} has the same object representation, value representation, alignment requirements\iref{basic.align}, and @@ -6537,9 +6528,8 @@ storage duration\iref{basic.stc.static} or thread storage duration\iref{basic.stc.thread} is zero-initialized\iref{dcl.init}. Together, zero-initialization and constant initialization are called -\indextext{initialization!dynamic}% -\defn{static initialization}; -all other initialization is \defn{dynamic initialization}. +\defnadj{static}{initialization}; +all other initialization is \defnadj{dynamic}{initialization}. All static initialization strongly happens before\iref{intro.races} any dynamic initialization. \begin{note} diff --git a/source/classes.tex b/source/classes.tex index 0ca6760568..9a28e05747 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -498,7 +498,7 @@ \indextext{definition!class}% The \grammarterm{member-specification} in a class definition declares the full set of members of the class; no member can be added elsewhere. -A \defn{direct member} of a class \tcode{X} is a member of \tcode{X} +A \defnadj{direct}{member} of a class \tcode{X} is a member of \tcode{X} that was first declared within the \grammarterm{member-specification} of \tcode{X}, including anonymous union objects\iref{class.union.anon} and direct members thereof. Members of a class are data members, member @@ -539,19 +539,16 @@ The enumerators of an unscoped enumeration\iref{dcl.enum} defined in the class are members of the class. -\indextext{member!static}% -\indextext{member function!static}% -\indextext{data member!static}% \pnum A data member or member function may be declared \tcode{static} in its \grammarterm{member-declaration}, -in which case it is a \defn{static member} (see~\ref{class.static}) -(a \defn{static data member}\iref{class.static.data} or -\defn{static member function}\iref{class.static.mfct}, respectively) +in which case it is a \defnadj{static}{member} (see~\ref{class.static}) +(a \defnadj{static}{data member}\iref{class.static.data} or +\defnadj{static}{member function}\iref{class.static.mfct}, respectively) of the class. -Any other data member or member function is a \defn{non-static member} -(a \defn{non-static data member} or -\defn{non-static member function}~(\ref{class.mfct.non-static}), respectively). +Any other data member or member function is a \defnadj{non-static}{member} +(a \defnadj{non-static}{data member} or +\defnadj{non-static}{member function}~(\ref{class.mfct.non-static}), respectively). \begin{note} A non-static data member of non-reference type is a member subobject of a class object\iref{intro.object}. @@ -3005,7 +3002,6 @@ \rSec2[class.nest]{Nested class declarations}% \indextext{definition!nested class}% -\indextext{class!nested|see{nested class}} \pnum A class can be declared within another class. A class declared within @@ -3347,9 +3343,8 @@ \end{note} \pnum -\indextext{class!union-like}% \indextext{class!variant member of}% -A \defn{union-like class} is a union or a class that has an anonymous union as a direct +A \defnadj{union-like}{class} is a union or a class that has an anonymous union as a direct member. A union-like class \tcode{X} has a set of \defnx{variant members}{variant member}. If \tcode{X} is a union, a non-static data member of \tcode{X} that is not an anonymous union is a variant member of \tcode{X}. In addition, a non-static data member of an diff --git a/source/declarations.tex b/source/declarations.tex index 756aa69af7..5e06125e0f 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -817,7 +817,7 @@ declares that function to be a \defnx{constexpr function}{specifier!\idxcode{constexpr}!function}. A function or constructor declared with the \tcode{consteval} specifier -is called an \defn{immediate function}. +is called an \defnadj{immediate}{function}. A destructor, an allocation function, or a deallocation function shall not be declared with the \tcode{consteval} specifier. @@ -3614,7 +3614,7 @@ \end{note} \pnum -A \term{non-template function} is a function that is not a function template +A \defnadj{non-template}{function} is a function that is not a function template specialization. \begin{note} A function template is not a function. @@ -5823,10 +5823,7 @@ \end{note} \pnum -A -\indextext{narrowing conversion}% -\indextext{conversion!narrowing}% -\term{narrowing conversion} is an implicit conversion +A \defnadj{narrowing}{conversion} is an implicit conversion \begin{itemize} \item from a floating-point type to an integer type, or @@ -6136,8 +6133,8 @@ \grammarterm{function-body} is of the form \tcode{= delete ;} -is called a \term{deleted definition}. A function with a -deleted definition is also called a \term{deleted function}. +is called a \defnadj{deleted}{definition}. A function with a +deleted definition is also called a \defnadj{deleted}{function}. \pnum A program that refers to a deleted function implicitly or explicitly, other diff --git a/source/iostreams.tex b/source/iostreams.tex index 6a4a4a4aa1..861caab5c3 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -11728,11 +11728,11 @@ operating system dependent\iref{fs.conform.os}. \pnum -An \defn{absolute path} is a path that unambiguously +An \defnadj{absolute}{path} is a path that unambiguously identifies the location of a file without reference to an additional starting location. The elements of a path that determine if it is absolute are operating system dependent. -A \defn{relative path} is +A \defnadj{relative}{path} is a path that is not absolute, and as such, only unambiguously identifies the location of a file when resolved relative to an implied starting location. The elements of a path that determine if it is diff --git a/source/lib-intro.tex b/source/lib-intro.tex index a23f6cbd2f..2c88bbeb16 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -2165,7 +2165,7 @@ or an instantiation of a standard library function template. Unless \tcode{\placeholder{F}} is designated -an \defn{addressable function}, +an \defnadj{addressable}{function}, the behavior of a \Cpp{} program is unspecified (possibly ill-formed) if it explicitly or implicitly attempts to form a pointer diff --git a/source/templates.tex b/source/templates.tex index 51947a4d2e..0d2e02fec3 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -1608,7 +1608,7 @@ \rSec3[temp.constr.atomic]{Atomic constraints} \pnum -An \defn{atomic constraint} is formed from +An \defnadj{atomic}{constraint} is formed from an expression \tcode{E} and a mapping from the template parameters that appear within \tcode{E} to diff --git a/source/threads.tex b/source/threads.tex index c5d0b194f3..3171ca0d83 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -6005,7 +6005,7 @@ \pnum An \defn{asynchronous return object} is an object that reads results from a -shared state. A \defn{waiting function} of an asynchronous return object is one +shared state. A \defnadj{waiting}{function} of an asynchronous return object is one that potentially blocks to wait for the shared state to be made ready. If a waiting function can return before the state is made ready because of a @@ -7125,7 +7125,7 @@ stores \tcode{\placeholdernc{decay-copy}(std::forward(f))} and \tcode{\placeholdernc{decay-\brk{}copy}(std::forward(args))...} in the shared state. These copies of \tcode{f} and \tcode{args} constitute -a \defn{deferred function}. Invocation of the deferred function evaluates +a \defnadj{deferred}{function}. Invocation of the deferred function evaluates \tcode{invoke(std::move(g), std::move(xyz))} where \tcode{g} is the stored value of \tcode{\placeholdernc{decay-copy}(std::forward(f))} and \tcode{xyz} is the stored copy of \tcode{\placeholdernc{decay-copy}(std::forward(args))...}. From 00161209c6b96a5f7ea723182ed44862e2c2e11a Mon Sep 17 00:00:00 2001 From: languagelawyer <38548419+languagelawyer@users.noreply.github.com> Date: Tue, 8 Sep 2020 23:06:28 +0300 Subject: [PATCH 124/250] [intro.object] Say "member subobject" instead of "data member" when talking about objects --- source/basic.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index 1e3f4edb42..d61c72b67f 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -3253,7 +3253,7 @@ \end{itemize} \pnum -If a complete object, a data member\iref{class.mem}, or an array element is of +If a complete object, a member subobject, or an array element is of class type, its type is considered the \defn{most derived class}, to distinguish it from the class type of any base class subobject; an object of a most derived class type or of a non-class type is called a From 61d9481281e2dc36688319886819a4d8249fa362 Mon Sep 17 00:00:00 2001 From: Bruno Ricci Date: Mon, 7 Sep 2020 13:42:25 +0100 Subject: [PATCH 125/250] [expr.prim.lambda.capture] Use the term "local entity". The term "local entity" can be used here now that structured bindings can be captured (after P1091R3 and P1381R1). --- source/expressions.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 16f5c14ff4..9572a95e60 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -1976,8 +1976,7 @@ \end{bnf} \pnum -The body of a \grammarterm{lambda-expression} may refer to variables -with automatic storage duration and the \tcode{*this} object (if any) +The body of a \grammarterm{lambda-expression} may refer to local entities of enclosing block scopes by capturing those entities, as described below. From 88387e213058b99f8bc7684bfeca0eef7eb9ef60 Mon Sep 17 00:00:00 2001 From: languagelawyer <38548419+languagelawyer@users.noreply.github.com> Date: Wed, 12 Aug 2020 16:04:06 +0300 Subject: [PATCH 126/250] [stmt.return] Improve CWG2426 wording --- source/statements.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/statements.tex b/source/statements.tex index 6d4f8bb62b..fcc4a36d66 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -847,7 +847,7 @@ } \end{codeblock} \end{example} -The destructor for the returned object +The destructor for the result object is potentially invoked~(\ref{class.dtor}, \ref{except.ctor}). \begin{example} \begin{codeblock} From e57a3ccca0d428e089dc99afa0682c76e282d324 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 26 Jun 2020 23:23:47 +0200 Subject: [PATCH 127/250] [stmt.block] Rephrase introductory sentence. --- source/statements.tex | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/source/statements.tex b/source/statements.tex index fcc4a36d66..49c3f1825f 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -192,13 +192,11 @@ \end{note} \rSec1[stmt.block]{Compound statement or block}% -\indextext{statement!compound}% \indextext{\idxcode{\{\}}!block statement}% \pnum -So that several statements can be used where one is expected, the -compound statement (also, and equivalently, called ``block'') is -provided. +A \defnadj{compound}{statement} (also known as a block) groups a +sequence of statements into a single statement. \begin{bnf} \nontermdef{compound-statement}\br From e27746fa95535b22f6548bb23adc4111db62ebd7 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Thu, 17 Sep 2020 21:55:12 -0700 Subject: [PATCH 128/250] [everywhere] Reduce width of space after Note: and Example:. Use upright font for : in Preconditions: and friends. --- source/macros.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/macros.tex b/source/macros.tex index e7b2ac6e8a..272e8cc85a 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -266,7 +266,7 @@ \newcommand{\leftshift}[1]{\ensuremath{\mathbin{\mathsf{lshift}_{#1}}}} %% Notes and examples -\newcommand{\noteintro}[1]{[\textit{#1}:\space} +\newcommand{\noteintro}[1]{[\textit{#1}:} \newcommand{\noteoutro}[1]{\textit{\,---\,#1}\kern.5pt]} % \newnoteenvironment{ENVIRON}{BEGIN TEXT}{END TEXT} @@ -286,7 +286,7 @@ %% Library function descriptions \newcommand{\Fundescx}[1]{\textit{#1}} -\newcommand{\Fundesc}[1]{\Fundescx{#1:}\space} +\newcommand{\Fundesc}[1]{\Fundescx{#1}:\space} \newcommand{\recommended}{\Fundesc{Recommended practice}} \newcommand{\required}{\Fundesc{Required behavior}} \newcommand{\constraints}{\Fundesc{Constraints}} From df14fb4792d5d674c6857fd5441199a48617f51c Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 8 Sep 2020 20:15:42 +0200 Subject: [PATCH 129/250] [over.literal] Mark uses of a reserved identifier with 'ill-formed, no diagnostic required'. Also mark grammar terms as appropriate. --- source/overloading.tex | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/overloading.tex b/source/overloading.tex index b40c6d4408..cf9350fea7 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -4271,9 +4271,11 @@ string operator "" _i18n(const char*, std::size_t); // OK template double operator "" _\u03C0(); // OK: UCN for lowercase pi float operator ""_e(const char*); // OK -float operator ""E(const char*); // error: reserved literal suffix~(\ref{usrlit.suffix}, \ref{lex.ext}) -double operator""_Bq(long double); // OK: does not use the reserved identifier \tcode{_Bq}\iref{lex.name} -double operator"" _Bq(long double); // uses the reserved identifier \tcode{_Bq}\iref{lex.name} +float operator ""E(const char*); // ill-formed, no diagnostic required: + // reserved literal suffix~(\ref{usrlit.suffix}, \ref{lex.ext}) +double operator""_Bq(long double); // OK: does not use the reserved \grammarterm{identifier} \tcode{_Bq}\iref{lex.name} +double operator"" _Bq(long double); // ill-formed, no diagnostic required: + // uses the reserved \grammarterm{identifier} \tcode{_Bq}\iref{lex.name} float operator " " B(const char*); // error: non-empty \grammarterm{string-literal} string operator "" 5X(const char*, std::size_t); // error: invalid literal suffix identifier double operator "" _miles(double); // error: invalid \grammarterm{parameter-declaration-clause} From b7194b97a9873bed8869411c59fd5e961bdfa5aa Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 8 Sep 2020 19:42:10 +0200 Subject: [PATCH 130/250] [conv.qual] Fix punctuation in bulleted list. --- source/expressions.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 9572a95e60..2f3e06bc94 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -749,14 +749,14 @@ \begin{itemize} \item for every $i > 0$, $\cv{}^3_i$ is the union of -$\cv{}^1_i$ and $\cv{}^2_i$; +$\cv{}^1_i$ and $\cv{}^2_i$, \item if either $P^1_i$ or $P^2_i$ is ``array of unknown bound of'', -$P^3_i$ is ``array of unknown bound of'', otherwise it is $P^1_i$; +$P^3_i$ is ``array of unknown bound of'', otherwise it is $P^1_i$, and \item if the resulting $\cv{}^3_i$ is different from $\cv{}^1_i$ or $\cv{}^2_i$, or the resulting $P^3_i$ is different from $P^1_i$ or $P^2_i$, -then \tcode{const} is added to every $\cv{}^3_k$ for $0 < k < i$. +then \tcode{const} is added to every $\cv{}^3_k$ for $0 < k < i$, \end{itemize} where $\cv{}^j_i$ and $P^j_i$ are the components of the cv-decomposition of $\tcode{T}j$. From f34af0a8682bf0cef14816ac21d432b8157412f1 Mon Sep 17 00:00:00 2001 From: onihusube <44743040+onihusube@users.noreply.github.com> Date: Sat, 19 Sep 2020 04:58:21 +0900 Subject: [PATCH 131/250] [range.prim.empty] Fix misapplication of P2091R0 Replace "Given a subexpression ranges::empty(E)" with the intended wording "Given a subexpression E". --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 2de5769fff..b95a7fc104 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -792,7 +792,7 @@ object\iref{customization.point.object}. \pnum -Given a subexpression \tcode{ranges::empty(E)} with type \tcode{T}, +Given a subexpression \tcode{E} with type \tcode{T}, let \tcode{t} be an lvalue that denotes the reified object for \tcode{E}. Then: From b5df94380e9d4f0299f63fc378233bc865e7e9f5 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 26 Jun 2020 23:42:02 +0200 Subject: [PATCH 132/250] [iterator.cpp17] Index old-style iterator requirements. --- source/iterators.tex | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index cb30e19c4d..d24884d524 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1889,7 +1889,7 @@ \ref{bidirectional.iterators}, \ref{random.access.iterators}). \pnum -A type \tcode{X} meets the \oldconcept{Iterator} requirements if: +A type \tcode{X} meets the \defnoldconcept{Iterator} requirements if: \begin{itemize} \item \tcode{X} meets the \oldconcept{CopyConstructible}, \oldconcept{CopyAssignable}, and \oldconcept{Destructible} requirements\iref{utility.arg.requirements} and lvalues @@ -1963,7 +1963,7 @@ \end{example} \begin{libreqtab4b} -{\oldconcept{InputIterator} requirements (in addition to \oldconcept{Iterator})} +{\defnoldconcept{InputIterator} requirements (in addition to \oldconcept{Iterator})} {inputiterator} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ @@ -2038,7 +2038,7 @@ are valid and have the indicated semantics. \begin{libreqtab4b}[floattable] -{\oldconcept{OutputIterator} requirements (in addition to \oldconcept{Iterator})} +{\defnoldconcept{OutputIterator} requirements (in addition to \oldconcept{Iterator})} {outputiterator} \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ @@ -2135,7 +2135,7 @@ \end{note} \begin{libreqtab4b}[floattable] -{\oldconcept{ForwardIterator} requirements (in addition to \oldconcept{InputIterator})} +{\defnoldconcept{ForwardIterator} requirements (in addition to \oldconcept{InputIterator})} {forwarditerator} \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ @@ -2171,7 +2171,7 @@ the following expressions are valid as shown in \tref{bidirectionaliterator}. \begin{libreqtab4b}[floattable] -{\oldconcept{BidirectionalIterator} requirements (in addition to \oldconcept{ForwardIterator})} +{\defnoldconcept{BidirectionalIterator} requirements (in addition to \oldconcept{ForwardIterator})} {bidirectionaliterator} \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ @@ -2211,7 +2211,7 @@ the following expressions are valid as shown in \tref{randomaccessiterator}. \begin{libreqtab4b} -{\oldconcept{RandomAccessIterator} requirements (in addition to \oldconcept{BidirectionalIterator})} +{\defnoldconcept{RandomAccessIterator} requirements (in addition to \oldconcept{BidirectionalIterator})} {randomaccessiterator} \\ \topline \lhdr{Expression} & \chdr{Return type} & \chdr{Operational} & \rhdr{Assertion/note} \\ From 224d1f7f40f152165044ab3d06cd137ad3f6fa22 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 23 May 2020 01:26:11 +0200 Subject: [PATCH 133/250] [tuple.special] Index 'swap(tuple, tuple)' as-if a member function. --- source/utilities.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index b3bb30024a..17e80893da 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -2319,7 +2319,7 @@ \rSec2[tuple.special]{Tuple specialized algorithms} -\indexlibraryglobal{swap}% +\indexlibrarymember{swap}{tuple}% \begin{itemdecl} template constexpr void swap(tuple& x, tuple& y) noexcept(@\seebelow@); From 8d0b80be8d92ecba8192c1cab355b626a49d24e6 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 23 May 2020 01:28:24 +0200 Subject: [PATCH 134/250] [range.access] Index customization point objects. --- source/ranges.tex | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/source/ranges.tex b/source/ranges.tex index b95a7fc104..14a3004990 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -351,6 +351,8 @@ \end{itemize} \rSec2[range.access.begin]{\tcode{ranges::begin}} +\indexlibraryglobal{begin}% + \pnum The name \tcode{ranges::begin} denotes a customization point object\iref{customization.point.object}. @@ -415,6 +417,8 @@ \end{note} \rSec2[range.access.end]{\tcode{ranges::end}} +\indexlibraryglobal{end}% + \pnum The name \tcode{ranges::end} denotes a customization point object\iref{customization.point.object}. @@ -486,6 +490,8 @@ \end{note} \rSec2[range.access.cbegin]{\tcode{ranges::cbegin}} +\indexlibraryglobal{cbegin}% + \pnum The name \tcode{ranges::cbegin} denotes a customization point object\iref{customization.point.object}. The expression @@ -503,6 +509,8 @@ \end{note} \rSec2[range.access.cend]{\tcode{ranges::cend}} +\indexlibraryglobal{cend}% + \pnum The name \tcode{ranges::cend} denotes a customization point object\iref{customization.point.object}. The expression @@ -522,6 +530,8 @@ \end{note} \rSec2[range.access.rbegin]{\tcode{ranges::rbegin}} +\indexlibraryglobal{rbegin}% + \pnum The name \tcode{ranges::rbegin} denotes a customization point object\iref{customization.point.object}. @@ -589,6 +599,8 @@ \end{note} \rSec2[range.access.rend]{\tcode{ranges::rend}} +\indexlibraryglobal{rend}% + \pnum The name \tcode{ranges::rend} denotes a customization point object\iref{customization.point.object}. @@ -658,6 +670,8 @@ \end{note} \rSec2[range.access.crbegin]{\tcode{ranges::crbegin}} +\indexlibraryglobal{crbegin}% + \pnum The name \tcode{ranges::crbegin} denotes a customization point object\iref{customization.point.object}. The expression @@ -676,6 +690,8 @@ \end{note} \rSec2[range.access.crend]{\tcode{ranges::crend}} +\indexlibraryglobal{crend}% + \pnum The name \tcode{ranges::crend} denotes a customization point object\iref{customization.point.object}. The expression @@ -696,6 +712,8 @@ \end{note} \rSec2[range.prim.size]{\tcode{ranges::size}} +\indexlibraryglobal{size}% + \pnum The name \tcode{ranges::size} denotes a customization point object\iref{customization.point.object}. @@ -787,6 +805,8 @@ \end{itemize} \rSec2[range.prim.empty]{\tcode{ranges::empty}} +\indexlibraryglobal{empty}% + \pnum The name \tcode{ranges::empty} denotes a customization point object\iref{customization.point.object}. @@ -836,6 +856,8 @@ \end{note} \rSec2[range.prim.data]{\tcode{ranges::data}} +\indexlibraryglobal{data}% + \pnum The name \tcode{ranges::data} denotes a customization point object\iref{customization.point.object}. @@ -887,6 +909,8 @@ \end{note} \rSec2[range.prim.cdata]{\tcode{ranges::cdata}} +\indexlibraryglobal{cdata}% + \pnum The name \tcode{ranges::cdata} denotes a customization point object\iref{customization.point.object}. The expression From 896dea0297a7034aba31eea5db85cc1f072d3c2e Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Sun, 3 May 2020 00:29:33 -0400 Subject: [PATCH 135/250] [dcl.init.ref] Remove "type" from "reference to type T" --- source/declarations.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/declarations.tex b/source/declarations.tex index 5e06125e0f..5bc6ed4789 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -5222,7 +5222,7 @@ \pnum A variable whose declared type is -``reference to type \tcode{T}''\iref{dcl.ref} +``reference to \tcode{T}''\iref{dcl.ref} shall be initialized. \begin{example} \begin{codeblock} From 919e264f1fbd8ce8d6d6f37fb7c9a67890022b3a Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 18 Apr 2020 22:41:04 +0200 Subject: [PATCH 136/250] [std] Improve index for 'freestanding/hosted implementation'. --- source/atomics.tex | 2 ++ source/basic.tex | 2 ++ source/intro.tex | 4 ++-- source/lib-intro.tex | 10 ++++++---- source/preprocessor.tex | 8 ++++++-- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/source/atomics.tex b/source/atomics.tex index 767026e687..6e9719e0c0 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -348,6 +348,7 @@ whose template arguments are integral types, respectively signed and unsigned, and whose \tcode{is_always_lock_free} property is \tcode{true}. \begin{note} +\indextext{implementation!freestanding}% These aliases are optional in freestanding implementations\iref{compliance}. \end{note} Implementations should choose for these aliases @@ -620,6 +621,7 @@ for the corresponding unsigned type\iref{basic.fundamental}, is always lock-free. \begin{note} +\indextext{implementation!freestanding}% This requirement is optional in freestanding implementations\iref{compliance}. \end{note} diff --git a/source/basic.tex b/source/basic.tex index d61c72b67f..64d344fa05 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -5792,6 +5792,7 @@ example, allow executions inconsistent with a simple interleaving, as described below. \end{note} +\indextext{implementation!freestanding}% Under a freestanding implementation, it is \impldef{number of threads in a program under a freestanding implementation} whether a program can have more than one thread of execution. @@ -6416,6 +6417,7 @@ in which the \tcode{main} function is invoked, and in which variables of static storage duration might be initialized\iref{basic.start.static} and destroyed\iref{basic.start.term}. +\indextext{implementation!freestanding}% It is \impldef{defining \tcode{main} in freestanding environment} whether a program in a freestanding environment is required to define a \tcode{main} function. diff --git a/source/intro.tex b/source/intro.tex index 401e767b09..38a7908914 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -769,8 +769,8 @@ \indextext{conformance requirements!library|)} \pnum -Two kinds of implementations are defined: a \defn{hosted implementation} and a -\defn{freestanding implementation}. For a hosted implementation, this +Two kinds of implementations are defined: a \defnadj{hosted}{implementation} and a +\defnadj{freestanding}{implementation}. For a hosted implementation, this document defines the set of available libraries. A freestanding implementation is one in which execution may take place without the benefit of an operating system, and has an \impldef{required libraries for freestanding diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 2c88bbeb16..c605b4d81a 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1170,19 +1170,19 @@ \end{multicolfloattable} \rSec3[compliance]{Freestanding implementations} +\indextext{implementation!freestanding|(}% \pnum Two kinds of implementations are defined: -\defnx{hosted}{implementation!hosted} -and -\defnx{freestanding}{implementation!freestanding}\iref{intro.compliance}; +\indextext{implementation!hosted}% +hosted and freestanding\iref{intro.compliance}; the kind of the implementation is \impldef{whether the implementation is hosted or freestanding}. For a hosted implementation, this document describes the set of available headers. \pnum -A freestanding implementation\indextext{implementation!freestanding} has an +A freestanding implementation has an \impldef{headers for freestanding implementation} set of headers. This set shall include at least the headers shown in \tref{headers.cpp.fs}. @@ -1220,6 +1220,7 @@ and \indexlibraryglobal{quick_exit}% \tcode{quick_exit}\iref{support.start.term}. +\indextext{implementation!hosted}% The supplied version of the header \libheaderrefx{atomic}{atomics.syn} shall meet the same requirements as for a hosted implementation except that support for @@ -1232,6 +1233,7 @@ \tcode{atomic_unsigned_lock_free} in freestanding environments}. The other headers listed in this table shall meet the same requirements as for a hosted implementation. +\indextext{implementation!freestanding|)}% \rSec2[using]{Using the library} diff --git a/source/preprocessor.tex b/source/preprocessor.tex index c4f9582458..60b1c2ee37 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -1671,9 +1671,13 @@ \item \indextext{__stdc_hosted__@\mname{STDC_HOSTED}}% +\indextext{implementation!hosted}% +\indextext{implementation!freestanding}% \mname{STDC_HOSTED}\\ -The integer literal \tcode{1} if the implementation is a hosted -implementation or the integer literal \tcode{0} if it is not. +The integer literal \tcode{1} +if the implementation is a hosted implementation or +the integer literal \tcode{0} +if it is a freestanding implementation\iref{intro.compliance}. \item \indextext{__stdcpp_default_new_alignment__@\mname{STDCPP_DEFAULT_NEW_ALIGNMENT}}% From 4eeb9c683c78ee7bc340fec7863d31042d818195 Mon Sep 17 00:00:00 2001 From: languagelawyer <38548419+languagelawyer@users.noreply.github.com> Date: Sun, 12 Apr 2020 04:41:55 +0300 Subject: [PATCH 137/250] [temp.over] Fix example --- source/templates.tex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/templates.tex b/source/templates.tex index 0d2e02fec3..1f8ecf6c0a 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -9291,9 +9291,8 @@ \tcode{f} is only declared and not defined at the point of the call. The program will be ill-formed unless a specialization for -\tcode{f}, -either implicitly or explicitly generated, -is present in some translation unit. +\tcode{f} +is explicitly instantiated in some translation unit\iref{temp.pre}. \end{example} \indextext{template|)} From 7d6c33c3dd3433385266e2c1bdfd430b4600ed27 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 8 Apr 2020 19:20:15 -0400 Subject: [PATCH 138/250] [class.virtual] Fix example with constrained non-templated function --- source/classes.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/classes.tex b/source/classes.tex index 9a28e05747..8d85864137 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3881,6 +3881,7 @@ A virtual function shall not have a trailing \grammarterm{requires-clause}\iref{dcl.decl}. \begin{example} \begin{codeblock} +template struct A { virtual void f() requires true; // error: virtual function cannot be constrained\iref{temp.constr.decl} }; From 17948fb4c92e4d804de4b406fe93d8c29f5ae2ad Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 8 Apr 2020 18:27:14 -0400 Subject: [PATCH 139/250] [dcl.fct.spec] Remove "class" from "non-static class member function" --- source/declarations.tex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index 5bc6ed4789..8e9a08ecac 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -527,9 +527,8 @@ \pnum \indextext{specifier!\idxcode{virtual}}% -The \tcode{virtual} specifier shall be used only in the initial -declaration of a non-static class member function; -see~\ref{class.virtual}. +The \keyword{virtual} specifier shall be used only in the initial +declaration of a non-static member function; see~\ref{class.virtual}. \pnum \indextext{specifier!\idxcode{explicit}}% From 85e1a60f8d1d0fe2e74c9cad115a6d9e15de5a62 Mon Sep 17 00:00:00 2001 From: Krystian Stasiowski Date: Wed, 25 Mar 2020 16:27:25 -0400 Subject: [PATCH 140/250] [class.union.anon] Turn redundant wording into a note --- source/classes.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/classes.tex b/source/classes.tex index 8d85864137..7e1b9915e6 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3323,6 +3323,7 @@ member functions. \pnum +\begin{note} A union for which objects, pointers, or references are declared is not an anonymous union. \begin{example} \begin{codeblock} @@ -3337,6 +3338,7 @@ is not visible outside the union, and even if it were visible, it is not associated with any particular object. \end{example} +\end{note} \begin{note} Initialization of unions with no user-declared constructors is described in~\ref{dcl.init.aggr}. From 6449dfa67c423f384fb017ed5d58a22daeff4ff4 Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Thu, 12 Dec 2019 17:10:57 -0800 Subject: [PATCH 141/250] [cmp.categories.pre] Remove unused enumerators Fixes #3541. --- source/support.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/support.tex b/source/support.tex index 02e8a5bab8..1ed39abe32 100644 --- a/source/support.tex +++ b/source/support.tex @@ -4084,8 +4084,7 @@ from one of the following exposition-only enumerations: \begin{codeblock} -enum class @\placeholdernc{eq}@ { @\placeholdernc{equal}@ = 0, @\placeholdernc{equivalent}@ = @\placeholdernc{equal}@, - @\placeholdernc{nonequal}@ = 1, @\placeholdernc{nonequivalent}@ = @\placeholdernc{nonequal}@ }; // \expos +enum class @\placeholdernc{eq}@ { @\placeholdernc{equal}@ = 0, @\placeholdernc{equivalent}@ = @\placeholdernc{equal}@ }; // \expos enum class @\placeholdernc{ord}@ { @\placeholdernc{less}@ = -1, @\placeholdernc{greater}@ = 1 }; // \expos enum class @\placeholdernc{ncmp}@ { @\placeholdernc{unordered}@ = -127 }; // \expos \end{codeblock} From 0d60e4763c4fbb526a710838587ae00a5dbfc0ae Mon Sep 17 00:00:00 2001 From: Casey Carter Date: Tue, 14 Jan 2020 13:10:35 -0800 Subject: [PATCH 142/250] [cmp.categories.pre] Merge enumerators from eq into ord --- source/support.tex | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/source/support.tex b/source/support.tex index 1ed39abe32..fc046fc175 100644 --- a/source/support.tex +++ b/source/support.tex @@ -4084,9 +4084,8 @@ from one of the following exposition-only enumerations: \begin{codeblock} -enum class @\placeholdernc{eq}@ { @\placeholdernc{equal}@ = 0, @\placeholdernc{equivalent}@ = @\placeholdernc{equal}@ }; // \expos -enum class @\placeholdernc{ord}@ { @\placeholdernc{less}@ = -1, @\placeholdernc{greater}@ = 1 }; // \expos -enum class @\placeholdernc{ncmp}@ { @\placeholdernc{unordered}@ = -127 }; // \expos +enum class @\placeholdernc{ord}@ { @\placeholdernc{equal}@ = 0, @\placeholdernc{equivalent}@ = @\placeholdernc{equal}@, @\placeholdernc{less}@ = -1, @\placeholdernc{greater}@ = 1 }; // \expos +enum class @\placeholdernc{ncmp}@ { @\placeholdernc{unordered}@ = -127 }; // \expos \end{codeblock} \pnum @@ -4137,8 +4136,6 @@ bool is_ordered; // \expos // exposition-only constructors - constexpr explicit - partial_ordering(@\placeholder{eq}@ v) noexcept : value(int(v)), is_ordered(true) {} // \expos constexpr explicit partial_ordering(@\placeholder{ord}@ v) noexcept : value(int(v)), is_ordered(true) {} // \expos constexpr explicit @@ -4168,7 +4165,7 @@ // valid values' definitions inline constexpr partial_ordering partial_ordering::less(@\placeholder{ord}@::@\placeholder{less}@); - inline constexpr partial_ordering partial_ordering::equivalent(@\placeholder{eq}@::@\placeholder{equivalent}@); + inline constexpr partial_ordering partial_ordering::equivalent(@\placeholder{ord}@::@\placeholder{equivalent}@); inline constexpr partial_ordering partial_ordering::greater(@\placeholder{ord}@::@\placeholder{greater}@); inline constexpr partial_ordering partial_ordering::unordered(@\placeholder{ncmp}@::@\placeholder{unordered}@); } @@ -4250,7 +4247,6 @@ int value; // \expos // exposition-only constructors - constexpr explicit weak_ordering(@\placeholder{eq}@ v) noexcept : value(int(v)) {} // \expos constexpr explicit weak_ordering(@\placeholder{ord}@ v) noexcept : value(int(v)) {} // \expos public: @@ -4279,7 +4275,7 @@ // valid values' definitions inline constexpr weak_ordering weak_ordering::less(@\placeholder{ord}@::@\placeholder{less}@); - inline constexpr weak_ordering weak_ordering::equivalent(@\placeholder{eq}@::@\placeholder{equivalent}@); + inline constexpr weak_ordering weak_ordering::equivalent(@\placeholder{ord}@::@\placeholder{equivalent}@); inline constexpr weak_ordering weak_ordering::greater(@\placeholder{ord}@::@\placeholder{greater}@); } \end{codeblock} @@ -4376,7 +4372,6 @@ int value; // \expos // exposition-only constructors - constexpr explicit strong_ordering(@\placeholder{eq}@ v) noexcept : value(int(v)) {} // \expos constexpr explicit strong_ordering(@\placeholder{ord}@ v) noexcept : value(int(v)) {} // \expos public: @@ -4407,8 +4402,8 @@ // valid values' definitions inline constexpr strong_ordering strong_ordering::less(@\placeholder{ord}@::@\placeholder{less}@); - inline constexpr strong_ordering strong_ordering::equal(@\placeholder{eq}@::@\placeholder{equal}@); - inline constexpr strong_ordering strong_ordering::equivalent(@\placeholder{eq}@::@\placeholder{equivalent}@); + inline constexpr strong_ordering strong_ordering::equal(@\placeholder{ord}@::@\placeholder{equal}@); + inline constexpr strong_ordering strong_ordering::equivalent(@\placeholder{ord}@::@\placeholder{equivalent}@); inline constexpr strong_ordering strong_ordering::greater(@\placeholder{ord}@::@\placeholder{greater}@); } \end{codeblock} From 456dfc36c129835144a13df6ac7b789516073d12 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 19 Sep 2020 01:07:26 +0200 Subject: [PATCH 143/250] [concepts.equality] Replace spurious 'this document' with 'the library Clauses'. --- source/concepts.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index 39b12f528a..d68d1fa131 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -53,7 +53,7 @@ input values for which the expression is required to be well-defined. \pnum -Expressions required by this document to be equality-preserving are further +Expressions required to be equality-preserving are further required to be stable: two evaluations of such an expression with the same input objects are required to have equal outputs absent any explicit intervening modification of those input objects. @@ -69,7 +69,7 @@ \end{note} \pnum -Expressions declared in a \grammarterm{requires-expression} in this document are +Expressions declared in a \grammarterm{requires-expression} in the library clauses are required to be equality-preserving, except for those annotated with the comment ``not required to be equality-preserving.'' An expression so annotated may be equality-preserving, but is not required to be so. @@ -77,7 +77,7 @@ \pnum An expression that may alter the value of one or more of its inputs in a manner observable to equality-preserving expressions is said to modify those inputs. -This document uses a notational convention to specify which expressions declared +The library clauses use a notational convention to specify which expressions declared in a \grammarterm{requires-expression} modify which inputs: except where otherwise specified, an expression operand that is a non-constant lvalue or rvalue may be modified. Operands that are constant lvalues or rvalues are From 7cdb8ea25537cc8bece8d1d151fc05dddd0376db Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 20 Sep 2020 22:14:29 +0200 Subject: [PATCH 144/250] [fs.norm.ref] Dissolve subclause. There should only be one subclause called "normative references". --- source/iostreams.tex | 14 +------------- source/utilities.tex | 7 ++++++- source/xrefdelta.tex | 3 +++ 3 files changed, 10 insertions(+), 14 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 861caab5c3..ceea905a5a 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -11319,7 +11319,7 @@ \rSec3[fs.conform.9945]{POSIX conformance} \pnum -Some behavior is specified by reference to POSIX\iref{fs.norm.ref}. How such behavior is actually implemented is unspecified. +Some behavior is specified by reference to POSIX. How such behavior is actually implemented is unspecified. \begin{note} This constitutes an ``as if'' rule allowing implementations to call native @@ -11384,18 +11384,6 @@ is unreasonable for a program to detect them prior to calling the function. \end{note} -\rSec2[fs.norm.ref]{Normative references} - -\pnum -Subclause~\ref{filesystems} mentions commercially -available operating systems for purposes of exposition.\footnote{ -POSIX\textregistered\ is a registered trademark of The IEEE\@. -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 these -products. -} - \rSec2[fs.req]{Requirements} \rSec3[fs.req.general]{General} diff --git a/source/utilities.tex b/source/utilities.tex index 17e80893da..43556ca766 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -19587,7 +19587,12 @@ Implementations should use a Unicode encoding on platforms capable of displaying Unicode text in a terminal. \begin{note} -This is the case for Windows-based and many POSIX-based operating systems. +This is the case for Windows% +\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.}-based and +many POSIX-based operating systems. \end{note} \pnum diff --git a/source/xrefdelta.tex b/source/xrefdelta.tex index aab569f664..c32c795cfc 100644 --- a/source/xrefdelta.tex +++ b/source/xrefdelta.tex @@ -21,6 +21,9 @@ % [facets.examples] was removed. \removedxref{facets.examples} +% Local normative references for filesystems were removed. +\removedxref{fs.norm.ref} + % Renamed sections. %\movedxref{old.label}{new.label} %\movedxrefii{old.label}{new.label.1}{new.label.2} From 44e87a142001c5fb88b6f2d00c90509304e4d849 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 19 Sep 2020 10:14:45 +0200 Subject: [PATCH 145/250] [cpp.predefined] Shuffle items to avoid an unfortunate page break. --- source/preprocessor.tex | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 60b1c2ee37..51c5677c6e 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -1633,11 +1633,18 @@ \xname{cplusplus}\\ The integer literal \tcode{\cppver}. \begin{note} -It is intended that future -revisions of \Cpp{} will +Future revisions of \Cpp{} will replace the value of this macro with a greater value. \end{note} +\item The names listed in \tref{cpp.predefined.ft}.\\ +The macros defined in \tref{cpp.predefined.ft} shall be defined to +the corresponding integer literal. +\begin{note} +Future revisions of \Cpp{} might replace +the values of these macros with greater values. +\end{note} + \item \indextext{__date__@\mname{DATE}}% \mname{DATE}\\ @@ -1702,14 +1709,6 @@ function. If the time of translation is not available, an \impldef{text of \mname{TIME} when time of translation is not available} valid time shall be supplied. - -\item The names listed in \tref{cpp.predefined.ft}.\\ -The macros defined in \tref{cpp.predefined.ft} shall be defined to -the corresponding integer literal. -\begin{note} -Future revisions of \Cpp{} might replace -the values of these macros with greater values. -\end{note} \end{description} \begin{LongTable}{Feature-test macros}{cpp.predefined.ft}{ll} From d6219ad94cfdc341ff6364f44d8725c30f26e1ff Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 20 Sep 2020 21:04:53 +0200 Subject: [PATCH 146/250] [vector.cons] Fix subclause heading. Remove mention of "assignment", which is not specified here. --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 74d65dcc9c..1fe1f11ba9 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -5702,7 +5702,7 @@ \tcode{T} shall be complete before any member of the resulting specialization of \tcode{vector} is referenced. -\rSec3[vector.cons]{Constructors, copy, and assignment} +\rSec3[vector.cons]{Constructors} \indexlibraryctor{vector} \begin{itemdecl} From dc69425d3fdfc7da9e55103ae7a13d03c80c0180 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 21 Sep 2020 12:58:22 -0700 Subject: [PATCH 147/250] [over.match.best.general] Remove mid-sentence period. --- source/overloading.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/overloading.tex b/source/overloading.tex index cf9350fea7..2071a2f8b0 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -2055,7 +2055,7 @@ \tcode{F1} is a constructor for a class \tcode{D}, \tcode{F2} is a constructor for a base class \tcode{B} of \tcode{D}, and for all arguments -the corresponding parameters of \tcode{F1} and \tcode{F2} have the same type. +the corresponding parameters of \tcode{F1} and \tcode{F2} have the same type \begin{example} \begin{codeblock} struct A { From dc4dc7eb14037d717f089d87efeef611f185536f Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 12 Sep 2020 07:37:58 +0200 Subject: [PATCH 148/250] [std] Replace 'might' in normative context. Partially addresses ISO/CS 017 (C++20 DIS) --- source/algorithms.tex | 2 +- source/basic.tex | 16 +++++++--------- source/classes.tex | 7 ++++++- source/containers.tex | 5 ++--- source/declarations.tex | 2 +- source/iostreams.tex | 6 +++--- source/overloading.tex | 4 ++-- source/preprocessor.tex | 2 +- source/templates.tex | 2 +- source/time.tex | 2 +- source/utilities.tex | 6 +++--- 11 files changed, 28 insertions(+), 26 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index aaa81b5a5f..d5525d8100 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -354,7 +354,7 @@ \tcode{BinaryOperation1}, \tcode{BinaryOperation2}, and the operators used by the analogous overloads to these parallel algorithms -that could be formed by the invocation +that are formed by an invocation with the specified default predicate or operation (where applicable) shall not directly or indirectly modify objects via their arguments, nor shall they rely on the identity of the provided objects. diff --git a/source/basic.tex b/source/basic.tex index 64d344fa05..70d8476951 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -2635,7 +2635,7 @@ \pnum \indextext{translation unit}% -A name is said to have \defn{linkage} when it might denote the same +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} @@ -4211,7 +4211,7 @@ less than or equal to the greatest alignment supported by the implementation in all contexts, which is equal to \tcode{alignof(std::max_align_t)}\iref{support.types}. -The alignment required for a type might be different when it is used as the type +The alignment required for a type may be different when it is used as the type of a complete object and when it is used as the type of a subobject. \begin{example} \begin{codeblock} @@ -4750,14 +4750,14 @@ incomplete type. \pnum -A class type (such as ``\tcode{class X}'') might be incomplete at one +A class type (such as ``\tcode{class X}'') can be incomplete at one point in a translation unit and complete later on; the type ``\tcode{class X}'' is the same type at both points. The declared type -of an array object might be an array of incomplete class type and +of an array object can be an array of incomplete class type and therefore incomplete; if the class type is completed later on in the translation unit, the array type becomes complete; the array type at those two points is the same type. The declared type of an array object -might be an array of unknown bound and therefore be incomplete at one +can be an array of unknown bound and therefore be incomplete at one point in a translation unit and complete later on; the array types at those two points (``array of unknown bound of \tcode{T}'' and ``array of \tcode{N} \tcode{T}'') are different types. The type of a pointer to array of @@ -5746,7 +5746,7 @@ \end{example} The sequencing constraints on the execution of the called function (as described above) are features of the function calls as evaluated, -whatever the syntax of the expression that calls the function might be.% +regardless of the syntax of the expression that calls the function.% \indextext{value computation|)}% \indextext{behavior!on receipt of signal}% @@ -6414,9 +6414,7 @@ A program shall contain a global function called \tcode{main} attached to the global module. Executing a program starts a main thread of execution~(\ref{intro.multithread}, \ref{thread.threads}) -in which the \tcode{main} function is invoked, -and in which variables of static storage duration -might be initialized\iref{basic.start.static} and destroyed\iref{basic.start.term}. +in which the \tcode{main} function is invoked. \indextext{implementation!freestanding}% It is \impldef{defining \tcode{main} in freestanding environment} whether a program in a freestanding environment is required to define a \tcode{main} diff --git a/source/classes.tex b/source/classes.tex index 7e1b9915e6..185b68fae9 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -2301,11 +2301,13 @@ derived classes. Bases and members are destroyed in the reverse order of the completion of their constructor (see~\ref{class.base.init}). +\begin{note} A \tcode{return} statement\iref{stmt.return} in a destructor might not directly return to the caller; before transferring control to the caller, the destructors for the members and bases are called. +\end{note} \indextext{order of execution!destructor and array}% Destructors for elements of an array are called in reverse order of their construction (see~\ref{class.init}). @@ -6594,7 +6596,8 @@ a variable of automatic storage duration that is either a non-volatile object or an rvalue reference to a non-volatile object type. -In the following copy-initialization contexts, a move operation might be used instead of a copy operation: +In the following copy-initialization contexts, +a move operation is first considered before attempting a copy operation: \begin{itemize} \item If the \grammarterm{expression} in a \tcode{return}\iref{stmt.return} or \tcode{co_return}\iref{stmt.return.coroutine} statement @@ -7203,8 +7206,10 @@ \pnum Access to the deallocation function is checked statically. +\begin{note} Hence, even though a different one might actually be executed, the statically visible deallocation function is required to be accessible. +\end{note} \begin{example} For the call on line ``// 1'' above, if diff --git a/source/containers.tex b/source/containers.tex index 1fe1f11ba9..74af0672c6 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -768,8 +768,7 @@ \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, such as \tcode{stack}s or \tcode{queue}s, out of -the basic sequence container kinds (or out of other kinds of sequence containers that the user -might define). +the basic sequence container kinds (or out of other kinds of sequence containers that the user defines). \pnum \begin{note} @@ -2873,7 +2872,7 @@ \indexunordmem{max_bucket_count}% \tcode{b.max_bucket_count()} & \tcode{size_type} -& \returns An upper bound on the number of buckets that \tcode{b} might +& \returns An upper bound on the number of buckets that \tcode{b} can ever contain.% & Constant \\ \rowsep diff --git a/source/declarations.tex b/source/declarations.tex index 8e9a08ecac..5fabee5aa0 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -6085,7 +6085,7 @@ shall provide implicit definitions for them~(\ref{class.ctor}, \ref{class.dtor}, \ref{class.copy.ctor}, \ref{class.copy.assign}), -which might mean defining them as deleted. +including possibly defining them as deleted. A defaulted prospective destructor\iref{class.dtor} that is not a destructor is defined as deleted. A defaulted special member function diff --git a/source/iostreams.tex b/source/iostreams.tex index ceea905a5a..21f8922afb 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -6138,7 +6138,7 @@ to generate the requested output. If the generation fails, then the formatted output function does \tcode{setstate(ios_base::failbit)}, -which might throw an exception. +which can throw an exception. If an exception is thrown during output, then \tcode{ios_base::badbit} is turned on\footnote{without causing an @@ -9620,8 +9620,8 @@ \pnum \remarks An -implementation might well provide an overriding definition for this function -signature if it can determine that more characters can be read from the input +implementation may provide an overriding definition for this function +signature if it can determine whether more characters can be read from the input sequence. \end{itemdescr} diff --git a/source/overloading.tex b/source/overloading.tex index 2071a2f8b0..7ba2afaa92 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -732,7 +732,7 @@ which the \grammarterm{postfix-expression} ultimately contains a name that -denotes one or more functions that might be called. +denotes one or more functions. Such a \grammarterm{postfix-expression}, perhaps nested arbitrarily deep in @@ -985,7 +985,7 @@ \pnum If either operand has a type that is a class or an enumeration, a -user-defined operator function might be declared that implements +user-defined operator function can be declared that implements this operator or a user-defined conversion can be necessary to convert the operand to a type that is appropriate for a built-in operator. diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 51c5677c6e..6d57b04bf6 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -1605,7 +1605,7 @@ \end{ncsimplebnf} causes the implementation to behave in an \impldef{\tcode{\#pragma}} manner. -The behavior might cause translation to fail or cause the translator or +The behavior may cause translation to fail or cause the translator or the resulting program to behave in a non-conforming manner. Any pragma that is not recognized by the implementation is ignored. diff --git a/source/templates.tex b/source/templates.tex index 1f8ecf6c0a..37217a440a 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -3891,7 +3891,7 @@ \indextext{overloading!resolution!template}% \indextext{ordering!function template partial|see{template, function, partial ordering}}% If a function template is overloaded, -the use of a function template specialization might be ambiguous because +the use of a function template specialization can be ambiguous because template argument deduction\iref{temp.deduct} may associate the function template specialization with more than one function template declaration. \defnx{Partial ordering}{template!function!partial ordering} diff --git a/source/time.tex b/source/time.tex index a4c63f6eb3..898ca57c2d 100644 --- a/source/time.tex +++ b/source/time.tex @@ -1058,7 +1058,7 @@ \pnum The \tcode{duration} template uses the \tcode{duration_values} trait to construct special values of the duration's representation (\tcode{Rep}). This is -done because the representation might be a class type with behavior which +done because the representation can be a class type with behavior that requires some other implementation to return these special values. In that case, the author of that class type should specialize \tcode{duration_values} to return the indicated values. diff --git a/source/utilities.tex b/source/utilities.tex index 43556ca766..014cb69560 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -4580,7 +4580,7 @@ \tcode{t} are as defined by the exception safety guarantee of the assignment expression; \tcode{valueless_by_exception()} will be \tcode{false}. \item If an exception is thrown during the initialization of the contained value, -the \tcode{variant} object might not hold a value. +the \tcode{variant} object is permitted to not hold a value. \end{itemize} \end{itemdescr} @@ -4664,7 +4664,7 @@ \pnum \remarks If an exception is thrown during the initialization of the contained value, -the \tcode{variant} might not hold a value. +the \tcode{variant} is permitted to not hold a value. \end{itemdescr} \indexlibrarymember{emplace}{variant}% @@ -4705,7 +4705,7 @@ \pnum \remarks If an exception is thrown during the initialization of the contained value, -the \tcode{variant} might not hold a value. +the \tcode{variant} is permitted to not hold a value. \end{itemdescr} \rSec3[variant.status]{Value status} From 4a5c4a16e63f442a392dd5144632b83992adb2cd Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 13 Sep 2020 21:05:37 +0200 Subject: [PATCH 149/250] [std] Replace 'may' in notes. Partially addresses ISO/CS 017 (C++20 DIS) --- source/algorithms.tex | 40 ++++++++++++++++++++-------------------- source/atomics.tex | 12 +++++------- source/basic.tex | 34 ++++++++++++++++------------------ source/classes.tex | 31 +++++++++++++++---------------- source/concepts.tex | 2 +- source/containers.tex | 12 ++++++------ source/declarations.tex | 26 ++++++++++++-------------- source/diagnostics.tex | 2 +- source/expressions.tex | 30 +++++++++++++++--------------- source/future.tex | 2 +- source/intro.tex | 2 +- source/iostreams.tex | 22 +++++++++++----------- source/lex.tex | 8 ++++---- source/lib-intro.tex | 6 +++--- source/locales.tex | 6 +++--- source/numerics.tex | 8 ++++---- source/overloading.tex | 2 +- source/preprocessor.tex | 2 +- source/regex.tex | 2 +- source/statements.tex | 4 ++-- source/strings.tex | 4 ++-- source/support.tex | 18 +++++++++--------- source/templates.tex | 32 ++++++++++++++++---------------- source/threads.tex | 2 +- source/time.tex | 12 ++++++------ source/utilities.tex | 26 +++++++++++++------------- 26 files changed, 170 insertions(+), 177 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index d5525d8100..47ca8e7497 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -262,8 +262,8 @@ The number and order of deducible template parameters for algorithm declarations are unspecified, except where explicitly stated otherwise. \begin{note} -Consequently, the algorithms may not -be called with explicitly-specified template argument lists. +Consequently, an implementation can reject calls +that specify an explicit template argument list. \end{note} \rSec1[algorithms.parallel]{Parallel algorithms} @@ -389,7 +389,7 @@ where \tcode{is_trivially_copy_constructible_v} and \tcode{is_trivially_destructible_v} are \tcode{true}. \begin{note} -This implies that user-supplied function objects should not rely on +This implies that user-supplied function objects cannot rely on object identity of arguments for such input sequences. Users for whom the object identity of the arguments to these function objects is important should consider using a wrapping iterator @@ -414,7 +414,7 @@ unsequenced with respect to one another in the calling thread of execution. \begin{note} This means that multiple function object invocations -may be interleaved on a single thread of execution, +can be interleaved on a single thread of execution, which overrides the usual guarantee from \ref{intro.execution} that function executions do not overlap with one another. \end{note} @@ -500,7 +500,7 @@ or threads of execution implicitly created by the library; the latter will provide weakly parallel forward progress guarantees. \begin{note} -This means that multiple function object invocations may be interleaved +This means that multiple function object invocations can be interleaved on a single thread of execution, which overrides the usual guarantee from \ref{intro.execution} that function executions do not overlap with one another. @@ -3153,7 +3153,7 @@ starting from \tcode{first} and proceeding to \tcode{last - 1}. \begin{note} If the type of \tcode{first} meets the requirements of a mutable iterator, -\tcode{f} may apply non-constant functions through the dereferenced iterator. +\tcode{f} can apply non-constant functions through the dereferenced iterator. \end{note} \pnum @@ -3188,7 +3188,7 @@ every iterator in the range \range{first}{last}. \begin{note} If the type of \tcode{first} meets the requirements of a mutable iterator, -\tcode{f} may apply non-constant functions through the dereferenced iterator. +\tcode{f} can apply non-constant functions through the dereferenced iterator. \end{note} \pnum @@ -3205,7 +3205,7 @@ \pnum \begin{note} Does not return a copy of its \tcode{Function} parameter, -since parallelization may not permit efficient state accumulation. +since parallelization often does not permit efficient state accumulation. \end{note} \end{itemdescr} @@ -3229,7 +3229,7 @@ starting from \tcode{first} and proceeding to \tcode{last - 1}. \begin{note} If the result of \tcode{invoke(proj, *i)} is a mutable reference, -\tcode{f} may apply non-constant functions. +\tcode{f} can apply non-constant functions. \end{note} \pnum @@ -3281,7 +3281,7 @@ every iterator in the range \range{first}{first + n} in order. \begin{note} If the type of \tcode{first} meets the requirements of a mutable iterator, -\tcode{f} may apply non-constant functions through the dereferenced iterator. +\tcode{f} can apply non-constant functions through the dereferenced iterator. \end{note} \pnum @@ -3320,7 +3320,7 @@ every iterator in the range \range{first}{first + n}. \begin{note} If the type of \tcode{first} meets the requirements of a mutable iterator, -\tcode{f} may apply non-constant functions through the dereferenced iterator. +\tcode{f} can apply non-constant functions through the dereferenced iterator. \end{note} \pnum @@ -3355,7 +3355,7 @@ \range{first}{first + n} in order. \begin{note} If the result of \tcode{invoke(proj, *i)} is a mutable reference, -\tcode{f} may apply non-constant functions. +\tcode{f} can apply non-constant functions. \end{note} \pnum @@ -4399,7 +4399,7 @@ do not overlap. \begin{note} For the overload with an \tcode{ExecutionPolicy}, -there may be a performance cost +there might be a performance cost if \tcode{iterator_traits::value_type} is not \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}). \end{note} @@ -5297,7 +5297,7 @@ do not overlap. \begin{note} For the overloads with an \tcode{ExecutionPolicy}, -there may be a performance cost +there might be a performance cost if \tcode{iterator_traits::value_type} does not meet the \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}) requirements. \end{note} @@ -5484,7 +5484,7 @@ \oldconcept{CopyAssignable} requirements. \begin{note} For the overloads with an \tcode{ExecutionPolicy}, - there may be a performance cost + there might be a performance cost if the value type of \tcode{ForwardIterator1} does not meet both the \oldconcept{CopyConstructible} and \oldconcept{CopyAssignable} requirements. \end{note} @@ -7020,7 +7020,7 @@ \begin{note} For the overload with an \tcode{ExecutionPolicy}, -there may be a performance cost if \tcode{first}'s value type +there might be a performance cost if \tcode{first}'s value type does not meet the \oldconcept{CopyConstructible} requirements. \end{note} @@ -9538,7 +9538,7 @@ that \tcode{exclusive_scan} excludes the $i^\text{th}$ input element from the $i^\text{th}$ sum. If \tcode{binary_op} is not mathematically associative, -the behavior of \tcode{exclusive_scan} may be nondeterministic. +the behavior of \tcode{exclusive_scan} might be nondeterministic. \end{note} \end{itemdescr} @@ -9665,7 +9665,7 @@ that \tcode{inclusive_scan} includes the $i^\text{th}$ input element in the $i^\text{th}$ sum. If \tcode{binary_op} is not mathematically associative, -the behavior of \tcode{inclusive_scan} may be nondeterministic. +the behavior of \tcode{inclusive_scan} might be nondeterministic. \end{note} \end{itemdescr} @@ -9740,7 +9740,7 @@ \tcode{transform_inclusive_scan} is that \tcode{trans\-form\-_\-exclusive_scan} excludes the $i^\text{th}$ input element from the $i^\text{th}$ sum. If \tcode{binary_op} is not mathematically associative, -the behavior of \tcode{transform_exclusive_scan} may be nondeterministic. +the behavior of \tcode{transform_exclusive_scan} might be nondeterministic. \tcode{transform_exclusive_scan} does not apply \tcode{unary_op} to \tcode{init}. \end{note} @@ -9844,7 +9844,7 @@ \tcode{transform_inclusive_scan} is that \tcode{trans\-form\-_\-inclusive_scan} includes the $i^\text{th}$ input element in the $i^\text{th}$ sum. If \tcode{binary_op} is not mathematically associative, -the behavior of \tcode{transform_inclusive_scan} may be nondeterministic. +the behavior of \tcode{transform_inclusive_scan} might be nondeterministic. \tcode{transform_inclusive_scan} does not apply \tcode{unary_op} to \tcode{init}. \end{note} diff --git a/source/atomics.tex b/source/atomics.tex index 6e9719e0c0..bdf1cf6965 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -528,7 +528,7 @@ r2 = x.load(memory_order::relaxed); y.store(r2, memory_order::relaxed); \end{codeblock} -should not produce \tcode{r1 == r2 == 42}, since the store of 42 to \tcode{y} is only +this recommendation discourages producing \tcode{r1 == r2 == 42}, since the store of 42 to \tcode{y} is only possible if the store to \tcode{x} stores \tcode{42}, which circularly depends on the store to \tcode{y} storing \tcode{42}. Note that without this restriction, such an execution is possible. @@ -636,8 +636,9 @@ block\iref{intro.progress}. \pnum +Operations that are lock-free should also be address-free. \begin{note} -Operations that are lock-free should also be address-free. That is, +That is, atomic operations on the same memory location via two different addresses will communicate atomically. The implementation should not depend on any per-process state. This restriction enables communication by memory that is @@ -1603,7 +1604,7 @@ is \tcode{false}. \begin{note} Type arguments that are -not also statically initializable may be difficult to use. +not also statically initializable might be difficult to use. \end{note} \pnum @@ -3443,10 +3444,7 @@ \pnum Operations on an object of type \tcode{atomic_flag} shall be lock-free. -\begin{note} -Hence -the operations should also be address-free. -\end{note} +The operations should also be address-free. \pnum The \tcode{atomic_flag} type is a standard-layout struct. diff --git a/source/basic.tex b/source/basic.tex index 70d8476951..c0c8673b42 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -692,10 +692,10 @@ The entity is still declared in multiple translation units, and \ref{basic.link} still applies to these declarations. In particular, \grammarterm{lambda-expression}{s}\iref{expr.prim.lambda} -appearing in the type of \tcode{D} may result +appearing in the type of \tcode{D} might result in the different declarations having distinct types, and \grammarterm{lambda-expression}{s} appearing in a default argument of \tcode{D} -may still denote different types in different translation units. +might still denote different types in different translation units. \end{note} \pnum @@ -822,9 +822,9 @@ a name is introduced, which is not necessarily the same as the region in which the declaration occurs. In particular, \grammarterm{elaborated-type-specifier}{s}\iref{dcl.type.elab} and -friend declarations\iref{class.friend} may introduce a (possibly not +friend declarations\iref{class.friend} can introduce a (possibly not visible) name into an enclosing namespace; these restrictions apply to -that region. Local extern declarations\iref{basic.link} may introduce +that region. Local extern declarations\iref{basic.link} can introduce a name into the declarative region where the declaration appears and also introduce a (possibly not visible) name into an enclosing namespace; these restrictions apply to both regions. @@ -2834,7 +2834,7 @@ \grammarterm{using-directive}{s} do not declare entities. Enumerators do not have linkage, -but may serve as the name of an enumeration with linkage\iref{dcl.enum}. +but might serve as the name of an enumeration with linkage\iref{dcl.enum}. \end{note} \pnum @@ -4538,7 +4538,7 @@ \item A temporary bound to a reference in a \grammarterm{new-initializer}\iref{expr.new} persists until the completion of the full-expression containing the \grammarterm{new-initializer}. \begin{note} -This may introduce a dangling reference. +This might introduce a dangling reference. \end{note} \begin{example} \begin{codeblock} @@ -5809,7 +5809,7 @@ initial value of the object, a value assigned to the object by $T$, or a value assigned to the object by another thread, according to the rules below. \begin{note} -In some cases, there may instead be undefined behavior. Much of this +In some cases, there might instead be undefined behavior. Much of this subclause is motivated by the desire to support atomic operations with explicit and detailed visibility constraints. However, it also implicitly supports a simpler view for more restricted programs. @@ -5852,7 +5852,7 @@ There is a separate order for each atomic object. There is no requirement that these can be combined into a single total order for all objects. In general this will be impossible since different -threads may observe modifications to different objects in inconsistent orders. +threads might observe modifications to different objects in inconsistent orders. \end{note} \pnum @@ -6181,14 +6181,14 @@ execution would not have encountered a data race. This includes implementations of data member assignment that overwrite adjacent members in separate memory locations. Reordering of atomic loads in cases in which the atomics in question -may alias is also generally precluded, since this may violate the coherence +might alias is also generally precluded, since this could violate the coherence rules. \end{note} \pnum \begin{note} Transformations that introduce a speculative read of a potentially -shared memory location may not preserve the semantics of the \Cpp{} program as +shared memory location might not preserve the semantics of the \Cpp{} program as defined in this document, since they potentially introduce a data race. However, they are typically valid in the context of an optimizing compiler that targets a specific machine with well-defined semantics for data races. They would be @@ -6224,7 +6224,7 @@ a lock-free execution in that thread shall complete. \begin{note} Concurrently executing threads - may prevent progress of a lock-free execution. + might prevent progress of a lock-free execution. For example, this situation can occur with load-locked store-conditional implementations. @@ -6238,7 +6238,7 @@ to provide absolute guarantees to this effect, since repeated and particularly inopportune interference from other threads - may prevent forward progress, + could prevent forward progress, e.g., by repeatedly stealing a cache line for unrelated purposes @@ -6306,9 +6306,7 @@ \tcode{std::thread}\iref{thread.thread.class} or \tcode{std::jthread}\iref{thread.jthread.class} provide concurrent forward progress guarantees. -\begin{note} General-purpose implementations should provide these guarantees. -\end{note} \pnum \indextext{forward progress guarantees!parallel}% @@ -6346,7 +6344,7 @@ guarantees, which in turn are stronger than weakly parallel forward progress guarantees. \begin{note} -For example, some kinds of synchronization between threads of execution may only +For example, some kinds of synchronization between threads of execution might only make progress if the respective threads of execution provide parallel forward progress guarantees, but will fail to make progress under weakly parallel guarantees. \end{note} @@ -6377,7 +6375,7 @@ stronger forward progress guarantee for a certain amount of time, due to a second thread of execution $A$ being blocked on it with forward progress guarantee delegation. In turn, if $B$ then blocks with -forward progress guarantee delegation on $C$, this may also temporarily +forward progress guarantee delegation on $C$, this could also temporarily provide a stronger forward progress guarantee to $C$. \end{note} @@ -6565,10 +6563,10 @@ inline double fd() { return 1.0; } extern double d1; double d2 = d1; // unspecified: - // may be statically initialized to \tcode{0.0} or + // either statically initialized to \tcode{0.0} or // dynamically initialized to \tcode{0.0} if \tcode{d1} is // dynamically initialized, or \tcode{1.0} otherwise -double d1 = fd(); // may be initialized statically or dynamically to \tcode{1.0} +double d1 = fd(); // either initialized statically or dynamically to \tcode{1.0} \end{codeblock} \end{note} diff --git a/source/classes.tex b/source/classes.tex index 185b68fae9..dd14334e56 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -196,7 +196,7 @@ address\iref{expr.eq}.} \begin{note} $M(\mathtt{X})$ is the set of the types of all non-base-class subobjects -that may be at a zero offset in \tcode{X}. +that can be at a zero offset in \tcode{X}. \end{note} \begin{itemize} @@ -869,7 +869,7 @@ member function shall not be redeclared. \begin{note} There can be at most one definition of a non-inline member function in -a program. There may be more than one +a program. There can be more than one inline member function definition in a program. See~\ref{basic.def.odr} and~\ref{dcl.inline}. \end{note} @@ -1528,7 +1528,7 @@ \pnum \begin{note} -All forms of copy/move constructor may be declared for a class. +All forms of copy/move constructor can be declared for a class. \begin{example} \begin{codeblock} struct X { @@ -1649,7 +1649,7 @@ \begin{note} When the move constructor is not implicitly declared or explicitly supplied, -expressions that otherwise would have invoked the move constructor may instead invoke +expressions that otherwise would have invoked the move constructor might instead invoke a copy constructor. \end{note} @@ -1814,7 +1814,7 @@ see~\ref{over.ass}. \end{note} \begin{note} -More than one form of copy assignment operator may be declared for a class. +More than one form of copy assignment operator can be declared for a class. \end{note} \begin{note} If a class @@ -1888,8 +1888,7 @@ \end{note} {} \begin{note} -More -than one form of move assignment operator may be declared for a class. +More than one form of move assignment operator can be declared for a class. \end{note} \pnum @@ -2569,7 +2568,7 @@ constructors, but does so only where the direct-initialization syntax\iref{dcl.init} or where casts~(\ref{expr.static.cast}, \ref{expr.cast}) are explicitly used; see also~\ref{over.match.copy}. -A default constructor may be an explicit constructor; such a constructor +A default constructor can be an explicit constructor; such a constructor will be used to perform default-initialization or value-initialization\iref{dcl.init}. \begin{example} @@ -2599,7 +2598,7 @@ a converting constructor. \begin{note} An implicitly-declared copy/move constructor is not an explicit constructor; -it may be called for implicit type conversions. +it can be called for implicit type conversions. \end{note} \rSec3[class.conv.fct]{Conversion functions}% @@ -3602,7 +3601,7 @@ from the layout of a most derived object of the same type. A base class subobject might have a polymorphic behavior\iref{class.cdtor} different from the polymorphic behavior of a most derived object of the -same type. A base class subobject may be of zero size; +same type. A base class subobject can be of zero size; however, two subobjects that have the same class type and that belong to the same most derived object must not be allocated at the same address\iref{intro.object}. @@ -4217,7 +4216,7 @@ \pnum \begin{note} An abstract class can be derived from a class that is not abstract, and -a pure virtual function may override a virtual function which is not +a pure virtual function can override a virtual function which is not pure. \end{note} @@ -5157,7 +5156,7 @@ \end{ncsimplebnf} \begin{note} -A friend declaration may be the +A friend declaration can be the \grammarterm{declaration} in a \grammarterm{template-declaration} (\ref{temp.pre}, \ref{temp.friend}). \end{note} @@ -5665,7 +5664,7 @@ refers to the class member. A \grammarterm{mem-initializer-id} -for the hidden base class may be specified using a qualified name. +for the hidden base class can be specified using a qualified name. \end{note} Unless the \grammarterm{mem-initializer-id} @@ -5824,7 +5823,7 @@ \begin{note} An abstract class\iref{class.abstract} is never a most derived class, thus its constructors never initialize virtual base classes, therefore the -corresponding \grammarterm{mem-initializer}{s} may be omitted. +corresponding \grammarterm{mem-initializer}{s} can be omitted. \end{note} An attempt to initialize more than one non-static data member of a union renders the program ill-formed. @@ -6800,7 +6799,7 @@ has no \grammarterm{noexcept-specifier}, the implicitly-declared \tcode{==} operator function has an implicit exception specification\iref{except.spec} that -may differ from the implicit exception specification of +can differ from the implicit exception specification of the three-way comparison operator function. \end{note} \begin{example} @@ -6927,7 +6926,7 @@ \end{itemize} \begin{note} -A synthesized three-way comparison may be ill-formed +A synthesized three-way comparison is ill-formed if overload resolution finds usable candidates that do not otherwise meet the requirements implied by the defined expression. \end{note} diff --git a/source/concepts.tex b/source/concepts.tex index d68d1fa131..9d6d69880d 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -395,7 +395,7 @@ \term{common reference type}, \tcode{C}. \begin{note} \tcode{C} could be the same as \tcode{T}, or \tcode{U}, or it could be a -different type. \tcode{C} may be a reference type. +different type. \tcode{C} can be a reference type. \end{note} \begin{itemdecl} diff --git a/source/containers.tex b/source/containers.tex index 74af0672c6..e5d4ff2467 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -458,7 +458,7 @@ pointers, or iterators referring to the elements of the containers being swapped. \begin{note} -The \tcode{end()} iterator does not refer to any element, so it may be invalidated. +The \tcode{end()} iterator does not refer to any element, so it can be invalidated. \end{note} \end{itemize} @@ -604,7 +604,7 @@ with \tcode{m == get_allocator()}. The default \tcode{construct} in \tcode{allocator} will call \tcode{::new((void*)p) T(args)}, -but specialized allocators may choose a different definition. +but specialized allocators can choose a different definition. \end{note} \pnum @@ -753,10 +753,10 @@ \begin{note} For a \tcode{vector x} with a size greater than one, \tcode{x[1] = 5} and \tcode{*x.begin() = 10} can be executed concurrently without a data race, but -\tcode{x[0] = 5} and \tcode{*x.begin() = 10} executed concurrently may result in a data +\tcode{x[0] = 5} and \tcode{*x.begin() = 10} executed concurrently can result in a data race. As an exception to the general rule, for a \tcode{vector y}, \tcode{y[0] = true} -may race with \tcode{y[1] = true}. +can race with \tcode{y[1] = true}. \end{note} \rSec2[sequence.reqmts]{Sequence containers} @@ -878,7 +878,7 @@ \effects Inserts an object of type \tcode{T} constructed with \tcode{std::forward<\brk{}Args\brk{}>(\brk{}args)...} before \tcode{p}. \begin{note} -\tcode{args} may directly or indirectly refer to +\tcode{args} can directly or indirectly refer to a value in \tcode{a}. \end{note} \\ \rowsep @@ -3492,7 +3492,7 @@ \pnum \begin{note} Unlike the \tcode{swap} function for other containers, \tcode{array::swap} -takes linear time, may exit via an exception, and does not cause iterators to +takes linear time, can exit via an exception, and does not cause iterators to become associated with the other container. \end{note} \end{itemdescr} diff --git a/source/declarations.tex b/source/declarations.tex index 5fabee5aa0..592fde29b1 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -110,7 +110,7 @@ of the \grammarterm{init-declarator-list}. \begin{note} In the declaration for an entity, attributes appertaining to that -entity may appear at the start of the declaration and after the +entity can appear at the start of the declaration and after the \grammarterm{declarator-id} for that declaration. \end{note} \begin{example} @@ -1089,7 +1089,7 @@ from the end of every definition domain in which it is declared; no diagnostic is required. \begin{note} -A call to an inline function or a use of an inline variable may be encountered +A call to an inline function or a use of an inline variable can be encountered before its definition becomes reachable in a translation unit. \end{note} @@ -3144,7 +3144,7 @@ When several ``array of'' specifications are adjacent, a multidimensional array type is created; only the first of the constant expressions -that specify the bounds of the arrays may be omitted. +that specify the bounds of the arrays can be omitted. \begin{example} \begin{codeblock} int x3d[3][5][7]; @@ -3943,7 +3943,7 @@ \begin{note} The keyword \tcode{this} -may not appear in a default argument of a member function; +cannot appear in a default argument of a member function; see~\ref{expr.prim.this}. \begin{example} \begin{codeblock} @@ -4368,7 +4368,7 @@ is called \defn{copy-initialization}. \begin{note} -Copy-initialization may invoke a move\iref{class.copy.ctor}. +Copy-initialization can invoke a move\iref{class.copy.ctor}. \end{note} \pnum @@ -5123,7 +5123,7 @@ \pnum \indextext{initialization!array of class objects}% \begin{note} -An aggregate array or an aggregate class may contain elements of a +An aggregate array or an aggregate class can contain elements of a class type with a user-declared constructor\iref{class.ctor}. Initialization of these aggregate objects is described in~\ref{class.expl.init}. \end{note} @@ -7273,7 +7273,7 @@ \begin{note} An explicit instantiation\iref{temp.explicit} or explicit specialization\iref{temp.expl.spec} of a template -does not introduce a name and thus may be declared using an +does not introduce a name and thus can be declared using an \grammarterm{unqualified-id} in a member of the enclosing namespace set, if the primary template is declared in an inline namespace. \end{note} @@ -7948,7 +7948,7 @@ as a function template introduced by a \grammarterm{using-declaration}, the program is ill-formed. \begin{note} -Two \grammarterm{using-declaration}{s} may introduce functions with the same +Two \grammarterm{using-declaration}{s} can introduce functions with the same name and the same parameter-type-list. If, for a call to an unqualified function name, function overload resolution selects the functions introduced by such \grammarterm{using-declaration}{s}, the function call is @@ -8173,7 +8173,7 @@ \begin{note} Some of the properties associated with an entity with language linkage are specific to each implementation and are not described here. For -example, a particular language linkage may be associated with a +example, a particular language linkage might be associated with a particular form of representing names of objects and functions with external linkage, or with a particular calling convention, etc. \end{note} @@ -8344,7 +8344,7 @@ \begin{note} Only one definition for an entity with a given name -with C language linkage may appear in the +with C language linkage can appear in the program (see~\ref{basic.def.odr}); this implies that such an entity must not be defined in more @@ -8566,10 +8566,8 @@ its \grammarterm{attribute-namespace} is \tcode{std} followed by zero or more digits. \end{itemize} -\begin{note} Each implementation should choose a distinctive name for the \grammarterm{attribute-namespace} in an \grammarterm{attribute-scoped-token}. -\end{note} \pnum Two consecutive left square bracket tokens shall appear only @@ -8724,7 +8722,7 @@ \pnum \begin{note} The \tcode{carries_dependency} attribute does not change the meaning of the -program, but may result in generation of more efficient code. +program, but might result in generation of more efficient code. \end{note} \pnum @@ -8792,7 +8790,7 @@ \end{ncbnf} \begin{note} The \grammarterm{string-literal} in the \grammarterm{attribute-argument-clause} -could be used to explain the rationale for deprecation and/or to suggest a replacing entity. +can be used to explain the rationale for deprecation and/or to suggest a replacing entity. \end{note} \pnum diff --git a/source/diagnostics.tex b/source/diagnostics.tex index 87c4492a5d..91fdc0fd4e 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -1050,7 +1050,7 @@ system is unspecified. \begin{note} The number of potential system error codes is large -and unbounded, and some may not correspond to any POSIX \tcode{errno} value. Thus +and unbounded, and some might not correspond to any POSIX \tcode{errno} value. Thus implementations are given latitude in determining correspondence. \end{note} \end{itemdescr} diff --git a/source/expressions.tex b/source/expressions.tex index 2f3e06bc94..d849f90cd2 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -73,7 +73,7 @@ \indextext{operator!precedence of}% \indextext{expression!order of evaluation of}% \begin{note} -The implementation may regroup operators according to +The implementation can regroup operators according to the usual mathematical rules only where the operators really are associative or commutative.\footnote{Overloaded operators are never assumed to be associative or commutative.} @@ -272,7 +272,7 @@ that class shall not be an abstract class\iref{class.abstract}. A glvalue shall not have type \cv{}~\tcode{void}. \begin{note} -A glvalue may have complete or incomplete non-\tcode{void} type. +A glvalue can have complete or incomplete non-\tcode{void} type. Class and array prvalues can have cv-qualified types; other prvalues always have cv-unqualified types. See \ref{expr.type}. \end{note} @@ -422,7 +422,7 @@ \ref{temp.concept}). An unevaluated operand is not evaluated. \begin{note} -In an unevaluated operand, a non-static class member may be +In an unevaluated operand, a non-static class member can be named\iref{expr.prim.id} and naming of objects or functions does not, by itself, require that a definition be provided\iref{basic.def.odr}. An unevaluated operand is considered a full-expression\iref{intro.execution}. @@ -1745,7 +1745,7 @@ \pnum \begin{note} -The function call operator or operator template may be constrained\iref{temp.constr.decl} +The function call operator or operator template can be constrained\iref{temp.constr.decl} by a \grammarterm{type-constraint}\iref{temp.param}, a \grammarterm{requires-clause}\iref{temp.pre}, or a trailing \grammarterm{requires-clause}\iref{dcl.decl}. @@ -2845,7 +2845,7 @@ The \tcode{>} token following the \grammarterm{type-id} in a \tcode{dynamic_cast}, \tcode{static_cast}, \tcode{reinterpret_cast}, or -\tcode{const_cast} may be the product of replacing a +\tcode{const_cast} might be the product of replacing a \tcode{>{>}} token by two consecutive \tcode{>} tokens\iref{temp.names}. \end{note} @@ -4026,7 +4026,7 @@ \pnum \begin{note} -Subject to the restrictions in this subclause, an expression may be cast +Subject to the restrictions in this subclause, an expression can be cast to its own type using a \tcode{const_cast} operator. \end{note} @@ -4082,7 +4082,7 @@ \tcode{const_cast} that casts away a const-qualifier\footnote{\tcode{const_cast} is not limited to conversions that cast away a const-qualifier.} -may produce undefined behavior\iref{dcl.type.cv}. +might produce undefined behavior\iref{dcl.type.cv}. \end{note} \pnum @@ -4457,7 +4457,7 @@ \begin{note} This resumes the coroutine referred to by the result of \placeholder{await-suspend}. -Any number of coroutines may be successively resumed in this fashion, +Any number of coroutines can be successively resumed in this fashion, eventually returning control flow to the current coroutine caller or resumer\iref{dcl.fct.def.coroutine}. \end{note} @@ -4687,7 +4687,7 @@ \grammarterm{new-expression}{s}. \end{note} \begin{note} -The \grammarterm{type-id} may be a cv-qualified type, in which case the +The \grammarterm{type-id} can be a cv-qualified type, in which case the object created by the \grammarterm{new-expression} has a cv-qualified type. \end{note} @@ -4918,9 +4918,9 @@ A \Cpp{} program can provide alternative definitions of these functions\iref{replacement.functions} and/or class-specific versions\iref{class.free}. -The set of allocation and deallocation functions that may be called +The set of allocation and deallocation functions that can be called by a \grammarterm{new-expression} -may include functions that do not perform allocation or deallocation; +could include functions that do not perform allocation or deallocation; for example, see \ref{new.delete.placement}. \end{note} @@ -6731,7 +6731,7 @@ \begin{note} This restriction applies to the relationship between the left and right sides of the assignment operation; it is not a -statement about how the target of the assignment may be aliased in general. +statement about how the target of the assignment might be aliased in general. See~\ref{basic.lval}. \end{note} @@ -6845,7 +6845,7 @@ for \tcode{o} and its subobjects even if those objects are of non-literal class types. \begin{note} - Such a class may have a non-trivial destructor. + Such a class can have a non-trivial destructor. Within this evaluation, \tcode{std::is_constant_evaluated()}\iref{meta.const.eval} returns \tcode{true}. @@ -7162,7 +7162,7 @@ is an expression of integral or unscoped enumeration type, implicitly converted to a prvalue, where the converted expression is a core constant expression. \begin{note} -Such expressions may be +Such expressions can be used as bit-field lengths\iref{class.bit}, as enumerator initializers if the underlying type is not fixed\iref{dcl.enum}, and as alignments\iref{dcl.align}. @@ -7209,7 +7209,7 @@ \end{itemize} and where the reference binding (if any) binds directly. \begin{note} -Such expressions may be used in \tcode{new} +Such expressions can be used in \tcode{new} expressions\iref{expr.new}, as case expressions\iref{stmt.switch}, as enumerator initializers if the underlying type is fixed\iref{dcl.enum}, as array bounds\iref{dcl.array}, and diff --git a/source/future.tex b/source/future.tex index d29ad12f4f..48ec3c592a 100644 --- a/source/future.tex +++ b/source/future.tex @@ -2745,7 +2745,7 @@ an atomic variable of static storage duration of a type that is initialization-compatible with \tcode{value}. \begin{note} -This operation may need to initialize locks. +This operation might need to initialize locks. \end{note} Concurrent access to the variable being initialized, even via an atomic operation, diff --git a/source/intro.tex b/source/intro.tex index 38a7908914..bbcac8c628 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -884,7 +884,7 @@ \defnx{observable behavior}{behavior!observable} of the program. \begin{note} More stringent correspondences between abstract and actual -semantics may be defined by each implementation. +semantics can be defined by each implementation. \end{note} \rSec1[intro.structure]{Structure of this document} diff --git a/source/iostreams.tex b/source/iostreams.tex index 21f8922afb..04400c29d2 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -12085,7 +12085,7 @@ \pnum \begin{note} -Some operating systems may have no unambiguous way to distinguish between native format and generic format arguments. +Some operating systems have no unambiguous way to distinguish between native format and generic format arguments. This is by design as it simplifies use for operating systems that do not require disambiguation. An implementation for an operating system where disambiguation is required is permitted to distinguish between the formats. @@ -12114,7 +12114,7 @@ A path stores a native format pathname\iref{fs.path.native.obs} and acts as if it also stores a generic format pathname, related as given below. -The implementation may generate the generic format pathname +The implementation can generate the generic format pathname based on the native format pathname (and possibly other information) when requested. \end{note} @@ -12569,7 +12569,7 @@ Appends \tcode{path(x).native()} to the pathname in the native format. \begin{note} This directly manipulates the value of \tcode{native()} -and may not be portable between operating systems. +and might not be portable between operating systems. \end{note} \pnum @@ -13103,7 +13103,7 @@ \pnum \begin{note} On non-POSIX operating systems, for a path \tcode{p}, -it may not be the case that \tcode{p.stem() + p.extension() == p.filename()}, +it is possible that \tcode{p.stem() + p.extension() == p.filename()} is \tcode{false}, even though the generic format pathnames are the same. \end{note} \end{itemdescr} @@ -14823,7 +14823,7 @@ \pnum \begin{note} If the directory structure being iterated over contains cycles -then the end iterator may be unreachable. +then the end iterator might be unreachable. \end{note} \rSec3[fs.rec.dir.itr.members]{Members} @@ -15744,7 +15744,7 @@ \pnum \begin{note} The current path as returned by many operating systems is a dangerous - global variable. It may be changed unexpectedly by third-party or system + global variable. It might be changed unexpectedly by third-party or system library functions, or by another thread. \end{note} \end{itemdescr} @@ -15771,7 +15771,7 @@ \pnum \begin{note} The current path for many operating systems is a dangerous - global state. It may be changed unexpectedly by a third-party or system + global state. It might be changed unexpectedly by a third-party or system library functions, or by another thread. \end{note} \end{itemdescr} @@ -16295,7 +16295,7 @@ \pnum \begin{note} Conceptually permissions are viewed as bits, but the actual -implementation may use some other mechanism. +implementation can use some other mechanism. \end{note} \pnum @@ -16496,13 +16496,13 @@ \begin{itemize} \item If \tcode{old_p} and \tcode{new_p} resolve to the same existing file, no action is taken. -\item Otherwise, the rename may include the following effects: +\item Otherwise, the rename can include the following effects: \begin{itemize} \item if \tcode{new_p} resolves to an existing non-directory file, \tcode{new_p} is removed; otherwise, \item if \tcode{new_p} resolves to an existing directory, \tcode{new_p} is removed if empty on POSIX compliant operating systems - but may be an error on other operating systems. + but might be an error on other operating systems. \end{itemize} \end{itemize} A symbolic link is itself renamed, rather than the file it resolves to. @@ -16565,7 +16565,7 @@ The value of member \tcode{space_info::available} is operating system dependent. \begin{note} -\tcode{available} may be +\tcode{available} might be less than \tcode{free}. \end{note} \end{itemdescr} diff --git a/source/lex.tex b/source/lex.tex index f2afd5bf66..c4e14910fa 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -143,7 +143,7 @@ token\iref{lex.token}. The resulting tokens are syntactically and semantically analyzed and translated as a translation unit. \begin{note} -The process of analyzing and translating the tokens may occasionally +The process of analyzing and translating the tokens can occasionally result in one token being replaced by a sequence of other tokens\iref{temp.names}. \end{note} @@ -168,13 +168,13 @@ \item Translated translation units and instantiation units are combined as follows: \begin{note} -Some or all of these may be supplied from a +Some or all of these can be supplied from a library. \end{note} Each translated translation unit is examined to produce a list of required instantiations. \begin{note} -This may include +This can include instantiations which have been explicitly requested\iref{temp.explicit}. \end{note} @@ -1394,7 +1394,7 @@ actual extended character is encountered in the source text. Therefore, all extended characters are described in terms of \grammarterm{universal-character-name}{s}. However, -the actual compiler implementation may use its own native character set, +the actual compiler implementation can use its own native character set, so long as the same results are obtained. \end{note} diff --git a/source/lib-intro.tex b/source/lib-intro.tex index c605b4d81a..79487f81ca 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1583,7 +1583,7 @@ of type \tcode{P} may have an indeterminate value. \begin{note} Operations involving -indeterminate values may cause undefined behavior. +indeterminate values might cause undefined behavior. \end{note} \pnum @@ -2050,7 +2050,7 @@ fail. The allocator also may silently ignore the requested alignment. \begin{note} Additionally, the member function \tcode{allocate} -for that type may fail by throwing an object of type +for that type can fail by throwing an object of type \tcode{bad_alloc}. \end{note} @@ -2819,7 +2819,7 @@ an overload from the set of declarations described in this document behaves as if that overload were selected. \begin{note} -For instance, an implementation may add parameters with default values, +For instance, an implementation can add parameters with default values, or replace a member function with default arguments with two or more member functions with equivalent behavior, or add additional signatures for a member function name. diff --git a/source/locales.tex b/source/locales.tex index 659313642e..61497f3eb8 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -231,7 +231,7 @@ \begin{codeblock} operator()(const basic_string&, const basic_string&) \end{codeblock} -is provided so that a locale may be used as a predicate argument to +is provided so that a locale can be used as a predicate argument to the standard collections, to collate strings. \item Convenient global interfaces are provided for traditional @@ -4029,7 +4029,7 @@ \pnum \begin{note} -The \tcode{fill} argument may be used in the implementation-defined +The \tcode{fill} argument can be used in the implementation-defined formats or by derivations. A space character is a reasonable default for this argument. \end{note} @@ -4070,7 +4070,7 @@ \returns An iterator pointing immediately after the last character produced. \begin{note} -The \tcode{fill} argument may be used in the implementation-defined +The \tcode{fill} argument can be used in the implementation-defined formats or by derivations. A space character is a reasonable default for this argument. \end{note} diff --git a/source/numerics.tex b/source/numerics.tex index d3212286eb..2cecc331ee 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -4030,7 +4030,7 @@ is \impldef{type of \tcode{default_random_engine}}. \begin{note} The implementation - may select this type + can select this type on the basis of performance, size, quality, @@ -4038,7 +4038,7 @@ so as to provide at least acceptable engine behavior for relatively casual, inexpert, and/or lightweight use. Because different implementations - may select different underlying engine types, + can select different underlying engine types, code that uses this \tcode{typedef} need not generate identical sequences across implementations. \end{note} @@ -7381,8 +7381,8 @@ such that \tcode{i < a.size()} and \tcode{j < b.size()}. \begin{note} -This property indicates an absence of aliasing and may be used to -advantage by optimizing compilers. Compilers may take advantage +This property indicates an absence of aliasing and can be used to +advantage by optimizing compilers. Compilers can take advantage of inlining, constant propagation, loop fusion, tracking of pointers obtained from \tcode{operator new}, diff --git a/source/overloading.tex b/source/overloading.tex index 7ba2afaa92..3f127ef6b9 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -4259,7 +4259,7 @@ function templates. In particular, they are looked up like ordinary functions and function templates and they follow the same overload resolution rules. Also, they can be declared \tcode{inline} or \tcode{constexpr}, -they may have internal, module, or external linkage, +they can have internal, module, or external linkage, they can be called explicitly, their addresses can be taken, etc. \end{note} diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 6d57b04bf6..f51c725e66 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -711,7 +711,7 @@ \pnum \begin{note} -Although an implementation may provide a mechanism for making arbitrary +Although an implementation can provide a mechanism for making arbitrary source files available to the \tcode{< >} search, in general programmers should use the \tcode{< >} form for headers provided with the implementation, and the \tcode{" "} form for sources diff --git a/source/regex.tex b/source/regex.tex index a1eed19a51..dafef1a862 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -3283,7 +3283,7 @@ \pnum \begin{note} -This means that a compiler may call an +This means that a compiler can call an implementation-specific search function, in which case a program-defined specialization of \tcode{regex_search} will not be called. diff --git a/source/statements.tex b/source/statements.tex index 49c3f1825f..abaf8fcb19 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -152,7 +152,7 @@ Labels have their own name space and do not interfere with other identifiers. \begin{note} -A label may have the same name as another declaration in the same scope or a +A label can have the same name as another declaration in the same scope or a \grammarterm{template-parameter} from an enclosing scope. Unqualified name lookup\iref{basic.lookup.unqual} ignores labels. \end{note} @@ -835,7 +835,7 @@ A \tcode{return} statement can involve an invocation of a constructor to perform a copy or move of the operand if it is not a prvalue or if its type differs from the return type of the function. -A copy operation associated with a \tcode{return} statement may be elided or +A copy operation associated with a \tcode{return} statement can be elided or converted to a move operation if an automatic storage duration variable is returned\iref{class.copy.elision}. \end{note} \begin{example} diff --git a/source/strings.tex b/source/strings.tex index 2780e3b1e3..04cbf62f55 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -3286,7 +3286,7 @@ are left in valid but unspecified states. \begin{note} If \tcode{lhs} and \tcode{rhs} have equal allocators, -the implementation may move from either. +the implementation can move from either. \end{note} \end{itemdescr} @@ -4452,7 +4452,7 @@ \pnum \begin{note} Unlike \tcode{basic_string::data()} and \grammarterm{string-literal}s, -\tcode{data()} may return a pointer to a buffer that is not null-terminated. +\tcode{data()} can return a pointer to a buffer that is not null-terminated. Therefore it is typically a mistake to pass \tcode{data()} to a function that takes just a \tcode{const charT*} and expects a null-terminated string. \end{note} \end{itemdescr} diff --git a/source/support.tex b/source/support.tex index fc046fc175..8834ed8d24 100644 --- a/source/support.tex +++ b/source/support.tex @@ -1948,13 +1948,13 @@ data race\iref{res.on.data.races}. \end{note} \begin{note} -The order of registration may be indeterminate if \tcode{at_quick_exit} was called from more +The order of registration could be indeterminate if \tcode{at_quick_exit} was called from more than one thread. \end{note} \begin{note} The \tcode{at_quick_exit} registrations are distinct from the \tcode{atexit} registrations, -and applications may need to call both registration functions with the same argument. +and applications might need to call both registration functions with the same argument. \end{note} \pnum @@ -2234,7 +2234,7 @@ the program shall also define the corresponding version without the \tcode{size} parameter. \begin{note} -The default behavior below may change in the future, which will require +The default behavior below might change in the future, which will require replacing both deallocation functions when replacing the allocation function. \end{note} @@ -2487,7 +2487,7 @@ the program shall also define the corresponding version without the \tcode{size} parameter. \begin{note} -The default behavior below may change in the future, which will require +The default behavior below might change in the future, which will require replacing both deallocation functions when replacing the allocation function. \end{note} @@ -2841,7 +2841,7 @@ \returns The current \tcode{new_handler}. \begin{note} -This may be a null pointer value. +This can be a null pointer value. \end{note} \end{itemdescr} @@ -3592,7 +3592,7 @@ \returns The current \tcode{terminate_handler}. \begin{note} -This may be a null pointer value. +This can be a null pointer value. \end{note} \end{itemdescr} @@ -3684,7 +3684,7 @@ \begin{note} If \tcode{rethrow_exception} rethrows the same exception object (rather than a copy), -concurrent access to that rethrown exception object may introduce a data race. +concurrent access to that rethrown exception object can introduce a data race. Changes in the number of \tcode{exception_ptr} objects that refer to a particular exception do not introduce a data race. \end{note} @@ -3716,7 +3716,7 @@ if this is not possible, to an instance of \tcode{bad_exception}. \begin{note} The -copy constructor of the thrown exception may also fail, so the implementation is allowed +copy constructor of the thrown exception can also fail, so the implementation is allowed to substitute a \tcode{bad_exception} object to avoid infinite recursion. \end{note} @@ -5143,7 +5143,7 @@ a mutex object across a suspend point. \end{note} \begin{note} -A concurrent resumption of the coroutine may result in a data race. +A concurrent resumption of the coroutine can result in a data race. \end{note} \indexlibrarymember{operator()}{coroutine_handle}% diff --git a/source/templates.tex b/source/templates.tex index 37217a440a..26c1916d9b 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -53,7 +53,7 @@ The \tcode{>} token following the \grammarterm{template-parameter-list} of a \grammarterm{template-declaration} -may be the product of replacing a +can be the product of replacing a \tcode{>{>}} token by two consecutive \tcode{>} tokens\iref{temp.names}. \end{note} @@ -117,7 +117,7 @@ shall not be a \grammarterm{template-id}. \begin{note} -That last component may be an \grammarterm{identifier}, an \grammarterm{operator-function-id}, +That last component can be an \grammarterm{identifier}, an \grammarterm{operator-function-id}, a \grammarterm{conversion-function-id}, or a \grammarterm{literal-operator-id}. In a class template declaration, if the class name @@ -258,7 +258,7 @@ The \tcode{>} token following the \grammarterm{template-parameter-list} of a \grammarterm{type-parameter} -may be the product of replacing a +can be the product of replacing a \tcode{>{>}} token by two consecutive \tcode{>} tokens\iref{temp.names}. \end{note} @@ -326,7 +326,7 @@ \keyword{template}) in the scope of the template declaration. \begin{note} -A template argument may be a class template or alias template. +A template argument can be a class template or alias template. For example, \begin{codeblock} @@ -745,8 +745,8 @@ the \grammarterm{template-id}. \begin{note} The second \tcode{>} -token produced by this replacement rule may terminate an enclosing -\grammarterm{template-id} construct or it may be part of a different +token produced by this replacement rule could terminate an enclosing +\grammarterm{template-id} construct or it could be part of a different construct (e.g., a cast). \end{note} \begin{example} @@ -806,7 +806,7 @@ \begin{note} The keyword \keyword{template} -may not be applied to non-template members of class templates. +cannot be applied to non-template members of class templates. \end{note} \begin{note} As is the case with the @@ -1185,7 +1185,7 @@ \end{codeblock} \end{example} \begin{note} -A template type argument may be an incomplete type\iref{basic.types}. +A template type argument can be an incomplete type\iref{basic.types}. \end{note} \rSec2[temp.arg.nontype]{Template non-type arguments} @@ -2156,7 +2156,7 @@ refer to the same type only if their \grammarterm{expression}{s} are equivalent\iref{temp.over.link}. \begin{note} -However, such a type may be aliased, +However, such a type might be aliased, e.g., by a \grammarterm{typedef-name}. \end{note} @@ -3152,7 +3152,7 @@ \pnum \begin{note} -A friend declaration may first declare a member of an enclosing namespace scope\iref{temp.inject}. +A friend declaration can first declare a member of an enclosing namespace scope\iref{temp.inject}. \end{note} \pnum @@ -3370,7 +3370,7 @@ used to specify template arguments of the \grammarterm{simple-template-id} of the partial specialization. \begin{note} -The template arguments may be private types or +The template arguments can be private types or objects that would normally not be accessible. Dependent names cannot be checked when declaring the partial specialization, but will be checked when substituting into the partial specialization. @@ -3696,7 +3696,7 @@ the relationship between the template parameters and the rest of the signature. \begin{note} -Two distinct function templates may have identical function return types and +Two distinct function templates can have identical function return types and function parameter lists, even if overload resolution alone cannot distinguish them. @@ -6057,7 +6057,7 @@ In particular, the template arguments and names used in the function declarator (including parameter types, return types and exception specifications) -may be private types or objects that would normally not be accessible. +can be private types or objects that would normally not be accessible. \end{note} \pnum @@ -6611,7 +6611,7 @@ or, where all template arguments can be deduced, a \grammarterm{template-name} or \grammarterm{operator-function-id}. \begin{note} -The declaration may declare a +The declaration can declare a \grammarterm{qualified-id}, in which case the \grammarterm{unqualified-id} @@ -7260,7 +7260,7 @@ the class template specialization to which the member function specialization belongs is implicitly instantiated. \begin{note} -Default function arguments may be specified in the declaration or +Default function arguments can be specified in the declaration or definition of a member function of a class template specialization that is explicitly specialized. \end{note} @@ -7717,7 +7717,7 @@ \pnum \begin{note} -Type deduction may fail for the following reasons: +Type deduction can fail for the following reasons: \begin{itemize} \item Attempting to instantiate a pack expansion containing multiple packs of differing lengths. \item diff --git a/source/threads.tex b/source/threads.tex index 3171ca0d83..1843db45b7 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -7236,7 +7236,7 @@ \begin{note} Line \#1 might not result in concurrency because -the \tcode{async} call uses the default policy, which may use +the \tcode{async} call uses the default policy, which might use \tcode{launch::deferred}, in which case the lambda might not be invoked until the \tcode{get()} call; in that case, \tcode{work1} and \tcode{work2} are called on the same thread and there is no concurrency. diff --git a/source/time.tex b/source/time.tex index 898ca57c2d..1fbe096225 100644 --- a/source/time.tex +++ b/source/time.tex @@ -1074,7 +1074,7 @@ \tcode{Rep(0)}. \begin{note} \tcode{Rep(0)} is specified instead of -\tcode{Rep()} because \tcode{Rep()} may have some other meaning, such as an +\tcode{Rep()} because \tcode{Rep()} can have some other meaning, such as an uninitialized value. \end{note} @@ -1140,7 +1140,7 @@ \tcode{duration} arguments will convert to it without requiring a division operation. The representation of this type is intended to be able to hold any value resulting from this conversion with no truncation error, although -floating-point durations may have round-off errors. +floating-point durations can have round-off errors. \end{note} \indexlibraryglobal{common_type}% @@ -3347,7 +3347,7 @@ Its epoch is unspecified, and \tcode{noexcept(file_clock::now())} is \tcode{true}. \begin{note} -The type that \tcode{file_clock} denotes may be +The type that \tcode{file_clock} denotes can be in a different namespace than \tcode{std::chrono}, such as \tcode{std::file\-sys\-tem}. \end{note} @@ -6382,7 +6382,7 @@ \tcode{d_} with \tcode{ymdl.day()}. \begin{note} This conversion from \tcode{year_month_day_last} to \tcode{year_month_day} -may be more efficient than converting a \tcode{year_month_day_last} to a \tcode{sys_days}, +might be more efficient than converting a \tcode{year_month_day_last} to a \tcode{sys_days}, and then converting that \tcode{sys_days} to a \tcode{year_month_day}. \end{note} \end{itemdescr} @@ -6690,7 +6690,7 @@ \begin{note} If \tcode{ymd.month()} is February and \tcode{ymd.day()} is not in the range \crange{1d}{28d}, -\tcode{ok()} may return \tcode{false} for +\tcode{ok()} can return \tcode{false} for the resultant \tcode{year_month_day}. \end{note} \end{itemdescr} @@ -6951,7 +6951,7 @@ \pnum \begin{note} -This value may be computed on demand. +This value might be computed on demand. \end{note} \end{itemdescr} diff --git a/source/utilities.tex b/source/utilities.tex index 014cb69560..3f6cf7d991 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -1978,7 +1978,7 @@ \pnum \begin{note} -An implementation may support additional types in the template parameter +An implementation can support additional types in the template parameter pack \tcode{Tuples} that support the \tcode{tuple}-like protocol, such as \tcode{pair} and \tcode{array}. \end{note} @@ -2288,7 +2288,7 @@ \pnum \begin{note} The above definition does not require \tcode{t$_{\mathrm{tail}}$} -(or \tcode{u$_{\mathrm{tail}}$}) to be constructed. It may not +(or \tcode{u$_{\mathrm{tail}}$}) to be constructed. It might not even be possible, as \tcode{t} and \tcode{u} are not required to be copy constructible. Also, all comparison operator functions are short circuited; they do not perform element accesses beyond what is required to determine the @@ -5274,7 +5274,7 @@ \pnum \begin{note} -The discriminated type may contain values of different types but does not attempt conversion between them, +The discriminated type can contain values of different types but does not attempt conversion between them, i.e., \tcode{5} is held strictly as an \tcode{int} and is not implicitly convertible either to \tcode{"5"} or to \tcode{5.0}. This indifference to interpretation but awareness of type effectively allows safe, generic containers of single values, with no scope for surprises from ambiguous conversions. \end{note} @@ -7475,7 +7475,7 @@ it points to was created by global \tcode{operator new} and not previously declared reachable. \begin{note} -This may be used to inform a +This can be used to inform a garbage collector or leak detector that this region of memory need not be traced. \end{note} @@ -7486,8 +7486,8 @@ \pnum \begin{note} -Under some conditions implementations may need to allocate memory. -However, the request can be ignored if memory allocation fails. +The request can be ignored +if a memory allocation needed by the implementation fails. \end{note} \end{itemdescr} @@ -7605,7 +7605,7 @@ \begin{note} The alignment assumption on an object \tcode{X} expressed by a call to \tcode{assume_aligned} -may result in generation of more efficient code. +might result in generation of more efficient code. It is up to the program to ensure that the assumption actually holds. The call does not cause the compiler to verify or enforce this. An implementation might only make the assumption @@ -9059,7 +9059,7 @@ \tcode{get_deleter()(old_p)}. \begin{note} The order of these operations is significant -because the call to \tcode{get_deleter()} may destroy \tcode{*this}. +because the call to \tcode{get_deleter()} might destroy \tcode{*this}. \end{note} \pnum @@ -9770,7 +9770,7 @@ The template parameter \tcode{T} of \tcode{shared_ptr} may be an incomplete type. \begin{note} -\tcode{T} may be a function type. +\tcode{T} can be a function type. \end{note} \pnum @@ -10107,7 +10107,7 @@ \begin{note} The use count updates caused by the temporary object construction and destruction are not observable side -effects, so the implementation may meet the effects (and the +effects, so the implementation can meet the effects (and the implied guarantees) via different means, without creating a temporary. In particular, in the example: \begin{codeblock} @@ -10116,7 +10116,7 @@ p = p; q = p; \end{codeblock} -both assignments may be no-ops. +both assignments can be no-ops. \end{note} \end{itemdescr} @@ -18561,9 +18561,9 @@ \end{codeblock} \end{example} \begin{note} -Because different parallel architectures may require idiosyncratic +Because different parallel architectures might require idiosyncratic parameters for efficient execution, implementations -may provide additional execution policies to those described in this +can provide additional execution policies to those described in this standard as extensions. \end{note} From 8f1cd3146def667e97facc391b054317f8deabd4 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 16 Sep 2020 11:15:52 +0200 Subject: [PATCH 150/250] [std] Replace 'must'. Partially addresses ISO/CS 017 (C++20 DIS) --- source/classes.tex | 4 ++-- source/lex.tex | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index dd14334e56..24cdcb9dc8 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3603,7 +3603,7 @@ different from the polymorphic behavior of a most derived object of the same type. A base class subobject can be of zero size; however, two subobjects that have the same class type and that belong to -the same most derived object must not be allocated at the same +the same most derived object cannot be allocated at the same address\iref{intro.object}. \end{note} @@ -6621,7 +6621,7 @@ overload resolution is performed again, considering the expression or operand as an lvalue. \begin{note} -This two-stage overload resolution must be performed regardless +This two-stage overload resolution is performed regardless of whether copy elision will occur. It determines the constructor or the \tcode{return_value} overload to be called if elision is not performed, and the selected constructor diff --git a/source/lex.tex b/source/lex.tex index c4e14910fa..34e85826ff 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -57,8 +57,8 @@ \pnum \indextext{translation!phases|(}% The precedence among the syntax rules of translation is specified by the -following phases.\footnote{Implementations must behave as if these separate phases -occur, although in practice different phases might be folded together.} +following phases.\footnote{Implementations behave as if these separate phases +occur, although in practice different phases can be folded together.} \begin{enumerate} \item From 46a40362b6f60410385e3f1f97d45b9e1bc41b4d Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 17 Sep 2020 16:18:16 +0200 Subject: [PATCH 151/250] [std] Move implementation recommendations to outside notes and prefix them with "Recommended practice" Partially addresses ISO/CS 017 (C++20 DIS) --- source/atomics.tex | 11 +++++++---- source/basic.tex | 13 +++++++------ source/expressions.tex | 8 +++++--- source/future.tex | 2 +- source/iostreams.tex | 14 ++++++++++---- source/iterators.tex | 40 +++++++++++++++++++++------------------- source/lib-intro.tex | 4 +--- source/locales.tex | 5 +++-- source/ranges.tex | 3 +-- source/support.tex | 4 ++-- source/threads.tex | 16 ++++++++-------- source/utilities.tex | 23 ++++++++++++----------- 12 files changed, 78 insertions(+), 65 deletions(-) diff --git a/source/atomics.tex b/source/atomics.tex index bdf1cf6965..3b6ea73ba1 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -636,12 +636,15 @@ block\iref{intro.progress}. \pnum -Operations that are lock-free should also be address-free. -\begin{note} +\recommended +Operations that are lock-free should also be address-free% +\footnote{ That is, atomic operations on the same memory location via two different addresses will -communicate atomically. The implementation should not depend on any -per-process state. This restriction enables communication by memory that is +communicate atomically.}. +The implementation of these operations should not depend on any per-process state. +\begin{note} +This restriction enables communication by memory that is mapped into a process more than once and by memory that is shared between two processes. \end{note} diff --git a/source/basic.tex b/source/basic.tex index c0c8673b42..0cba3c83cc 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -6243,10 +6243,10 @@ by repeatedly stealing a cache line for unrelated purposes between load-locked and store-conditional instructions. - Implementations should ensure - that such effects cannot indefinitely delay progress + For implementations that follow this recommendation and + ensure that such effects cannot indefinitely delay progress under expected operating conditions, - and that such anomalies + such anomalies can therefore safely be ignored by programmers. Outside this document, this property is sometimes termed lock-free. @@ -6663,9 +6663,10 @@ even if it is not itself odr-used~(\ref{basic.def.odr}, \ref{basic.stc.static}).} It is \impldef{threads and program points at which deferred dynamic initialization is performed} in which threads and at which points in the program such deferred dynamic initialization occurs. -\begin{note} -Such points should be chosen in a way that allows the programmer to avoid deadlocks. -\end{note} + +\recommended +An implementation should choose such points in a way +that allows the programmer to avoid deadlocks. \begin{example} \begin{codeblock} // - File 1 - diff --git a/source/expressions.tex b/source/expressions.tex index d849f90cd2..156f0827e1 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -7267,14 +7267,16 @@ \end{example} \pnum +\recommended +Implementations should provide consistent results of floating-point evaluations, +irrespective of whether the evaluation is performed +during translation or during program execution. \begin{note} Since this document imposes no restrictions on the accuracy of floating-point operations, it is unspecified whether the evaluation of a floating-point expression during translation yields the same result as the evaluation of the same expression (or the same operations on the same values) during program -execution.\footnote{Nonetheless, implementations should provide consistent results, -irrespective of whether the evaluation was performed during translation and/or during program -execution.} +execution. \begin{example} \begin{codeblock} bool f() { diff --git a/source/future.tex b/source/future.tex index 48ec3c592a..3774d7b336 100644 --- a/source/future.tex +++ b/source/future.tex @@ -570,7 +570,7 @@ \begin{itemize} \item \tcode{allocated}, set when a dynamic array object has been -allocated, and hence should be freed by the destructor for the +allocated, and hence will be freed by the destructor for the \tcode{strstreambuf} object; \item \tcode{constant}, set when the array object has diff --git a/source/iostreams.tex b/source/iostreams.tex index 04400c29d2..2fad3a5eff 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -430,8 +430,7 @@ The objects are constructed and the associations are established at some time prior to or during the first time an object of class \tcode{ios_base::Init} is constructed, and in any case before the body -of \tcode{main}\iref{basic.start.main} begins execution.\footnote{If it is possible for them to do so, implementations should -initialize the objects earlier than required.} +of \tcode{main}\iref{basic.start.main} begins execution. The objects are not destroyed during program execution.\footnote{Constructors and destructors for objects with static storage duration can access these objects to read input from @@ -441,6 +440,13 @@ or \tcode{stderr}. } + +\pnum +\recommended +If it is possible for them to do so, implementations should +initialize the objects earlier than required. + +\pnum The results of including \libheader{iostream} in a translation unit shall be as if \libheader{iostream} defined an instance of \tcode{ios_base::Init} with static storage duration. @@ -13707,10 +13713,10 @@ \impldef{interpretation of the path character sequence with format \tcode{path::auto_format}}. The implementation may inspect the content of the character sequence to determine the format. - \begin{note} + + \recommended For POSIX-based systems, native and generic formats are equivalent and the character sequence should always be interpreted in the same way. - \end{note} \\ \end{floattable} diff --git a/source/iterators.tex b/source/iterators.tex index d24884d524..e394a90e41 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1433,11 +1433,15 @@ \end{itemize} \pnum +\recommended +The implementaton of an algorithm on a weakly incrementable type +should never attempt to pass through the same incrementable value twice; +such an algorithm should be a single-pass algorithm. \begin{note} For \libconcept{weakly_incrementable} types, \tcode{a} equals \tcode{b} does not imply that \tcode{++a} equals \tcode{++b}. (Equality does not guarantee the substitution property or referential -transparency.) Algorithms on weakly incrementable types should never attempt to pass -through the same incrementable value twice. They should be single-pass algorithms. These algorithms +transparency.) +Such algorithms can be used with istreams as the source of the input data through the \tcode{istream_iterator} class template. \end{note} @@ -1665,10 +1669,10 @@ \end{codeblock} \pnum -\begin{note} -Algorithms on output iterators should never attempt to pass through the same iterator twice. -They should be single-pass algorithms. -\end{note} +\recommended +The implementation of an algorithm on output iterators +should never attempt to pass through the same iterator twice; +such an algorithm should be a single-pass algorithm. \rSec3[iterator.concept.forward]{Concept \cname{forward_iterator}} @@ -2011,18 +2015,15 @@ \end{libreqtab4b} \pnum +\recommended +The implementation of an algorithm on input iterators +should never attempt to pass through the same iterator twice; +such an algorithm should be a single pass algorithm. \begin{note} -For input iterators, -\tcode{a == b} -does not imply -\tcode{++a == ++b}. +For input iterators, \tcode{a == b} does not imply \tcode{++a == ++b}. (Equality does not guarantee the substitution property or referential transparency.) -Algorithms on input iterators should never attempt to pass through the same iterator twice. -They should be -\term{single pass} -algorithms. Value type \tcode{T} is not required to be a \oldconcept{CopyAssignable} type (\tref{cpp17.copyassignable}). -These algorithms can be used with istreams as the source of the input data through the +Such an algorithm can be used with istreams as the source of the input data through the \tcode{istream_iterator} class template. \end{note} @@ -2072,13 +2073,14 @@ \end{libreqtab4b} \pnum +\recommended +The implementation of an algorithm on output iterators +should never attempt to pass through the same iterator twice; +such an algorithm should be a single-pass algorithm. \begin{note} -The only valid use of an -\tcode{operator*} +The only valid use of an \tcode{operator*} is on the left side of the assignment statement. Assignment through the same value of the iterator happens only once. -Algorithms on output iterators should never attempt to pass through the same iterator twice. -They should be single-pass algorithms. Equality and inequality might not be defined. \end{note} diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 79487f81ca..f16e359ba7 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1668,11 +1668,9 @@ Thus all evaluations of the expression \tcode{h(k)} with the same value for \tcode{k} yield the same result for a given execution of the program. \end{note} -\begin{note} -For two different + For two different values \tcode{t1} and \tcode{t2}, the probability that \tcode{h(t1)} and \tcode{h(t2)} compare equal should be very small, approaching \tcode{1.0 / numeric_limits::max()}. - \end{note} \\ \rowsep \tcode{h(u)} & \tcode{size_t} & diff --git a/source/locales.tex b/source/locales.tex index 61497f3eb8..b50ef5e59a 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -3448,11 +3448,12 @@ on any other string for which \tcode{do_compare()} returns 0 (equal) when passed the two strings. -\begin{note} + +\pnum +\recommended The probability that the result equals that for another string which does not compare equal should be very small, approaching \tcode{(1.0/numeric_limits::max())}. -\end{note} \end{itemdescr} \rSec3[locale.collate.byname]{Class template \tcode{collate_byname}} diff --git a/source/ranges.tex b/source/ranges.tex index 14a3004990..5e0220dd39 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1017,8 +1017,7 @@ \tcode{ranges::begin} and \tcode{ranges::end}. Since \tcode{ranges::begin} is not required to be equality-preserving when the return type does not model \libconcept{forward_iterator}, repeated calls -might not return equal values or might not be well-defined; -\tcode{ranges::begin} should be called at most once for such a range. +might not return equal values or might not be well-defined. \end{note} \end{itemdescr} diff --git a/source/support.tex b/source/support.tex index 8834ed8d24..cac3249712 100644 --- a/source/support.tex +++ b/source/support.tex @@ -5404,8 +5404,8 @@ \pnum \begin{note} The types \tcode{suspend_never} and \tcode{suspend_always} can be used -to indicate that an \grammarterm{await-expression} should either never -suspend or always suspend, and in either case not produce a value. +to indicate that an \grammarterm{await-expression} either never +suspends or always suspends, and in either case does not produce a value. \end{note} \rSec1[support.runtime]{Other runtime support} diff --git a/source/threads.tex b/source/threads.tex index 1843db45b7..e28da204f7 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -126,10 +126,10 @@ An implementation returns from such a timeout at any point from the time specified above to the time it would return from a steady-clock relative timeout on the difference between $C_t$ and the time point of the call to the \tcode{_until} function. -\begin{note} + +\recommended Implementations should decrease the duration of the wait when the clock is adjusted forwards. -\end{note} \pnum \begin{note} @@ -6449,10 +6449,10 @@ \begin{note} It is valid to move from a future object for which \tcode{valid() == false}. \end{note} -\begin{note} + +\recommended Implementations should detect this case and throw an object of type \tcode{future_error} with an error condition of \tcode{future_errc::no_state}. -\end{note} \indexlibraryglobal{future}% \begin{codeblock} @@ -6749,10 +6749,10 @@ It is valid to copy or move from a \tcode{shared_future} object for which \tcode{valid()} is \tcode{false}. \end{note} -\begin{note} + +\recommended Implementations should detect this case and throw an object of type \tcode{future_error} with an error condition of \tcode{future_errc::no_state}. -\end{note} \indexlibraryglobal{shared_future}% \begin{codeblock} @@ -7144,12 +7144,12 @@ deferred function in the thread that called the waiting function. Once evaluation of \tcode{invoke(std::move(g), std::move(xyz))} begins, the function is no longer considered deferred. -\begin{note} + +\recommended If this policy is specified together with other policies, such as when using a \tcode{policy} value of \tcode{launch::async | launch::deferred}, implementations should defer invocation or the selection of the policy when no more concurrency can be effectively exploited. -\end{note} \item If no value is set in the launch policy, or a value is set that is neither specified diff --git a/source/utilities.tex b/source/utilities.tex index 3f6cf7d991..54ac861ecf 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -7463,7 +7463,7 @@ live until the corresponding \tcode{undeclare_no_pointers()} call. \begin{note} In a garbage-collecting implementation, the fact that a region in an object is -registered with \tcode{declare_no_pointers()} should not prevent the object from +registered with \tcode{declare_no_pointers()} does not prevent the object from being collected. \end{note} @@ -15166,12 +15166,13 @@ a specialization of \tcode{reference_wrapper} or a function pointer. Otherwise, may throw \tcode{bad_alloc} or any exception thrown by the copy constructor of the stored callable object. -\begin{note} + +\pnum +\recommended Implementations should avoid the use of dynamically allocated memory for small callable objects, for example, where \tcode{f}'s target is an object holding only a pointer or reference to an object and a member function pointer. -\end{note} \end{itemdescr} \indexlibraryctor{function}% @@ -15188,12 +15189,11 @@ \tcode{f} is in a valid state with an unspecified value. \pnum -\begin{note} +\recommended Implementations should avoid the use of dynamically allocated memory for small callable objects, for example, where \tcode{f}'s target is an object holding only a pointer or reference to an object and a member function pointer. -\end{note} \end{itemdescr} \indexlibraryctor{function}% @@ -15224,12 +15224,6 @@ \pnum Otherwise, \tcode{*this} targets a copy of \tcode{f} initialized with \tcode{std::move(f)}. -\begin{note} -Implementations should avoid the use of -dynamically allocated memory for small callable objects, for example, -where \tcode{f} is an object holding only a pointer or -reference to an object and a member function pointer. -\end{note} \pnum \throws @@ -15237,6 +15231,13 @@ a specialization of \tcode{reference_wrapper} or a function pointer. Otherwise, may throw \tcode{bad_alloc} or any exception thrown by \tcode{F}'s copy or move constructor. + +\pnum +\recommended +Implementations should avoid the use of +dynamically allocated memory for small callable objects, for example, +where \tcode{f} is an object holding only a pointer or +reference to an object and a member function pointer. \end{itemdescr} From a17b219c0928e1cd616487570ab742295d2e0be9 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 17 Sep 2020 16:47:51 +0200 Subject: [PATCH 152/250] [std] Rephrase notes giving advice to the programmer. Partially addresses ISO/CS 017 (C++20 DIS) --- source/algorithms.tex | 17 +++++++++-------- source/containers.tex | 12 +++++------- source/diagnostics.tex | 7 ++++--- source/exceptions.tex | 4 ++-- source/iostreams.tex | 26 ++++++++++++++------------ source/lex.tex | 2 +- source/lib-intro.tex | 7 ------- source/preprocessor.tex | 11 ++++++----- source/strings.tex | 2 +- source/support.tex | 2 +- source/threads.tex | 22 +++++++++------------- source/utilities.tex | 24 ++++++++++-------------- 12 files changed, 62 insertions(+), 74 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 47ca8e7497..4f2f457456 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -204,10 +204,11 @@ \pnum \begin{note} Unless otherwise specified, algorithms that take function objects as arguments -are permitted to copy those function objects freely. -Programmers for whom object identity is important should consider -using a wrapper class that points to a noncopied implementation object -such as \tcode{reference_wrapper}\iref{refwrap}, or some equivalent solution. +can copy those function objects freely. +If object identity is important, +a wrapper class that points to a noncopied implementation object +such as \tcode{reference_wrapper}\iref{refwrap}, or some equivalent solution, +can be used. \end{note} \pnum @@ -391,11 +392,11 @@ \begin{note} This implies that user-supplied function objects cannot rely on object identity of arguments for such input sequences. -Users for whom the object identity of the arguments to these function objects -is important should consider using a wrapping iterator +If object identity of the arguments to these function objects +is important, a wrapping iterator that returns a non-copied implementation object -such as \tcode{reference_wrapper}\iref{refwrap} -or some equivalent solution. +such as \tcode{reference_wrapper}\iref{refwrap}, +or some equivalent solution, can be used. \end{note} \pnum diff --git a/source/containers.tex b/source/containers.tex index e5d4ff2467..2e19c6e25a 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -773,18 +773,16 @@ \pnum \begin{note} The sequence containers -offer the programmer different complexity trade-offs and should be used -accordingly. +offer the programmer different complexity trade-offs. \tcode{vector} -is the type of sequence container that should be used by default. +is appropriate in most circumstances. \tcode{array} -should be used when the container has a fixed size known during translation. +has a fixed size known during translation. \tcode{list} or \tcode{forward_list} -should be used when there are frequent insertions and deletions from the +support frequent insertions and deletions from the middle of the sequence. \tcode{deque} -is the data structure of choice -when most insertions and deletions take place at the beginning or at the +supports efficient insertions and deletions taking place at the beginning or at the end of the sequence. When choosing a container, remember \tcode{vector} is best; leave a comment to explain if you choose from the rest! diff --git a/source/diagnostics.tex b/source/diagnostics.tex index 91fdc0fd4e..ac074815b2 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -843,9 +843,10 @@ \begin{note} \tcode{error_category} objects are passed by reference, and two such objects -are equal if they have the same address. This means that applications using -custom \tcode{error_category} types should create a single object of each -such type. +are equal if they have the same address. +If there is more than a single object of a custom \tcode{error_category} type, +such equality comparisons can evaluate to \tcode{false} +even for objects holding the same value. \end{note} \indexlibraryglobal{error_category}% diff --git a/source/exceptions.tex b/source/exceptions.tex index 76526747bb..9e7e3d5f20 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -355,8 +355,8 @@ \end{codeblock} \end{example} \begin{note} -\setlength{\emergencystretch}{1em} -Consequently, destructors should generally catch exceptions and not let them propa\-gate. +If a destructor directly invoked by stack unwinding exits via an exception, +\tcode{std::terminate} is invoked. \end{note} diff --git a/source/iostreams.tex b/source/iostreams.tex index 2fad3a5eff..fc75dfed8f 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -11153,8 +11153,8 @@ \pnum \begin{note} The member functions of the provided stream buffer -might be called from \tcode{emit()} while a lock is held. -Care should be taken to ensure that this does not result in deadlock. +can be called from \tcode{emit()} while a lock is held, +which might result in a deadlock if used incautiously. \end{note} \pnum @@ -11988,7 +11988,7 @@ the ASCII control characters (0x00 -- 0x1F) in filenames. \end{example} \begin{note} -For wide portability, users may wish to limit \grammarterm{filename} +Wider portability can be achieved by limiting \grammarterm{filename} characters to the POSIX Portable Filename Character Set: \\ \tcode{A B C D E F G H I J K L M N O P Q R S T U V W X Y Z} \\ \tcode{a b c d e f g h i j k l m n o p q r s t u v w x y z} \\ @@ -14616,11 +14616,11 @@ \pnum \begin{note} -Programs performing directory iteration may wish to test if the -path obtained by dereferencing a directory iterator actually exists. It could be -a symbolic link to a non-existent file. Programs recursively -walking directory trees for purposes of removing and renaming entries may wish -to avoid following symbolic links. +A path obtained by dereferencing a directory iterator might not actually exist; +it could be a symbolic link to a non-existent file. +Recursively walking directory trees +for purposes of removing and renaming entries +might invalidate symbolic links that are being followed. \end{note} \pnum @@ -15141,9 +15141,9 @@ \pnum \begin{note} Because hardware failures, network failures, file system races\iref{fs.race.behavior}, -and many other kinds of errors occur frequently in file system operations, users should be aware -that any filesystem operation function, no matter how apparently innocuous, may encounter -an error; see~\ref{fs.err.report}. +and many other kinds of errors occur frequently in file system operations, +any filesystem operation function, no matter how apparently innocuous, +can encounter an error; see~\ref{fs.err.report}. \end{note} \rSec3[fs.op.absolute]{Absolute} @@ -15634,7 +15634,9 @@ \pnum \begin{note} Some operating systems require symlink creation to - identify that the link is to a directory. Portable code should use \tcode{create_directory_symlink()} to create directory symlinks rather than \tcode{create_symlink()} +identify that the link is to a directory. +Thus, \tcode{create_symlink()} (instead of \tcode{create_directory_symlink()}) +cannot be used reliably to create directory symlinks. \end{note} \pnum diff --git a/source/lex.tex b/source/lex.tex index 34e85826ff..3dfc91316f 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -184,7 +184,7 @@ source of the translation units containing these definitions is required to be available. \begin{note} -An implementation could encode sufficient +An implementation can choose to encode sufficient information into the translated translation unit so as to ensure the source is not required here. \end{note} diff --git a/source/lib-intro.tex b/source/lib-intro.tex index f16e359ba7..4dff7d312e 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -3051,13 +3051,6 @@ Objects constructed by the standard library that may hold a user-supplied pointer value or an integer of type \tcode{std::intptr_t} shall store such values in a traceable pointer location\iref{basic.stc.dynamic.safety}. -\begin{note} -Other libraries are -strongly encouraged to do the same, since not doing so may result in accidental use of -pointers that are not safely derived. Libraries that store pointers outside the user's -address space should make it appear that they are stored and retrieved from a traceable -pointer location. -\end{note} \rSec3[value.error.codes]{Value of error codes} diff --git a/source/preprocessor.tex b/source/preprocessor.tex index f51c725e66..bb14b643af 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -711,11 +711,12 @@ \pnum \begin{note} -Although an implementation can provide a mechanism for making arbitrary -source files available to the \tcode{< >} search, in general -programmers should use the \tcode{< >} form for headers provided -with the implementation, and the \tcode{" "} form for sources -outside the control of the implementation. For instance: +An implementation can provide a mechanism for making arbitrary +source files available to the \tcode{< >} search. +However, using the \tcode{< >} form for headers provided +with the implementation and the \tcode{" "} form for sources +outside the control of the implementation +achieves wider portability. For instance: \begin{codeblock} #include diff --git a/source/strings.tex b/source/strings.tex index 04cbf62f55..8c424da53f 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -3947,7 +3947,7 @@ \pnum \begin{note} The library provides implicit conversions from \tcode{const charT*} and \tcode{std::basic_string} to \tcode{std::basic_string_view} so that user code can accept just \tcode{std::basic_string_view} as a non-templated parameter wherever a sequence of characters is expected. -User-defined types should define their own implicit conversions to \tcode{std::basic_string_view} in order to interoperate with these functions. +User-defined types can define their own implicit conversions to \tcode{std::basic_string_view} in order to interoperate with these functions. \end{note} \rSec2[string.view.synop]{Header \tcode{} synopsis} diff --git a/source/support.tex b/source/support.tex index cac3249712..be2bb1979d 100644 --- a/source/support.tex +++ b/source/support.tex @@ -1985,7 +1985,7 @@ A function registered via \tcode{at_quick_exit} is invoked by the thread that calls \tcode{quick_exit}, which can be a different thread -than the one that registered it, so registered functions should not rely on the identity +than the one that registered it, so registered functions cannot rely on the identity of objects with thread storage duration. \end{note} After calling registered functions, \tcode{quick_exit} shall call \tcode{_Exit(status)}. diff --git a/source/threads.tex b/source/threads.tex index e28da204f7..a812eaaefc 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -2024,7 +2024,7 @@ \begin{note} Construction and destruction of an object of a mutex type need not be thread-safe; other -synchronization should be used to ensure that mutex objects are initialized +synchronization can be used to ensure that mutex objects are initialized and visible to other threads. \end{note} @@ -4240,11 +4240,8 @@ \pnum \begin{note} -The supplied lock will be held until the thread exits, and care -should be taken to ensure that this does not cause deadlock due to lock -ordering issues. After calling \tcode{notify_all_at_thread_exit} it is -recommended that the thread should be exited as soon as possible, and -that no blocking or time-consuming tasks are run on that thread. +The supplied lock is held until the thread exits, +which might cause deadlock due to lock ordering issues. \end{note} \pnum @@ -4332,7 +4329,7 @@ wait. This relaxes the usual rules, which would have required all wait calls to happen before destruction. Only the notification to unblock the wait needs to happen before destruction. -The user should take care to ensure that no threads wait on \tcode{*this} once the destructor has +Undefined behavior ensues if a thread waits on \tcode{*this} once the destructor has been started, especially when the waiting threads are calling the wait functions in a loop or using the overloads of \tcode{wait}, \tcode{wait_for}, or \tcode{wait_until} that take a predicate. \end{note} @@ -4689,8 +4686,8 @@ All of the standard mutex types meet this requirement. If a \tcode{Lock} type other than one of the standard mutex types or a \tcode{unique_lock} wrapper for a standard mutex type -is used with \tcode{condition_variable_any}, the user should ensure that any -necessary synchronization is in place with respect to the predicate associated +is used with \tcode{condition_variable_any}, any +necessary synchronization is assumed to be in place with respect to the predicate associated with the \tcode{condition_variable_any} instance. \end{note} @@ -4774,7 +4771,7 @@ wait. This relaxes the usual rules, which would have required all wait calls to happen before destruction. Only the notification to unblock the wait needs to happen before destruction. -The user should take care to ensure that no threads wait on \tcode{*this} once the destructor has +Undefined behavior ensues if a thread waits on \tcode{*this} once the destructor has been started, especially when the waiting threads are calling the wait functions in a loop or using the overloads of \tcode{wait}, \tcode{wait_for}, or \tcode{wait_until} that take a predicate. \end{note} @@ -6926,7 +6923,7 @@ \pnum \begin{note} Access to a value object stored in the shared state is -unsynchronized, so programmers should apply only those operations on \tcode{R} that do not +unsynchronized, so operations on \tcode{R} might introduce a data race\iref{intro.multithread}. \end{note} @@ -7163,8 +7160,7 @@ to the shared state created by this call to \tcode{async}. \begin{note} If a future obtained from \tcode{async} is moved outside the local scope, -other code that uses the future should be aware that the future's destructor can -block for the shared state to become ready. +the future's destructor can block for the shared state to become ready. \end{note} \pnum diff --git a/source/utilities.tex b/source/utilities.tex index 54ac861ecf..5b9c438d3d 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -7352,7 +7352,7 @@ \pnum \begin{note} -This function should be the inverse of \tcode{pointer_to}. +This function is intended to be the inverse of \tcode{pointer_to}. If defined, it customizes the behavior of the non-member function \tcode{to_address}\iref{pointer.conversion}. @@ -7442,10 +7442,10 @@ \pnum \begin{note} -It is expected that calls to \tcode{declare_reachable(p)} will consume +It is expected that calls to \tcode{declare_reachable(p)} consume a small amount of memory in addition to that occupied by the referenced object until the -matching call to \tcode{undeclare_reachable(p)} is encountered. Long running programs -should arrange that calls are matched. +matching call to \tcode{undeclare_reachable(p)} is encountered. +Thus, long-running programs where calls are not matched can exhibit a memory leak. \end{note} \end{itemdescr} @@ -8371,11 +8371,7 @@ derived, at the expense of providing far fewer garbage collection and leak detection options for \tcode{malloc()}-allocated objects. It also allows \tcode{malloc()} to be implemented with a separate allocation arena, bypassing -the normal \tcode{declare_reachable()} implementation. The above functions -should never intentionally be used as a replacement for -\tcode{declare_reachable()}, and newly written code is strongly encouraged to -treat memory allocated with these functions as though it were allocated with -\tcode{operator new}. +the normal \tcode{declare_reachable()} implementation. \end{note} \pnum @@ -9950,9 +9946,9 @@ \pnum \begin{note} -To avoid the possibility of a dangling pointer, the -user of this constructor should ensure that \tcode{p} remains valid at -least until the ownership group of \tcode{r} is destroyed. +Use of this constructor leads to a dangling pointer +unless \tcode{p} remains valid +at least until the ownership group of \tcode{r} is destroyed. \end{note} \pnum @@ -10326,8 +10322,8 @@ \pnum \begin{note} When multiple threads -can affect the return value of \tcode{use_count()}, -the result should be treated as approximate. +might affect the return value of \tcode{use_count()}, +the result is approximate. In particular, \tcode{use_count() == 1} does not imply that accesses through a previously destroyed \tcode{shared_ptr} have in any sense completed. \end{note} From 194bcabf4e7bdfc0753f2066662456e69d271531 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 17 Sep 2020 17:28:41 +0200 Subject: [PATCH 153/250] [check] Flag 'shall', 'may', or 'should' inside notes. --- tools/check.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/check.sh b/tools/check.sh index b6beddb6c6..1f4d623bc6 100755 --- a/tools/check.sh +++ b/tools/check.sh @@ -82,12 +82,12 @@ grep -n "&[ 0-9a-z_]\+) = delete" $texfiles && exit 1 # Bad characters in label. "-" is allowed due to a single remaining offender. grep -n '^\\rSec.\[[^]]*[^-a-z.0-9][^]]*\]{' $texfiles | sed 's/$/ <--- bad character in label/' | grep . && exit 1 -# "shall" inside a note +# "shall", "may", or "should" inside a note for f in $texfiles; do - sed -n '/begin{note}/,/end{note}/{/shall[^a-zA-Z]/{=;p}}' $f | + sed -n '/begin{note}/,/end{note}/{/\(shall\|may\|should\)[^a-zA-Z]/{=;p}}' $f | # prefix output with filename and line sed '/^[0-9]\+$/{N;s/\n/:/}' | sed "s/.*/$f:&/" | - sed 's/$/ <--- "shall" inside a note/' + sed 's/$/ <--- "shall", "should", or "may" inside a note/' done | grep . && exit 1 # Hanging paragraphs From 2664dbaf80666ef475304fdfa488aa5b2d7c1023 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 18 Sep 2020 22:39:40 +0200 Subject: [PATCH 154/250] [std] Remove 'should' and 'may' from footnotes. Partially addresses ISO/CS 017 (C++20 DIS) --- source/algorithms.tex | 4 ++-- source/basic.tex | 2 +- source/containers.tex | 2 +- source/declarations.tex | 2 +- source/expressions.tex | 16 ++++++++-------- source/future.tex | 7 +++++-- source/iostreams.tex | 7 ++++++- source/iterators.tex | 2 +- source/lex.tex | 4 ++-- source/lib-intro.tex | 6 +++--- source/locales.tex | 25 ++++++++++++++++--------- source/modules.tex | 2 +- source/numerics.tex | 6 +++--- source/overloading.tex | 2 +- 14 files changed, 51 insertions(+), 36 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 4f2f457456..aa6c88ca75 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -4463,7 +4463,7 @@ Copies elements in the range \range{first}{last} into the range \range{result - $N$}{result} starting from \tcode{last - 1} and proceeding to \tcode{first}.% -\footnote{\tcode{copy_backward} should be used instead of copy +\footnote{\tcode{copy_backward} can be used instead of copy when \tcode{last} is in the range \range{result - $N$}{result}.} For each positive integer $n \le N$, performs \tcode{*(result - $n$) = *(last - $n$)}. @@ -4614,7 +4614,7 @@ Moves elements in the range \range{first}{last} into the range \range{result - $N$}{result} starting from \tcode{last - 1} and proceeding to \tcode{first}.% -\footnote{\tcode{move_backward} should be used instead of move +\footnote{\tcode{move_backward} can be used instead of move when \tcode{last} is in the range \range{result - $N$}{result}.} For each positive integer $n \le N$, performs \tcode{*(result - $n$) = $E$}. diff --git a/source/basic.tex b/source/basic.tex index 0cba3c83cc..69f98d26af 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -1531,7 +1531,7 @@ A name used in the definition of a class \tcode{X}% \footnote{This refers to unqualified names following the class name; -such a name may be used in a \grammarterm{base-specifier} or +such a name might be used in a \grammarterm{base-specifier} or in the \grammarterm{member-specification} of the class definition.} outside of a complete-class context\iref{class.mem} of \tcode{X} shall be declared in one of the following ways: diff --git a/source/containers.tex b/source/containers.tex index 2e19c6e25a..7862b04c5a 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -5849,7 +5849,7 @@ \throws \tcode{length_error} if \tcode{n > max_size()}.\footnote{\tcode{reserve()} uses \tcode{Allocator::allocate()} which -may throw an appropriate exception.} +can throw an appropriate exception.} \pnum \remarks diff --git a/source/declarations.tex b/source/declarations.tex index 592fde29b1..3a52cfeb47 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -7598,7 +7598,7 @@ An ambiguity exists if the best match finds two functions with the same signature, even if one is in a namespace reachable through \grammarterm{using-directive}{s} in the namespace of the other.\footnote{During -name lookup in a class hierarchy, some ambiguities may be +name lookup in a class hierarchy, some ambiguities can be resolved by considering whether one member hides the other along some paths\iref{class.member.lookup}. There is no such disambiguation when considering the set of names found as a result of following diff --git a/source/expressions.tex b/source/expressions.tex index 156f0827e1..422bd5d823 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -292,7 +292,7 @@ whose type is not similar\iref{conv.qual} to one of the following types the behavior is undefined:\footnote{The intent of this list is to specify those circumstances in which an -object may or may not be aliased.} +object can or cannot be aliased.} \begin{itemize} \item the dynamic type of the object, @@ -3932,7 +3932,7 @@ \pnum An object pointer can be explicitly converted to an object pointer of a different type.\footnote{The -types may have different \cv-qualifiers, subject to +types can have different \cv-qualifiers, subject to the overall restriction that a \tcode{reinterpret_cast} cannot cast away constness.} When a prvalue \tcode{v} of object pointer type is converted to @@ -3970,7 +3970,7 @@ A prvalue of type ``pointer to member of \tcode{X} of type \tcode{T1}'' can be explicitly converted to a prvalue of a different type ``pointer to member of \tcode{Y} of type \tcode{T2}'' if \tcode{T1} and \tcode{T2} are both -function types or both object types.\footnote{\tcode{T1} and \tcode{T2} may have +function types or both object types.\footnote{\tcode{T1} and \tcode{T2} can have different \cv-qualifiers, subject to the overall restriction that a \tcode{reinterpret_cast} cannot cast away constness.} The null member pointer value\iref{conv.mem} is converted to the @@ -4570,7 +4570,7 @@ potentially-overlapping subobject is the size of the type, not the size of the subobject.% \footnote{The actual size of a potentially-overlapping subobject -may be less than the result of +can be less than the result of applying \tcode{sizeof} to the subobject, due to virtual base classes and less strict padding requirements on potentially-overlapping subobjects.} \indextext{array!\idxcode{sizeof}}% @@ -5174,7 +5174,7 @@ \pnum \indextext{\idxcode{new}!exception and}% -If any part of the object initialization described above\footnote{This may +If any part of the object initialization described above\footnote{This might include evaluating a \grammarterm{new-initializer} and/or calling a constructor.} terminates by throwing an exception and a suitable deallocation function @@ -7313,7 +7313,7 @@ that is usable in constant expressions or has constant initialization\iref{basic.start.static}.% \footnote{Testing this condition -may involve a trial evaluation of its initializer as described above.} +might involve a trial evaluation of its initializer as described above.} \begin{example} \begin{codeblock} template struct X {}; @@ -7354,12 +7354,12 @@ \item an immediate subexpression of a \grammarterm{braced-init-list},% -\footnote{Constant evaluation may be necessary to determine whether a narrowing conversion is performed\iref{dcl.init.list}.} +\footnote{Constant evaluation might be necessary to determine whether a narrowing conversion is performed\iref{dcl.init.list}.} \item an expression of the form \tcode{\&} \grammarterm{cast-expression} that occurs within a templated entity,% -\footnote{Constant evaluation may be necessary to determine whether such an expression is value-dependent\iref{temp.dep.constexpr}.} +\footnote{Constant evaluation might be necessary to determine whether such an expression is value-dependent\iref{temp.dep.constexpr}.} or \item diff --git a/source/future.tex b/source/future.tex index 3774d7b336..ba09cac4ab 100644 --- a/source/future.tex +++ b/source/future.tex @@ -865,8 +865,6 @@ How many additional write positions are made available is otherwise unspecified.% \indextext{unspecified}% -\footnote{An implementation should consider \tcode{alsize} in making this -decision.} If \tcode{palloc} is not a null pointer, the function calls \tcode{(*palloc)(n)} to allocate the new dynamic array object. @@ -890,6 +888,11 @@ or if \tcode{(strmode \& frozen) != 0}, the function cannot extend the array (reallocate it with greater length) to make a write position available. + +\pnum +\recommended +An implementation should consider \tcode{alsize} in making the +decision how many additional write positions to make available. \end{itemdescr} \indexlibrarymember{pbackfail}{strstreambuf}% diff --git a/source/iostreams.tex b/source/iostreams.tex index fc75dfed8f..69eaaec9d6 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -431,6 +431,11 @@ time prior to or during the first time an object of class \tcode{ios_base::Init} is constructed, and in any case before the body of \tcode{main}\iref{basic.start.main} begins execution. + +\recommended +If it is possible for them to do so, implementations should +initialize the objects earlier than required. + The objects are not destroyed during program execution.\footnote{Constructors and destructors for objects with static storage duration can access these objects to read input from @@ -3046,7 +3051,7 @@ Initializes:\footnote{The default constructor is protected for class \tcode{basic_streambuf} to assure that only objects for classes -derived from this class may be constructed.} +derived from this class can be constructed.} \begin{itemize} \item all pointer member objects to null pointers, diff --git a/source/iterators.tex b/source/iterators.tex index e394a90e41..45b7b0763a 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -594,7 +594,7 @@ that designate the beginning and end of the computation, or an iterator and a count that designate the beginning and the number of elements to which the computation is to be applied.\footnote{The sentinel denoting the end of a range -may have the same type as the iterator denoting the beginning of the range, or a +can have the same type as the iterator denoting the beginning of the range, or a different type.} \pnum diff --git a/source/lex.tex b/source/lex.tex index 3dfc91316f..ae4d5e9af0 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -637,9 +637,9 @@ specified in \tref{lex.name.disallowed}. Upper- and lower-case letters are different. All characters are significant.\footnote{On systems in which linkers cannot accept extended -characters, an encoding of the \grammarterm{universal-character-name} may be used in +characters, an encoding of the \grammarterm{universal-character-name} can be used in forming valid external identifiers. For example, some otherwise unused -character or sequence of characters may be used to encode the +character or sequence of characters can be used to encode the \tcode{\textbackslash u} in a \grammarterm{universal-character-name}. Extended characters may produce a long external identifier, but \Cpp{} does not place a translation limit on significant characters for external diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 4dff7d312e..976b9880d0 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -851,7 +851,7 @@ or namespaces nested within namespace \tcode{std}.\footnote{The C standard library headers\iref{depr.c.headers} also define names within the global namespace, while the \Cpp{} headers for C library -facilities\iref{headers} may also define names within the global namespace.}% +facilities\iref{headers} can also define names within the global namespace.}% \indextext{namespace} It is unspecified whether names declared in a specific namespace are declared directly in that namespace or in an inline namespace inside that @@ -2209,7 +2209,7 @@ that meets the minimum requirements of this document. Therefore -an implementation may elect, +an implementation can elect, under the as-if rule\iref{intro.execution}, to provide any customization point in the form @@ -2775,7 +2775,7 @@ described in \ref{\firstlibchapter} through \ref{\lastlibchapter} and \ref{depr} shall behave as if the implementation declared no additional non-member function signatures.\footnote{A valid \Cpp{} program always -calls the expected library non-member function. An implementation may +calls the expected library non-member function. An implementation can also define additional non-member functions that would otherwise not be called by a valid \Cpp{} program.} diff --git a/source/locales.tex b/source/locales.tex index b50ef5e59a..09a8fb04f9 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -2153,8 +2153,8 @@ constant number of \tcode{externT} characters needed to produce an internal character; or \tcode{0} if this number is not a constant.\footnote{If \tcode{encoding()} yields \tcode{-1}, then more than \tcode{max_length()} \tcode{externT} elements -may be consumed when producing a single \tcode{internT} character, and additional -\tcode{externT} elements may appear at the end of a sequence after those that +can be consumed when producing a single \tcode{internT} character, and additional +\tcode{externT} elements can appear at the end of a sequence after those that yield the final \tcode{internT} character.} \end{itemdescr} @@ -3749,7 +3749,7 @@ An enumeration value indicating the preferred order of components for those date formats that are composed of day, month, and year.\footnote{This function is intended as a convenience only, for common -formats, and may return +formats, and can return \tcode{no_order} in valid locales.} Returns @@ -4057,15 +4057,15 @@ interpreted identically as the format specifiers in the string argument to the standard library function \indexlibraryglobal{strftime}% -\tcode{strftime()}\footnote{Interpretation of the \tcode{modifier} -argument is implementation-defined, but should follow POSIX -conventions.}, +\tcode{strftime()}, except that the sequence of characters produced for those specifiers that are described as depending on the C locale are instead \impldef{formatted character sequence generated by \tcode{time_put::do_put} in C -locale}.\footnote{Implementations should refer to other standards -such as POSIX -for these definitions.} +locale}. +\begin{note} +Interpretation of the \tcode{modifier} +argument is implementation-defined. +\end{note} \pnum \returns @@ -4075,6 +4075,13 @@ formats or by derivations. A space character is a reasonable default for this argument. \end{note} + +\pnum +\recommended +Interpretation of the \tcode{modifier} should follow POSIX conventions. +Implementations should refer to other standards such as POSIX +for a specification of the character sequences produced for +those specifiers described as depending on the C locale. \end{itemdescr} \rSec3[locale.time.put.byname]{Class template \tcode{time_put_byname}} diff --git a/source/modules.tex b/source/modules.tex index 3f5c04a721..27b4b2e901 100644 --- a/source/modules.tex +++ b/source/modules.tex @@ -526,7 +526,7 @@ non-exported \grammarterm{module-import-declaration}{s} in the module unit purview of $U$.\footnote{This is consistent with the rules for visibility of imported names\iref{basic.scope.namespace}.} -These rules may in turn lead to the importation of yet more +These rules can in turn lead to the importation of yet more translation units. \pnum diff --git a/source/numerics.tex b/source/numerics.tex index 2cecc331ee..3569c540d8 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -2316,7 +2316,7 @@ \tcode{E(q)}% \indextext{constructor!random number engine requirement}\footnote{ This constructor (as well as the subsequent corresponding \tcode{seed()} function) - may be particularly useful + can be particularly useful to applications requiring a large number of independent random sequences. } @@ -7125,7 +7125,7 @@ that has zero length.\footnote{This default constructor is essential, since arrays of \tcode{valarray} -may be useful. +can be useful. After initialization, the length of an empty array can be increased with the \tcode{resize} member function.} @@ -8176,7 +8176,7 @@ Such a slice is specified by a starting index, a length, and a stride.\footnote{BLAS stands for \textit{Basic Linear Algebra Subprograms.} -\Cpp{} programs may instantiate this class. +\Cpp{} programs can instantiate this class. See, for example, Dongarra, Du Croz, Duff, and Hammerling: \textit{A set of Level 3 Basic Linear Algebra Subprograms}; diff --git a/source/overloading.tex b/source/overloading.tex index 3f127ef6b9..20564edcc6 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -1233,7 +1233,7 @@ is applied to the value returned, with the original second operand.\footnote{If the value returned by the \tcode{\keyword{operator}->} -function has class type, this may result in selecting and calling another +function has class type, this can result in selecting and calling another \tcode{\keyword{operator}->} function. The process repeats until an From f8b5d5ba32d81ebbb85917b03f186c56bdcbdf99 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 22 Sep 2020 23:12:21 +0200 Subject: [PATCH 155/250] [temp.constr.order] Remove example markers from footnote. --- source/templates.tex | 4 ---- 1 file changed, 4 deletions(-) diff --git a/source/templates.tex b/source/templates.tex index 26c1916d9b..926219bdef 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -1949,7 +1949,6 @@ in the disjunctive normal form\footnote{ A constraint is in disjunctive normal form when it is a disjunction of clauses where each clause is a conjunction of atomic constraints. -\begin{example} For atomic constraints $A$, $B$, and $C$, the disjunctive normal form of the constraint $A \land (B \lor C)$ @@ -1957,18 +1956,15 @@ $(A \land B) \lor (A \land C)$. % Its disjunctive clauses are $(A \land B)$ and $(A \land C)$. -\end{example} } of $P$, $P_i$ subsumes every conjunctive clause $Q_j$ in the conjunctive normal form\footnote{ A constraint is in conjunctive normal form when it is a conjunction of clauses where each clause is a disjunction of atomic constraints. -\begin{example} For atomic constraints $A$, $B$, and $C$, the constraint $A \land (B \lor C)$ is in conjunctive normal form. % Its conjunctive clauses are $A$ and $(B \lor C)$. -\end{example} } of $Q$, where \begin{itemize} From d50c9cc79ae0419281658b1e8affb2be1f4e25f8 Mon Sep 17 00:00:00 2001 From: burblebee Date: Tue, 22 Sep 2020 16:29:42 -0700 Subject: [PATCH 156/250] [std] "must" fixes and suggested rewordings. Partially addresses ISO/CS 017 (C++20 DIS). --- source/basic.tex | 8 ++++---- source/classes.tex | 5 +++-- source/compatibility.tex | 4 +--- source/containers.tex | 5 +++-- source/exceptions.tex | 3 ++- source/expressions.tex | 8 ++++---- source/grammar.tex | 4 ++-- source/iostreams.tex | 9 +++------ source/iterators.tex | 5 ----- source/locales.tex | 4 ++-- source/overloading.tex | 4 ++-- source/statements.tex | 13 +++++++++---- source/templates.tex | 32 ++++++++++---------------------- source/threads.tex | 11 ++++++----- 14 files changed, 51 insertions(+), 64 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 69f98d26af..b8b1dd832d 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -2509,7 +2509,7 @@ \indextext{lookup!class member}% In a class member access expression\iref{expr.ref}, if the \tcode{.} or \tcode{->} token is immediately followed by an \grammarterm{identifier} -followed by a \tcode{<}, the identifier must be looked up to determine +followed by a \tcode{<}, the identifier is looked up to determine whether the \tcode{<} is the beginning of a template argument list\iref{temp.names} or a less-than operator. The identifier is first looked up in the class of the object expression\iref{class.member.lookup}. @@ -3615,9 +3615,9 @@ automatic storage duration, upon exit from the thread for an object with thread storage duration, or upon exit from the program for an object with static storage duration.} -the program must ensure that an object of the original type occupies +and another object of the original type does not occupy that same storage location when the implicit destructor call takes -place; otherwise the behavior of the program is undefined. This is true +place, the behavior of the program is undefined. This is true even if the block is exited with an exception. \begin{example} \begin{codeblock} @@ -6157,7 +6157,7 @@ programs cannot observe most program transformations that do not change single-threaded program semantics. In fact, most single-threaded program transformations continue to be allowed, since any program that behaves -differently as a result must perform an undefined operation. +differently as a result has undefined behavior. \end{note} \pnum diff --git a/source/classes.tex b/source/classes.tex index 24cdcb9dc8..96c746b910 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3259,8 +3259,9 @@ \pnum \begin{note} -In general, one must use explicit destructor calls and placement -\grammarterm{new-expression} to change the active member of a union. +In cases where the above rule does not apply, +the active member of a union can only be changed by +the use of a placement \grammarterm{new-expression}. \end{note} \begin{example} Consider an object \tcode{u} of a \tcode{union} type \tcode{U} having non-static data members diff --git a/source/compatibility.tex b/source/compatibility.tex index 0f3de98456..3ade25628f 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -2029,7 +2029,7 @@ \diffref{expr.sizeof,expr.cast} \change -Types must be defined in declarations, not in expressions.\\ +In \Cpp{}, types can only be defined in declarations, not in expressions.\\ In C, a sizeof expression or cast expression may define a new type. For example, \begin{codeblock} @@ -2627,8 +2627,6 @@ \Cpp{} is not identical to ISO C\@. Mandating that \mname{STDC} be defined would require that translators make an incorrect claim. -Each implementation must choose the behavior that will be most -useful to its marketplace. \effect Change to semantics of well-defined feature. \difficulty diff --git a/source/containers.tex b/source/containers.tex index 7862b04c5a..a81bd64a12 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -4079,8 +4079,9 @@ \begin{note} Modifying any list requires access to the element preceding the first element of interest, but in a \tcode{forward_list} there is no constant-time way to access a -preceding element. For this reason, ranges that are modified, such as those supplied to -\tcode{erase} and \tcode{splice}, must be open at the beginning. +preceding element. +For this reason, \tcode{erase_after} and \tcode{splice_after} +take fully-open ranges, not semi-open ranges. \end{note} \begin{codeblock} diff --git a/source/exceptions.tex b/source/exceptions.tex index 9e7e3d5f20..765d26834b 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -998,7 +998,8 @@ \pnum \indextext{\idxcode{terminate}}% -In some situations exception handling must be abandoned +% FIXME: What does it mean to abandon exception handling? +In some situations exception handling is abandoned for less subtle error handling techniques. \begin{note} These situations are: diff --git a/source/expressions.tex b/source/expressions.tex index 422bd5d823..0140bf3cfb 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -6435,12 +6435,12 @@ \begin{itemize} \item If \tcode{E2} is an lvalue, the target type is ``lvalue reference to \tcode{T2}'', subject to the -constraint that in the conversion the reference must bind +constraint that in the conversion the reference binds directly\iref{dcl.init.ref} to a glvalue. \item If \tcode{E2} is an xvalue, the target type is ``rvalue reference to \tcode{T2}'', -subject to the constraint that the reference must bind directly. +subject to the constraint that the reference binds directly. \item If \tcode{E2} is a prvalue or if neither of the conversion sequences above can be formed and at least one of the operands has (possibly cv-qualified) class type: @@ -6615,8 +6615,8 @@ no new exception object is created. The exception is no longer considered to be caught. \begin{example} -Code that must be executed because of an exception, but cannot -completely handle the exception itself, can be written like this: +An exception handler that cannot completely handle the exception itself +can be written like this: \begin{codeblock} try { // ... diff --git a/source/grammar.tex b/source/grammar.tex index 8f776393ca..2baaebd454 100644 --- a/source/grammar.tex +++ b/source/grammar.tex @@ -10,8 +10,8 @@ In particular, the grammar described here accepts a superset of valid \Cpp{} constructs. Disambiguation rules~(\ref{stmt.ambig}, \ref{dcl.spec}, \ref{class.member.lookup}) -must be applied to distinguish expressions from declarations. -Further, access control, ambiguity, and type rules must be used +are applied to distinguish expressions from declarations. +Further, access control, ambiguity, and type rules are used to weed out syntactically valid but meaningless constructs. \rSec1[gram.key]{Keywords} diff --git a/source/iostreams.tex b/source/iostreams.tex index 69eaaec9d6..79eb93b16c 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -465,7 +465,8 @@ \pnum Concurrent access to a synchronized\iref{ios.members.static} standard iostream object's formatted and unformatted input\iref{istream} and output\iref{ostream} functions or a standard C stream by multiple threads does not result in a data race\iref{intro.multithread}. \begin{note} -Users must still synchronize concurrent use of these objects and streams by multiple threads if they wish to avoid interleaved characters. +Unsynchronized concurrent use of these objects and streams by multiple threads +can result in interleaved characters. \end{note} \xrefc{7.21.2} @@ -13550,9 +13551,6 @@ \tcode{equivalent("foo", "bar")} will be \tcode{true} when both paths resolve to the same file. \end{example} \end{itemize} -Programmers wishing to determine if two paths are ``the same'' must decide if - ``the same'' means ``the same representation'' or ``resolve to the same actual - file'', and choose the appropriate function accordingly. \end{note} \end{itemdescr} @@ -14251,8 +14249,7 @@ \begin{note} Implementations of \tcode{directory_iterator}\iref{fs.class.directory.iterator} are prohibited from directly or indirectly calling the \tcode{refresh} function -since it must access the external file system, -and the objective of caching is to avoid unnecessary file system accesses. +as described in \ref{fs.class.directory.iterator.general}. \end{note} \end{itemdescr} diff --git a/source/iterators.tex b/source/iterators.tex index 45b7b0763a..c1e5b2ca51 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -567,11 +567,6 @@ The library never assumes that past-the-end values are dereferenceable. Iterators can also have singular values that are not associated with any sequence. -\begin{example} -After the declaration of an uninitialized pointer \tcode{x} -(as with \tcode{int* x;}), -\tcode{x} must always be assumed to have a singular value of a pointer. -\end{example} Results of most expressions are undefined for singular values; the only exceptions are destroying an iterator that holds a singular value, the assignment of a non-singular value to diff --git a/source/locales.tex b/source/locales.tex index 09a8fb04f9..c0dd8c97a5 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -2053,11 +2053,11 @@ \tcode{ok}.\footnote{Informally, this means that \tcode{basic_filebuf} assumes that the mappings from internal to external characters is -1 to N: a +1 to N: that a \tcode{codecvt} facet that is used by \tcode{basic_filebuf} -must be able to translate characters one internal character at a time. +can translate characters one internal character at a time. } \begin{note} As a result of operations on \tcode{state}, it can return \tcode{ok} or \tcode{partial} and set \tcode{from_next == from} and \tcode{to_next != to}. diff --git a/source/overloading.tex b/source/overloading.tex index 20564edcc6..977ed2806b 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -838,7 +838,7 @@ a contrived object of type \tcode{T} becomes the implied object -argument.\footnote{An implied object argument must be contrived to +argument.\footnote{An implied object argument is contrived to correspond to the implicit object parameter attributed to member functions during overload resolution. It is not @@ -3352,7 +3352,7 @@ and \tcode{g()} are both overloaded functions, the -cross product of possibilities must be considered +Cartesian product of possibilities is considered to resolve \tcode{f(\&g)}, or the equivalent expression diff --git a/source/statements.tex b/source/statements.tex index abaf8fcb19..5a7cda05d5 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -1001,10 +1001,15 @@ declaration. If control enters the declaration concurrently while the variable is being initialized, the concurrent execution shall wait for completion -of the initialization.\footnote{The implementation must not introduce -any deadlock around execution of the initializer. Deadlocks might -still be caused by the program logic; the implementation need only -avoid deadlocks due to its own synchronization operations.} If control +of the initialization. +\begin{note} +A conforming implementation cannot introduce +any deadlock around execution of the initializer. +Deadlocks might still be caused by the program logic; +the implementation need only avoid deadlocks +due to its own synchronization operations. +\end{note} +If control re-enters the declaration recursively while the variable is being initialized, the behavior is undefined. \begin{example} diff --git a/source/templates.tex b/source/templates.tex index 926219bdef..44abcca8a8 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -694,31 +694,18 @@ id-expression \end{bnf} -\begin{note} -The name lookup rules\iref{basic.lookup} are used to associate the use of -a name with a template declaration; -that is, to identify a name as a -\grammarterm{template-name}. -\end{note} - \pnum -For a -\grammarterm{template-name} -to be explicitly qualified by the template arguments, -the name must be considered to refer to a template. +An \grammarterm{identifier} is a \grammarterm{template-name} +if it is associated by name lookup with +a template or an overload set that contains a function template, or +the \grammarterm{identifier} is followed by \tcode{<}, +the \grammarterm{template-id} would form an \grammarterm{unqualified-id}, and +name lookup either finds one or more functions or finds nothing. \begin{note} Whether a name actually refers to a template cannot be known in some cases until after argument dependent lookup is done\iref{basic.lookup.argdep}. \end{note} -A name is considered to refer to a template if -name lookup finds -a \grammarterm{template-name} -or an overload set that contains a function template. -A name is also considered to refer to a template if -it is an \grammarterm{unqualified-id} -followed by a \tcode{<} -and name lookup either finds one or more functions or finds nothing. \pnum \indextext{\idxcode{<}!template and}% @@ -4642,7 +4629,7 @@ is the standard output stream declared in \tcode{iostream}. However, not every declaration can be found this way; the resolution of -some names must be postponed +some names is postponed until the actual \grammarterm{template-argument}{s} are known. @@ -7132,12 +7119,13 @@ otherwise, it is a declaration. \begin{note} The definition of a static data member of a template -that requires default-initialization must use a \grammarterm{braced-init-list}: +for which default-initialization is desired +can use functional cast notation\iref{expr.type.conv}: \begin{codeblock} template<> X Q::x; // declaration template<> X Q::x (); // error: declares a function -template<> X Q::x { }; // definition +template<> X Q::x = X(); // definition \end{codeblock} \end{note} diff --git a/source/threads.tex b/source/threads.tex index a812eaaefc..fabf65509e 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -93,8 +93,8 @@ \pnum The functions whose names end in \tcode{_for} take an argument that specifies a duration. These functions produce relative timeouts. Implementations -should use a steady clock to measure time for these functions.\footnote{All -implementations for which standard time units are meaningful must necessarily +should use a steady clock to measure time for these functions.% +\footnote{Implementations for which standard time units are meaningful will typically have a steady clock within their hardware implementation.} Given a duration argument $D_t$, the real-time duration of the timeout is $D_t + D_i + D_m$. @@ -1271,8 +1271,9 @@ \begin{note} Either implicitly detaching or joining a \tcode{joinable()} thread in its destructor could result in difficult to debug correctness (for detach) or performance -(for join) bugs encountered only when an exception is thrown. Thus the programmer must -ensure that the destructor is never executed while the thread is still joinable. +(for join) bugs encountered only when an exception is thrown. +These bugs can be avoided by ensuring that +the destructor is never executed while the thread is still joinable. \end{note} \end{itemdescr} @@ -4031,7 +4032,7 @@ not result in deadlock, but is otherwise unspecified. \begin{note} A deadlock avoidance -algorithm such as try-and-back-off must be used, but the specific algorithm is not +algorithm such as try-and-back-off can be used, but the specific algorithm is not specified to avoid over-constraining implementations. \end{note} If a call to From 68f91610919ad3e9bd72bf04b37c0675e2947e76 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 23 Sep 2020 00:05:21 +0200 Subject: [PATCH 157/250] [std] Fix the remainder of 'may' and 'shall' in footnotes. --- source/lex.tex | 2 +- source/preprocessor.tex | 4 ++-- source/support.tex | 2 +- source/templates.tex | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/lex.tex b/source/lex.tex index ae4d5e9af0..d3ad3baf9f 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -641,7 +641,7 @@ forming valid external identifiers. For example, some otherwise unused character or sequence of characters can be used to encode the \tcode{\textbackslash u} in a \grammarterm{universal-character-name}. Extended -characters may produce a long external identifier, but \Cpp{} does not +characters can produce a long external identifier, but \Cpp{} does not place a translation limit on significant characters for external identifiers. In \Cpp{}, upper- and lower-case letters are considered different for all identifiers, including external identifiers. } diff --git a/source/preprocessor.tex b/source/preprocessor.tex index bb14b643af..b74f2f6c78 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -548,13 +548,13 @@ \tcode{\#endif} \indextext{\idxcode{\#endif}}% are skipped.\footnote{As indicated by the syntax, -a preprocessing token shall not follow a +a preprocessing token cannot follow a \tcode{\#else} or \tcode{\#endif} directive before the terminating new-line character. However, -comments may appear anywhere in a source file, +comments can appear anywhere in a source file, including within a preprocessing directive.} \pnum diff --git a/source/support.tex b/source/support.tex index be2bb1979d..137812b28f 100644 --- a/source/support.tex +++ b/source/support.tex @@ -2395,7 +2395,7 @@ expressions. The array \tcode{new} -expression, may, however, increase the \tcode{size} argument to +expression, can, however, increase the \tcode{size} argument to \tcode{operator new[]} to obtain space to store supplemental information.} diff --git a/source/templates.tex b/source/templates.tex index 44abcca8a8..92603951cd 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -9026,7 +9026,7 @@ \grammarterm{template-parameter} of type \tcode{bool} -may be deduced from an array bound, the resulting value will always be +can be deduced from an array bound, the resulting value will always be \tcode{true} because the array bound will be nonzero.} \begin{example} From b51ffed7878a3026c0a3cbfc83a078c281e9e744 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Thu, 24 Sep 2020 16:33:48 +0100 Subject: [PATCH 158/250] [iostream.objects.overview] Delete duplicate paragraph. Initially, 46a40362b6f60410385e3f1f97d45b9e1bc41b4d moved a footnote into a new "recommended practice" paragraph. Later, 2664dbaf80666ef475304fdfa488aa5b2d7c1023 added the same "recommended practice" into the middle of the paragraph that originally contained the footnote. --- source/iostreams.tex | 5 ----- 1 file changed, 5 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 79eb93b16c..881b678327 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -431,11 +431,6 @@ time prior to or during the first time an object of class \tcode{ios_base::Init} is constructed, and in any case before the body of \tcode{main}\iref{basic.start.main} begins execution. - -\recommended -If it is possible for them to do so, implementations should -initialize the objects earlier than required. - The objects are not destroyed during program execution.\footnote{Constructors and destructors for objects with static storage duration can access these objects to read input from From c80b3d830ea3b19eded9df392498e862de066da5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sat, 26 Sep 2020 22:14:03 +0100 Subject: [PATCH 159/250] [basic.fundamental] Delete stray space. --- source/basic.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index b8b1dd832d..e096189949 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -4871,7 +4871,7 @@ \pnum \indextext{type!implementation-defined \tcode{sizeof}}% \indextext{type!standard signed integer}% -There are five \defnx{standard signed integer types}{standard signed integer type} : +There are five \defnx{standard signed integer types}{standard signed integer type}: \indextext{type!\idxcode{signed char}}% \indextext{type!\idxcode{short}}% \indextext{type!\idxcode{int}}% From 372bb34a3e56257e6bb9aac75a60e78f47af17e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Fri, 25 Sep 2020 00:43:54 +0100 Subject: [PATCH 160/250] [lex.charset] Replace "is required" wording in footnote with simple statement. --- source/lex.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/lex.tex b/source/lex.tex index d3ad3baf9f..694326966b 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -216,10 +216,10 @@ new-line, plus the following 91 graphical characters:\footnote{The glyphs for the members of the basic source character set are intended to identify characters from the subset of ISO/IEC 10646 which corresponds to the ASCII -character set. However, because the mapping from source file characters to the source +character set. However, the mapping from source file characters to the source character set (described in translation phase 1) is specified as \impldef{mapping from physical source file characters to basic source character set}, -an implementation is required to document how the basic source characters are +and therefore implementations must document how the basic source characters are represented in source files.} \begin{codeblock} a b c d e f g h i j k l m n o p q r s t u v w x y z From eda42d448c5c164b21733eec59956d7b1a33009a Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 25 Sep 2020 00:19:03 +0200 Subject: [PATCH 161/250] [futures.async] Avoid note within a sentence (c++20 version). --- source/threads.tex | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index fabf65509e..a440cc74b0 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -7166,19 +7166,18 @@ \pnum \sync -Regardless of the provided \tcode{policy} argument, +The following apply regardless of the provided \tcode{policy} argument: \begin{itemize} \item -the invocation of \tcode{async} +The invocation of \tcode{async} synchronizes with\iref{intro.multithread} the invocation of \tcode{f}. \begin{note} This statement applies even when the corresponding \tcode{future} object is moved to another thread. \end{note} -; and \item -the completion of the function \tcode{f} is sequenced before\iref{intro.multithread} the +The completion of the function \tcode{f} is sequenced before\iref{intro.multithread} the shared state is made ready. \begin{note} \tcode{f} might not be called at all, From 2c8cb6977c3fbb7a9665e25cd8d417da49227e68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 29 Sep 2020 00:24:29 +0100 Subject: [PATCH 162/250] [intro.compliance.general, implimits] Cite Annex B normatively. This change also promotes Annex B [implimits] to a "normative" annex. The existing wording in the annex is already normative in character. --- source/intro.tex | 3 ++- source/limits.tex | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/source/intro.tex b/source/intro.tex index bbcac8c628..6710ad90c0 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -718,7 +718,8 @@ 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, accept and correctly execute\footnote{``Correct execution'' can include undefined behavior, depending on +within its resource limits as described in \ref{implimits}, +accept and correctly execute\footnote{``Correct execution'' can include undefined behavior, depending on the data being processed; see \ref{intro.defs} and~\ref{intro.execution}.} that program. \item diff --git a/source/limits.tex b/source/limits.tex index 985f17a309..c5f90e665c 100644 --- a/source/limits.tex +++ b/source/limits.tex @@ -1,5 +1,5 @@ %!TEX root = std.tex -\infannex{implimits}{Implementation quantities} +\normannex{implimits}{Implementation quantities} \pnum Because computers are finite, \Cpp{} implementations are inevitably From 80bc93f091daa6935794905726ec4a512aafd83b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 29 Sep 2020 12:44:26 +0100 Subject: [PATCH 163/250] [range.istream.iterator] Add missing space. --- source/ranges.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/ranges.tex b/source/ranges.tex index 5e0220dd39..8deb2ae1f7 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -2888,7 +2888,7 @@ \effects Equivalent to: \begin{codeblock} -*@\exposid{parent_}@->@\exposid{stream_}@>> @\exposid{parent_}@->@\exposid{object_}@; +*@\exposid{parent_}@->@\exposid{stream_}@ >> @\exposid{parent_}@->@\exposid{object_}@; return *this; \end{codeblock} \end{itemdescr} From 840af6406c8993ac5787c8a1fbb067488f86bb6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 29 Sep 2020 19:34:36 +0100 Subject: [PATCH 164/250] [class.mem.general] Move note to the end of the list item. With the new note style, notes should no longer appear in the middle of a sentence. --- source/classes.tex | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index 96c746b910..3ee649350a 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -745,12 +745,11 @@ \begin{itemize} \item every static data member of class \tcode{T}; -\item every member function of class \tcode{T} +\item every member function of class \tcode{T}; \begin{note} This restriction does not apply to constructors, which do not have names\iref{class.ctor} \end{note}% -; \item every member of class \tcode{T} that is itself a type; From 9a8c6aede408b309d42c799da9e01f4409eebcc3 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 24 Mar 2020 11:52:23 -0700 Subject: [PATCH 165/250] Add Foreword. The general text was provided by the ISO CS. A list of incorporated technical specifications was derived from N4824. A list of technical changes since C++17 was derived from P2131R0. --- source/front.tex | 2 + source/preface.tex | 184 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 186 insertions(+) create mode 100644 source/preface.tex diff --git a/source/front.tex b/source/front.tex index 1961ad74cf..8a94d990f5 100644 --- a/source/front.tex +++ b/source/front.tex @@ -20,3 +20,5 @@ \hypertarget{toctarget}{\tableofcontents*} \setcounter{tocdepth}{5} + +\input{preface} diff --git a/source/preface.tex b/source/preface.tex new file mode 100644 index 0000000000..ecc5efc7a7 --- /dev/null +++ b/source/preface.tex @@ -0,0 +1,184 @@ +%!TEX root = std.tex +\chapter{Foreword} + +ISO (the International Organization for Standardization) and IEC (the +International Electrotechnical Commission) form the specialized system for +worldwide standardization. National bodies that are members of ISO or IEC +participate in the development of International Standards through technical +committees established by the respective organization to deal with particular +fields of technical activity. ISO and IEC technical committees collaborate in +fields of mutual interest. Other international organizations, governmental and +non-governmental, in liaison with ISO and IEC, also take part in the work. + +The procedures used to develop this document and those intended for its further +maintenance are described in the ISO/IEC Directives, Part 1. In particular the +different approval criteria needed for the different types of documents should +be noted. This document was drafted in accordance with the editorial rules of +the ISO/IEC Directives, Part 2 +(see \href{http://www.iso.org/directives}{\tcode{www.iso.org/directives}}). + +Attention is drawn to the possibility that some of the elements of this +document may be the subject of patent rights. ISO and IEC shall not be held +responsible for identifying any or all such patent rights. Details of any +patent rights identified during the development of the document will be in the +Introduction and/or on the ISO list of patent declarations received +(see \href{http://www.iso.org/patents}{\tcode{www.iso.org/patents}}) +or the IEC list of patent declarations received +(see \href{http://patents.iec.ch}{\tcode{http://patents.iec.ch}}). + +Any trade name used in this document is information given for the convenience +of users and does not constitute an endorsement. + +For an explanation on +the voluntary nature of standards, +the meaning of ISO specific terms and expressions related +to conformity assessment, as well as information about ISO's adherence +to the World Trade Organization (WTO) principles +in the Technical Barriers to Trade (TBT) see the following URL: +\href{http://www.iso.org/iso/foreword.html}{\tcode{www.iso.org/iso/foreword.html}}. + +This document was prepared by +Joint Technical Committee ISO/IEC JTC 1, \textit{Information technology}, +Subcommittee SC 22, \textit{Programming languages, their environments and system software interfaces}. + +This sixth edition cancels and replaces the fifth edition +(ISO/IEC 14882:2017), which has been technically revised. +It also incorporates the Technical Specifications +\begin{itemize} +\item ISO/IEC TS 19217:2015 \textit{Programming Languages --- \Cpp{} Extensions for concepts}, +\item ISO/IEC TS 21425:2017 \textit{Programming Languages --- \Cpp{} Extensions for ranges}, +\item ISO/IEC TS 22277:2017 \textit{Programming Languages --- \Cpp{} Extensions for Coroutines}, +\item ISO/IEC TS 21544:2018 \textit{Programming Languages --- Extensions to \Cpp{} for Modules}, +\item portions of ISO/IEC TS 19571:2016 \textit{Programming Languages --- Technical specification for \Cpp{} extensions for concurrency}, and % latch and barrier +\item portions of ISO/IEC TS 19568:2017 \textit{Programming Languages --- \Cpp{} Extensions for Library Fundamentals}. +\end{itemize} + +The main changes compared to the previous edition are as follows: + +\begin{itemize} +% language changes +\item addition of concepts, \grammarterm{requires-clause}s, and \grammarterm{requires-expression}s and +\libheaderref{concepts} header +\item addition of coroutines, including +\keyword{co_yield}, \keyword{co_await}, and \keyword{co_return} keywords and +\libheaderref{coroutine} header +\item addition of modules, \grammarterm{import-declaration}s, and \grammarterm{export-declaration}s +\item addition of three-way comparison, defaulted comparisons, +rewriting of comparison operator expressions, and \libheaderref{compare} header +\item addition of designated initializers +\item support for class types and floating-point types as the type of a non-type template parameter +\item new attributes \tcode{[[no_unique_address]]}, \tcode{[[likely]]}, \tcode{[[unlikely]]} +\item support for optional reason string in \tcode{[[nodiscard]]} attribute +\item ability to require constant initialization with \keyword{constinit} keyword +\item ability to require constant evaluation with \keyword{consteval} keyword +\item extension of constant evaluation support to cover +\begin{itemize} + \item memory allocation and deallocation + \item virtual function calls + \item \keyword{dynamic_cast} and \keyword{typeid} + \item changing the active member of a union + \item uninitialized variables +\end{itemize} +\item support for constexpr functions to contain +\keyword{catch} handlers and \grammarterm{asm-declaration}s +that are not reached during constant evaluation +\item support for controlling destruction in a class-specific operator delete function +\item addition of \keyword{using} \keyword{enum} declaration +\item addition of \keyword{char8_t} type +\item guarantee that \keyword{char16_t} and \keyword{char32_t} literals +are encoded as UTF-16 and UTF-32 respectively +\item support for an initializer statement in range-based for loops +\item support for default member initializers for bit-fields +\item support for parenthesized aggregate initialization +\item extended support for lambda expressions, including +\begin{itemize} + \item explicit \grammarterm{template-head}s in generic lambdas + \item default construction and assignment of stateless closure types + \item lambda expressions in unevaluated operands + \item pack expansion of lambda \grammarterm{init-capture}s +\end{itemize} +\item generalized support for structured bindings +\item support for inline namespaces in nested namespace definitions +\item support for conditionally-explicit member functions +\item extended support for class template argument deduction to cover +aggregate initialization and alias templates +\item reduced cases in which \keyword{typename} is required +\item support for calling an undeclared \grammarterm{template-id} +via argument-dependent name lookup +\item relaxed access checking rules in template specialization declarations +\item revised memory model +\item expanded cases in which returned or thrown variables are implicitly moved +\item extended support for variadic macros with \mname{VA_OPT} +% library changes +\item feature test macros and \libheaderref{version} header +\item restricted valid uses of standard library functions and function templates +\item addition of ranges and \libheaderref{ranges} header +\item addition of calendar and time zone support +\item addition of text formatting library and \libheaderref{format} header +\item addition of synchronization facilities for +waiting, notifications, semaphores, latches, and barriers, and +\libheaderref{barrier}, \libheaderref{latch} and \libheaderref{semaphore} headers +\item addition of mathematical constants library and \libheaderref{numbers} header +\item support for representing source locations and \libheaderrefx{source_location}{source.location.syn} header +\item addition of \tcode{span} view and \libheaderref{span} header +\item addition of joining thread class and \libheaderrefx{stop_token}{thread.stoptoken.syn} header +\item extensions to atomic types and operations, including +\begin{itemize} + \item new class template \tcode{atomic_ref} + \item new atomic floating-point operations + \item new atomic smart pointer types + \item support for compare-and-exchange operations on types with padding + \item conversion of \tcode{memory_order} to a scoped enumeration +\end{itemize} +\item addition of \tcode{unsequenced} execution policy +\item new utility functions, types, and templates in the standard library, including +\begin{itemize} + \item \raggedright new type traits + \tcode{is_bounded_array}, + \tcode{is_corresponding_member}, + \tcode{is_layout_compatible}, + \tcode{is_nothrow_convertible}, + \tcode{is_pointer_interconvertible_base_of}, + \tcode{is_pointer_interconvertible_with_class}, and + \tcode{is_unbounded_array} + \item new transformation traits + \tcode{remove_cvref}, + \tcode{type_identity}, + \tcode{unwrap_ref_decay}, and + \tcode{unwrap_reference} + \item new standard library primitive functions \tcode{assume_aligned} and + \tcode{is_constant_evaluated} + \item new free functions \tcode{erase} and \tcode{erase_if} for containers + \item utilities for uses-allocator construction + \item function template \tcode{to_address} + \item function template \tcode{bind_front} + \item function template \tcode{to_array} +\end{itemize} +\item \tcode{make_shared} support for array types +\item support for allocating objects owned by \tcode{shared_ptr} and \tcode{unique_ptr} +with default initialization +\item addition of bit manipulation library and \libheaderref{bit} header +\item addition of a synchronized buffered output stream and \libheaderref{syncstream} header +\item addition of \tcode{shift} algorithms +\item addition of \tcode{midpoint} and \tcode{lerp} math functions +\item use of \tcode{[[nodiscard]]} attribute in the standard library +\item support for heterogeneous lookup for unordered containers +\item support for element existence detection in associative containers +\item change to return removed element count +from \tcode{remove}, \tcode{remove_if}, and \tcode{unique} +member functions on \tcode{list} and \tcode{forward_list} +\item addition of \tcode{starts_with} and \tcode{ends_with} +to \tcode{basic_string} and \tcode{basic_string_view} +\item support for move semantics in \libheaderrefx{numeric}{numeric.ops.overview} algorithms +\item support for efficient access to the buffer of a \tcode{basic_stringbuf} +\item extended constant expression evaluation support in the standard library +to cover more algorithms, utilities, and types, including +\tcode{pair}, \tcode{tuple}, \tcode{vector}, and \tcode{string} +% annexes +\item removal of deprecated features +\end{itemize} + +Any feedback or questions on this document +should be directed to the user's national standards body. +A complete listing of these bodies can be found at +\href{http://www.iso.org/members.html}{\tcode{www.iso.org/members.html}}. From 45e500c9b3dfa0cdc0e26f9fb8f225d5fea27c46 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 9 Sep 2020 13:09:11 -0700 Subject: [PATCH 166/250] Fix minor deviations between Foreword and ISO/CS standard text. Simplify list of main changes and remove some more minor items. Fixes ISO/CS 012 (C++20 DIS). --- source/preface.tex | 100 ++++++++------------------------------------- 1 file changed, 16 insertions(+), 84 deletions(-) diff --git a/source/preface.tex b/source/preface.tex index ecc5efc7a7..9fef45dc66 100644 --- a/source/preface.tex +++ b/source/preface.tex @@ -12,7 +12,7 @@ \chapter{Foreword} The procedures used to develop this document and those intended for its further maintenance are described in the ISO/IEC Directives, Part 1. In particular the -different approval criteria needed for the different types of documents should +different approval criteria needed for the different types of document should be noted. This document was drafted in accordance with the editorial rules of the ISO/IEC Directives, Part 2 (see \href{http://www.iso.org/directives}{\tcode{www.iso.org/directives}}). @@ -34,7 +34,7 @@ \chapter{Foreword} the meaning of ISO specific terms and expressions related to conformity assessment, as well as information about ISO's adherence to the World Trade Organization (WTO) principles -in the Technical Barriers to Trade (TBT) see the following URL: +in the Technical Barriers to Trade (TBT), see \href{http://www.iso.org/iso/foreword.html}{\tcode{www.iso.org/iso/foreword.html}}. This document was prepared by @@ -43,21 +43,21 @@ \chapter{Foreword} This sixth edition cancels and replaces the fifth edition (ISO/IEC 14882:2017), which has been technically revised. -It also incorporates the Technical Specifications + +The main changes compared to the previous edition are as follows: + +\begin{itemize} +\item incorporation of the Technical Specifications \begin{itemize} \item ISO/IEC TS 19217:2015 \textit{Programming Languages --- \Cpp{} Extensions for concepts}, \item ISO/IEC TS 21425:2017 \textit{Programming Languages --- \Cpp{} Extensions for ranges}, \item ISO/IEC TS 22277:2017 \textit{Programming Languages --- \Cpp{} Extensions for Coroutines}, \item ISO/IEC TS 21544:2018 \textit{Programming Languages --- Extensions to \Cpp{} for Modules}, \item portions of ISO/IEC TS 19571:2016 \textit{Programming Languages --- Technical specification for \Cpp{} extensions for concurrency}, and % latch and barrier -\item portions of ISO/IEC TS 19568:2017 \textit{Programming Languages --- \Cpp{} Extensions for Library Fundamentals}. +\item portions of ISO/IEC TS 19568:2017 \textit{Programming Languages --- \Cpp{} Extensions for Library Fundamentals}, \end{itemize} - -The main changes compared to the previous edition are as follows: - -\begin{itemize} % language changes -\item addition of concepts, \grammarterm{requires-clause}s, and \grammarterm{requires-expression}s and +\item addition of concepts, \grammarterm{requires-clause}s, \grammarterm{requires-expression}s, and \libheaderref{concepts} header \item addition of coroutines, including \keyword{co_yield}, \keyword{co_await}, and \keyword{co_return} keywords and @@ -71,111 +71,43 @@ \chapter{Foreword} \item support for optional reason string in \tcode{[[nodiscard]]} attribute \item ability to require constant initialization with \keyword{constinit} keyword \item ability to require constant evaluation with \keyword{consteval} keyword -\item extension of constant evaluation support to cover -\begin{itemize} - \item memory allocation and deallocation - \item virtual function calls - \item \keyword{dynamic_cast} and \keyword{typeid} - \item changing the active member of a union - \item uninitialized variables -\end{itemize} -\item support for constexpr functions to contain -\keyword{catch} handlers and \grammarterm{asm-declaration}s -that are not reached during constant evaluation +\item extensions to constant evaluation \item support for controlling destruction in a class-specific operator delete function \item addition of \keyword{using} \keyword{enum} declaration \item addition of \keyword{char8_t} type -\item guarantee that \keyword{char16_t} and \keyword{char32_t} literals -are encoded as UTF-16 and UTF-32 respectively \item support for an initializer statement in range-based for loops \item support for default member initializers for bit-fields \item support for parenthesized aggregate initialization -\item extended support for lambda expressions, including -\begin{itemize} - \item explicit \grammarterm{template-head}s in generic lambdas - \item default construction and assignment of stateless closure types - \item lambda expressions in unevaluated operands - \item pack expansion of lambda \grammarterm{init-capture}s -\end{itemize} -\item generalized support for structured bindings +\item extensions to lambda expressions +\item extensions to structured bindings \item support for inline namespaces in nested namespace definitions \item support for conditionally-explicit member functions -\item extended support for class template argument deduction to cover -aggregate initialization and alias templates +\item extensions to class template argument deduction \item reduced cases in which \keyword{typename} is required \item support for calling an undeclared \grammarterm{template-id} via argument-dependent name lookup -\item relaxed access checking rules in template specialization declarations \item revised memory model -\item expanded cases in which returned or thrown variables are implicitly moved \item extended support for variadic macros with \mname{VA_OPT} % library changes \item feature test macros and \libheaderref{version} header -\item restricted valid uses of standard library functions and function templates \item addition of ranges and \libheaderref{ranges} header \item addition of calendar and time zone support \item addition of text formatting library and \libheaderref{format} header -\item addition of synchronization facilities for -waiting, notifications, semaphores, latches, and barriers, and -\libheaderref{barrier}, \libheaderref{latch} and \libheaderref{semaphore} headers +\item addition of \libheaderref{barrier}, \libheaderref{latch}, and \libheaderref{semaphore} headers \item addition of mathematical constants library and \libheaderref{numbers} header \item support for representing source locations and \libheaderrefx{source_location}{source.location.syn} header \item addition of \tcode{span} view and \libheaderref{span} header \item addition of joining thread class and \libheaderrefx{stop_token}{thread.stoptoken.syn} header -\item extensions to atomic types and operations, including -\begin{itemize} - \item new class template \tcode{atomic_ref} - \item new atomic floating-point operations - \item new atomic smart pointer types - \item support for compare-and-exchange operations on types with padding - \item conversion of \tcode{memory_order} to a scoped enumeration -\end{itemize} +\item extensions to atomic types and operations \item addition of \tcode{unsequenced} execution policy -\item new utility functions, types, and templates in the standard library, including -\begin{itemize} - \item \raggedright new type traits - \tcode{is_bounded_array}, - \tcode{is_corresponding_member}, - \tcode{is_layout_compatible}, - \tcode{is_nothrow_convertible}, - \tcode{is_pointer_interconvertible_base_of}, - \tcode{is_pointer_interconvertible_with_class}, and - \tcode{is_unbounded_array} - \item new transformation traits - \tcode{remove_cvref}, - \tcode{type_identity}, - \tcode{unwrap_ref_decay}, and - \tcode{unwrap_reference} - \item new standard library primitive functions \tcode{assume_aligned} and - \tcode{is_constant_evaluated} - \item new free functions \tcode{erase} and \tcode{erase_if} for containers - \item utilities for uses-allocator construction - \item function template \tcode{to_address} - \item function template \tcode{bind_front} - \item function template \tcode{to_array} -\end{itemize} -\item \tcode{make_shared} support for array types -\item support for allocating objects owned by \tcode{shared_ptr} and \tcode{unique_ptr} -with default initialization +\item new utility functions, types, and templates in the standard library \item addition of bit manipulation library and \libheaderref{bit} header \item addition of a synchronized buffered output stream and \libheaderref{syncstream} header -\item addition of \tcode{shift} algorithms -\item addition of \tcode{midpoint} and \tcode{lerp} math functions -\item use of \tcode{[[nodiscard]]} attribute in the standard library \item support for heterogeneous lookup for unordered containers \item support for element existence detection in associative containers -\item change to return removed element count -from \tcode{remove}, \tcode{remove_if}, and \tcode{unique} -member functions on \tcode{list} and \tcode{forward_list} -\item addition of \tcode{starts_with} and \tcode{ends_with} -to \tcode{basic_string} and \tcode{basic_string_view} \item support for move semantics in \libheaderrefx{numeric}{numeric.ops.overview} algorithms \item support for efficient access to the buffer of a \tcode{basic_stringbuf} \item extended constant expression evaluation support in the standard library -to cover more algorithms, utilities, and types, including -\tcode{pair}, \tcode{tuple}, \tcode{vector}, and \tcode{string} -% annexes -\item removal of deprecated features \end{itemize} Any feedback or questions on this document From 6f44fe3c7dc24251db76f32b67ecd070807aa150 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sat, 26 Sep 2020 23:45:26 +0100 Subject: [PATCH 167/250] [foreword] Exclude mentions of library headers from the index. It does not seem helpful to link into the mention of a header in the foreword, esp. since these links would use the Roman frontmatter page numbers. --- source/preface.tex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/preface.tex b/source/preface.tex index 9fef45dc66..900ce3cbf5 100644 --- a/source/preface.tex +++ b/source/preface.tex @@ -1,4 +1,9 @@ %!TEX root = std.tex + +\let\OldLibHeader\libheader +\newcommand{\simplelibheader}[1]{\tcode{<#1>}} +\let\libheader\simplelibheader + \chapter{Foreword} ISO (the International Organization for Standardization) and IEC (the @@ -114,3 +119,5 @@ \chapter{Foreword} should be directed to the user's national standards body. A complete listing of these bodies can be found at \href{http://www.iso.org/members.html}{\tcode{www.iso.org/members.html}}. + +\let\libheader\OldLibHeader From 2e0878664df4467b56956f61cd752d95ab88aa4d Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 9 Sep 2020 13:44:53 -0700 Subject: [PATCH 168/250] [xrefdelta] Fix unresolved reference. --- source/xrefdelta.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/xrefdelta.tex b/source/xrefdelta.tex index c32c795cfc..008650f225 100644 --- a/source/xrefdelta.tex +++ b/source/xrefdelta.tex @@ -157,7 +157,7 @@ \movedxref{class.copy}{class.mem} % Top-level clause merging caused some Annex A subclauses to vanish. -\movedxref{gram.decl}{gram.dcl.decl} +\movedxref{gram.decl}{gram.dcl} \movedxref{gram.derived}{gram.class} \movedxref{gram.special}{gram.class} From a2f42e51e253f30085e23ef76140cb8d6cadcc32 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 29 Sep 2020 23:49:18 +0200 Subject: [PATCH 169/250] [std] Introduce tailnote environment to avoid empty lines in tables. (#4249) --- source/iostreams.tex | 4 ++-- source/lib-intro.tex | 4 ++-- source/macros.tex | 8 ++++++-- source/time.tex | 4 ++-- source/utilities.tex | 24 ++++++++++++------------ 5 files changed, 24 insertions(+), 20 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 881b678327..a493a89f23 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -13738,11 +13738,11 @@ trying to determine the type. \\ \rowsep \tcode{not_found} & Pseudo-type indicating the file was not found. -\begin{note} +\begin{tailnote} The file not being found is not considered an error while determining the type of a file. -\end{note} +\end{tailnote} \\ \rowsep \tcode{regular} & Regular file \\ \rowsep \tcode{directory} & Directory file \\ \rowsep diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 976b9880d0..4d25dd4dd8 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1839,9 +1839,9 @@ of allocating a single object of type \tcode{T}, even when \tcode{sizeof(T)} is small. That is, there is no need for a container to maintain its own free list.} -\begin{note} +\begin{tailnote} If \tcode{n == 0}, the return value is unspecified. -\end{note} +\end{tailnote} & \\ \rowsep \tcode{a.allocate(n, y)} & diff --git a/source/macros.tex b/source/macros.tex index 272e8cc85a..5be88cfd6a 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -274,11 +274,15 @@ % ending with END TEXT. A counter with name ENVIRON indicates the % number of this kind of note / example that has occurred in this % subclause. +% Use tailENVIRON to avoid inserting a \par at the end. \newcommand{\newnoteenvironment}[3]{ \newsubclausecounter{#1} +\newenvironment{tail#1} +{\par\small\stepcounter{#1}\noteintro{#2}} +{\noteoutro{#3}} \newenvironment{#1} -{\def\noteend{#3}\par\small\stepcounter{#1}\noteintro{#2}} -{\noteoutro{\noteend}\par} +{\begin{tail#1}} +{\end{tail#1}\small\par} % \small\par is for C++20 post-DIS compatibility } \newnoteenvironment{note}{Note \arabic{note}}{end note} diff --git a/source/time.tex b/source/time.tex index 1fbe096225..b0e770b522 100644 --- a/source/time.tex +++ b/source/time.tex @@ -11249,13 +11249,13 @@ \\ \rowsep \tcode{\%n} & Matches one white space character. -\begin{note} +\begin{tailnote} \tcode{\%n}, \tcode{\%t}, and a space can be combined to match a wide range of white-space patterns. For example, \tcode{"\%n "} matches one or more white space characters, and \tcode{"\%n\%t\%t"} matches one to three white space characters. -\end{note} +\end{tailnote} \\ \rowsep \tcode{\%p} & The locale's equivalent of the AM/PM designations associated with a 12-hour clock. diff --git a/source/utilities.tex b/source/utilities.tex index 5b9c438d3d..63a0497043 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -16593,10 +16593,10 @@ \tcode{struct is_final;} & \tcode{T} is a class type marked with the \grammarterm{class-virt-specifier} \tcode{final}\iref{class.pre}. -\begin{note} +\begin{tailnote} A union is a class type that can be marked with \tcode{final}. -\end{note} +\end{tailnote} & If \tcode{T} is a class type, \tcode{T} shall be a complete type. \\ \rowsep @@ -16674,13 +16674,13 @@ operand\iref{expr.prop}. Access checking is performed as if in a context unrelated to \tcode{T} and \tcode{U}. Only the validity of the immediate context of the assignment expression is considered. -\begin{note} +\begin{tailnote} The compilation of the expression can result in side effects such as the instantiation of class template specializations and function template specializations, the generation of implicitly-defined functions, and so on. Such side effects are not in the ``immediate context'' and can result in the program being ill-formed. -\end{note} +\end{tailnote} & \tcode{T} and \tcode{U} shall be complete types, \cv{}~\tcode{void}, or arrays of unknown bound. \\ \rowsep @@ -17121,10 +17121,10 @@ not possibly cv-qualified versions of the same type, \tcode{Derived} shall be a complete type. - \begin{note} + \begin{tailnote} Base classes that are private, protected, or ambiguous are, nonetheless, base classes. -\end{note} +\end{tailnote} \\ \rowsep \indexlibraryglobal{is_convertible}% @@ -17447,11 +17447,11 @@ If \tcode{T} names a type ``array of \tcode{U}'', the member typedef \tcode{type} shall be \tcode{U}, otherwise \tcode{T}. - \begin{note} + \begin{tailnote} For multidimensional arrays, only the first array dimension is removed. For a type ``array of \tcode{const U}'', the resulting type is \tcode{const U}. -\end{note} +\end{tailnote} \\ \rowsep \indexlibraryglobal{remove_all_extents}% @@ -19493,11 +19493,11 @@ numbers. The \tcode{+} sign is inserted before the output of \tcode{to_chars} for non-negative numbers other than negative zero. -\begin{note} +\begin{tailnote} For negative numbers and negative zero the output of \tcode{to_chars} will already contain the sign so no additional transformation is performed. -\end{note} +\end{tailnote} \\ \rowsep % \tcode{-} & @@ -19768,10 +19768,10 @@ % none & The same as \tcode{d}. -\begin{note} +\begin{tailnote} If the formatting argument type is \tcode{charT} or \tcode{bool}, the default is instead \tcode{c} or \tcode{s}, respectively. -\end{note} +\end{tailnote} \\ \end{floattable} From 8c2b2dc9d42c0d5acf87d6623bb55f652ea9f685 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 30 Sep 2020 21:26:54 +0200 Subject: [PATCH 170/250] [std] Use tailnote and tailexample to avoid empty space in tables. (#4251) Also add an automated check. --- source/containers.tex | 4 ++-- source/lib-intro.tex | 12 ++++++------ source/regex.tex | 4 ++-- source/utilities.tex | 28 ++++++++++++++-------------- tools/check.sh | 4 ++++ 5 files changed, 28 insertions(+), 24 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index a81bd64a12..ba87e2f391 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -875,10 +875,10 @@ \oldconcept{MoveInsertable} into \tcode{X} and \oldconcept{MoveAssignable}.\br \effects Inserts an object of type \tcode{T} constructed with \tcode{std::forward<\brk{}Args\brk{}>(\brk{}args)...} before \tcode{p}. - \begin{note} + \begin{tailnote} \tcode{args} can directly or indirectly refer to a value in \tcode{a}. -\end{note} +\end{tailnote} \\ \rowsep \tcode{a.insert(p,t)} & diff --git a/source/lib-intro.tex b/source/lib-intro.tex index 4d25dd4dd8..0b58b61d18 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -1404,11 +1404,11 @@ \tcode{T(rv)} is equivalent to the value of \tcode{rv} before the construction \\ \rowsep \multicolumn{2}{|p{5.3in}|}{ \tcode{rv}'s state is unspecified - \begin{note} + \begin{tailnote} \tcode{rv} must still meet the requirements of the library component that is using it. The operations listed in those requirements must work as specified whether \tcode{rv} has been moved from or not. -\end{note} +\end{tailnote} }\\ \end{oldconcepttable} @@ -1430,12 +1430,12 @@ \tcode{t} is equivalent to the value of \tcode{rv} before the assignment\\ \rowsep \multicolumn{4}{|p{5.3in}|}{ \tcode{rv}'s state is unspecified. - \begin{note} + \begin{tailnote} \tcode{rv} must still meet the requirements of the library component that is using it, whether or not \tcode{t} and \tcode{rv} refer to the same object. The operations listed in those requirements must work as specified whether \tcode{rv} has been moved from or not. -\end{note} +\end{tailnote} }\\ \end{oldconcepttable} @@ -1452,9 +1452,9 @@ \hdstyle{Expression} & \hdstyle{Post-condition} \\ \capsep \tcode{u.\~T()} & All resources owned by \tcode{u} are reclaimed, no exception is propagated. \\ \rowsep \multicolumn{2}{|l|}{ - \begin{note} + \begin{tailnote} Array types and non-object types are not \oldconcept{Destructible}. - \end{note} + \end{tailnote} } \\ \end{oldconcepttable} diff --git a/source/regex.tex b/source/regex.tex index dafef1a862..f97cb0436c 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -234,10 +234,10 @@ & Returns the value represented by the digit \textit{c} in base \textit{I} if the character \textit{c} is a valid digit in base \textit{I}; otherwise returns \tcode{-1}. -\begin{note} +\begin{tailnote} The value of \textit{I} will only be 8, 10, or 16. -\end{note} +\end{tailnote} \\ \rowsep \tcode{u.imbue(loc)} & \tcode{X::locale_type} diff --git a/source/utilities.tex b/source/utilities.tex index 63a0497043..c615db6b0f 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -16713,14 +16713,14 @@ unrelated to \tcode{T} and \tcode{U}. Only the validity of the immediate context of the \tcode{swap} expressions is considered. - \begin{note} + \begin{tailnote} The compilation of the expressions can result in side effects such as the instantiation of class template specializations and function template specializations, the generation of implicitly-defined functions, and so on. Such side effects are not in the ``immediate context'' and can result in the program being ill-formed. - \end{note} + \end{tailnote} & \tcode{T} and \tcode{U} shall be complete types, \cv{}~\tcode{void}, or @@ -17289,11 +17289,11 @@ The member typedef \tcode{type} names the same type as \tcode{T} except that any top-level const-qualifier has been removed. - \begin{example} + \begin{tailexample} \tcode{remove_const_t} evaluates to \tcode{volatile int}, whereas \tcode{remove_const_t} evaluates to \tcode{const int*}. -\end{example} +\end{tailexample} \\ \rowsep \indexlibraryglobal{remove_volatile}% @@ -17302,11 +17302,11 @@ The member typedef \tcode{type} names the same type as \tcode{T} except that any top-level volatile-qualifier has been removed. - \begin{example} + \begin{tailexample} \tcode{remove_volatile_t} evaluates to \tcode{const int}, whereas \tcode{remove_volatile_t} evaluates to \tcode{volatile int*}. - \end{example} + \end{tailexample} \\ \rowsep \indexlibraryglobal{remove_cv}% @@ -17314,11 +17314,11 @@ struct remove_cv;} & The member typedef \tcode{type} shall be the same as \tcode{T} except that any top-level cv-qualifier has been removed. - \begin{example} + \begin{tailexample} \tcode{remove_cv_t} evaluates to \tcode{int}, whereas \tcode{remove_cv_t} evaluates to \tcode{const volatile int*}. -\end{example} +\end{tailexample} \\ \rowsep \indexlibraryglobal{add_const}% @@ -17369,9 +17369,9 @@ If \tcode{T} names a referenceable type\iref{defns.referenceable} then the member typedef \tcode{type} names \tcode{T\&}; otherwise, \tcode{type} names \tcode{T}. - \begin{note} + \begin{tailnote} This rule reflects the semantics of reference collapsing\iref{dcl.ref}. - \end{note} + \end{tailnote} \\ \rowsep \indexlibraryglobal{add_rvalue_reference}% @@ -17380,11 +17380,11 @@ If \tcode{T} names a referenceable type then the member typedef \tcode{type} names \tcode{T\&\&}; otherwise, \tcode{type} names \tcode{T}. - \begin{note} + \begin{tailnote} This rule reflects the semantics of reference collapsing\iref{dcl.ref}. For example, when a type \tcode{T} names a type \tcode{T1\&}, the type \tcode{add_rvalue_reference_t} is not an rvalue reference. - \end{note} + \end{tailnote} \\ \end{libreqtab2a} @@ -17572,13 +17572,13 @@ \tcode{remove_extent_t*}. If \tcode{is_function_v} is \tcode{true}, the member typedef \tcode{type} equals \tcode{add_pointer_t}. Otherwise the member typedef \tcode{type} equals \tcode{remove_cv_t}. -\begin{note} +\begin{tailnote} This behavior is similar to the lvalue-to-rvalue\iref{conv.lval}, array-to-pointer\iref{conv.array}, and function-to-pointer\iref{conv.func} conversions applied when an lvalue is used as an rvalue, but also strips cv-qualifiers from class types in order to more closely model by-value argument passing. -\end{note} +\end{tailnote} \\ \rowsep \indexlibraryglobal{enable_if}% diff --git a/tools/check.sh b/tools/check.sh index 1f4d623bc6..425ac7ae75 100755 --- a/tools/check.sh +++ b/tools/check.sh @@ -59,6 +59,10 @@ grep -ne '^.*[^ ]\s*\\\(begin\|end\){\(example\|note\)}' $texfiles && exit 1 grep -ne '\\\(begin\|end\){\(example\|note\)}[^%]\+$' $texfiles && exit 1 # Fixup: sed 's/\(\\\(begin\|end\){\(example\|note\)}\)\s*\([^ ].*\)$/\1\n\4/' +# \end{note} or \end{example} at the end of a table cell +grep -n -A1 '\\end{\(example\|note\)}' $texfiles | grep -- '- *\(\\\\\|&\)' | +sed 's/$/ <--- needs tailnote or tailexample/' | grep . && exit 1 + # Blank line between "begin example" and "begin codeblock" for f in $texfiles; do sed -n '/\\begin{example}/{N;N;/\n\n\\begin{codeblock}$/{=;p}}' $f | From 130329433193d4fbafe2ffec2b06e0427171cd6a Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 30 Sep 2020 23:52:19 +0200 Subject: [PATCH 171/250] [macros] Avoid excess vertical space for Annex C macros. --- source/macros.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/macros.tex b/source/macros.tex index 5be88cfd6a..7a562230b8 100644 --- a/source/macros.tex +++ b/source/macros.tex @@ -407,7 +407,7 @@ %% Change descriptions \newcommand{\diffhead}[1]{\textbf{#1:}\space} -\newcommand{\diffdef}[1]{\hfill\break\diffhead{#1}} +\newcommand{\diffdef}[1]{\ifvmode\else\hfill\break\fi\diffhead{#1}} \ExplSyntaxOn \NewDocumentCommand \diffref { m } { \clist_set:Nx \l_tmpa_clist { #1 } From 15904311cc90085a2e04005d39719d4e02e44a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Wed, 30 Sep 2020 22:54:33 +0100 Subject: [PATCH 172/250] [ranges] Index "split_view::{outer,inner}-iterator" correctly. The nested name is an exposition-only name and needs to be formatted accordingly. --- source/ranges.tex | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 8deb2ae1f7..2375d887e1 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -5521,7 +5521,7 @@ \rSec3[range.split.outer]{Class template \tcode{split_view::\exposid{outer-iterator}}} -\indexlibraryglobal{split_view::outer-iterator}% +\indexlibraryglobal{split_view::\exposid{outer-iterator}}% \begin{codeblock} namespace std::ranges { template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern> @@ -5581,7 +5581,7 @@ \placeholder{current} is equivalent to \exposid{current_} if \tcode{V} models \libconcept{forward_range}, and \tcode{\exposid{parent_}->\exposid{current_}} otherwise. -\indexlibraryctor{split_view::outer-iterator}% +\indexlibraryctor{split_view::\exposid{outer-iterator}}% \begin{itemdecl} constexpr explicit @\exposid{outer-iterator}@(@\exposid{Parent}@& parent) requires (!@\libconcept{forward_range}@<@\exposid{Base}@>); @@ -5593,7 +5593,7 @@ Initializes \exposid{parent_} with \tcode{addressof(parent)}. \end{itemdescr} -\indexlibraryctor{split_view::outer-iterator}% +\indexlibraryctor{split_view::\exposid{outer-iterator}}% \begin{itemdecl} constexpr @\exposid{outer-iterator}@(@\exposid{Parent}@& parent, iterator_t<@\exposid{Base}@> current) requires @\libconcept{forward_range}@<@\exposid{Base}@>; @@ -5606,7 +5606,7 @@ and \exposid{current_} with \tcode{std::move(current)}. \end{itemdescr} -\indexlibraryctor{split_view::outer-iterator}% +\indexlibraryctor{split_view::\exposid{outer-iterator}}% \begin{itemdecl} constexpr @\exposid{outer-iterator}@(@\exposid{outer-iterator}@ i) requires Const && @\libconcept{convertible_to}@, iterator_t<@\exposid{Base}@>>; @@ -5619,7 +5619,7 @@ \exposid{current_} with \tcode{std::move(i.\exposid{current_})}. \end{itemdescr} -\indexlibrarymember{operator*}{split_view::outer-iterator}% +\indexlibrarymember{operator*}{split_view::\exposid{outer-iterator}}% \begin{itemdecl} constexpr value_type operator*() const; \end{itemdecl} @@ -5630,7 +5630,7 @@ Equivalent to: \tcode{return value_type\{*this\};} \end{itemdescr} -\indexlibrarymember{operator++}{split_view::outer-iterator}% +\indexlibrarymember{operator++}{split_view::\exposid{outer-iterator}}% \begin{itemdecl} constexpr @\exposid{outer-iterator}@& operator++(); \end{itemdecl} @@ -5657,7 +5657,7 @@ \end{codeblock} \end{itemdescr} -\indexlibrarymember{operator==}{split_view::outer-iterator}% +\indexlibrarymember{operator==}{split_view::\exposid{outer-iterator}}% \begin{itemdecl} friend constexpr bool operator==(const @\exposid{outer-iterator}@& x, const @\exposid{outer-iterator}@& y) requires @\libconcept{forward_range}@<@\exposid{Base}@>; @@ -5669,7 +5669,7 @@ Equivalent to: \tcode{return x.\exposid{current_} == y.\exposid{current_};} \end{itemdescr} -\indexlibrarymember{operator==}{split_view::outer-iterator}% +\indexlibrarymember{operator==}{split_view::\exposid{outer-iterator}}% \begin{itemdecl} friend constexpr bool operator==(const @\exposid{outer-iterator}@& x, default_sentinel_t); \end{itemdecl} @@ -5682,7 +5682,7 @@ \rSec3[range.split.outer.value]{Class \tcode{split_view::\exposid{outer-iterator}::value_type}} -\indexlibraryglobal{split_view::outer-iterator::value_type}% +\indexlibraryglobal{split_view::\exposid{outer-iterator}::value_type}% \begin{codeblock} namespace std::ranges { template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern> @@ -5705,7 +5705,7 @@ } \end{codeblock} -\indexlibraryctor{split_view::outer-iterator::value_type}% +\indexlibraryctor{split_view::\exposid{outer-iterator}::value_type}% \begin{itemdecl} constexpr explicit value_type(@\exposid{outer-iterator}@ i); \end{itemdecl} @@ -5716,7 +5716,7 @@ Initializes \exposid{i_} with \tcode{std::move(i)}. \end{itemdescr} -\indexlibrarymember{begin}{split_view::outer-iterator::value_type}% +\indexlibrarymember{begin}{split_view::\exposid{outer-iterator}::value_type}% \begin{itemdecl} constexpr @\exposid{inner-iterator}@ begin() const requires copyable<@\exposid{outer-iterator}@>; \end{itemdecl} @@ -5727,7 +5727,7 @@ Equivalent to: \tcode{return \exposid{inner-iterator}\{\exposid{i_}\};} \end{itemdescr} -\indexlibrarymember{begin}{split_view::outer-iterator::value_type}% +\indexlibrarymember{begin}{split_view::\exposid{outer-iterator}::value_type}% \begin{itemdecl} constexpr @\exposid{inner-iterator}@ begin() requires (!copyable<@\exposid{outer-iterator}@>); \end{itemdecl} @@ -5737,7 +5737,7 @@ \effects Equivalent to: \tcode{return \exposid{inner-iterator}\{std::move(\exposid{i_})\};} \end{itemdescr} -\indexlibrarymember{end}{split_view::outer-iterator::value_type}% +\indexlibrarymember{end}{split_view::\exposid{outer-iterator}::value_type}% \begin{itemdecl} constexpr default_sentinel_t end() const; \end{itemdecl} @@ -5750,7 +5750,7 @@ \rSec3[range.split.inner]{Class template \tcode{split_view::\exposid{inner-iterator}}} -\indexlibraryglobal{split_view::inner-iterator}% +\indexlibraryglobal{split_view::\exposid{inner-iterator}}% \begin{codeblock} namespace std::ranges { template<@\libconcept{input_range}@ V, @\libconcept{forward_range}@ Pattern> @@ -5811,7 +5811,7 @@ \item otherwise, \tcode{iterator_traits>::iterator_category}. \end{itemize} -\indexlibraryctor{split_view::inner-iterator}% +\indexlibraryctor{split_view::\exposid{inner-iterator}}% \begin{itemdecl} constexpr explicit @\exposid{inner-iterator}@(@\exposid{outer-iterator}@ i); \end{itemdecl} @@ -5822,7 +5822,7 @@ Initializes \exposid{i_} with \tcode{std::move(i)}. \end{itemdescr} -\indexlibrarymember{operator++}{split_view::inner-iterator}% +\indexlibrarymember{operator++}{split_view::\exposid{inner-iterator}}% \begin{itemdecl} constexpr @\exposid{inner-iterator}@& operator++(); \end{itemdecl} @@ -5843,7 +5843,7 @@ \end{codeblock} \end{itemdescr} -\indexlibrarymember{operator==}{split_view::inner-iterator}% +\indexlibrarymember{operator==}{split_view::\exposid{inner-iterator}}% \begin{itemdecl} friend constexpr bool operator==(const @\exposid{inner-iterator}@& x, const @\exposid{inner-iterator}@& y) requires @\libconcept{forward_range}@<@\exposid{Base}@>; @@ -5855,7 +5855,7 @@ Equivalent to: \tcode{return x.\exposid{i_}.\placeholder{current} == y.\exposid{i_}.\placeholder{current};} \end{itemdescr} -\indexlibrarymember{operator==}{split_view::inner-iterator}% +\indexlibrarymember{operator==}{split_view::\exposid{inner-iterator}}% \begin{itemdecl} friend constexpr bool operator==(const @\exposid{inner-iterator}@& x, default_sentinel_t); \end{itemdecl} @@ -5885,7 +5885,7 @@ \end{codeblock} \end{itemdescr} -\indexlibrarymember{iter_swap}{split_view::inner-iterator}% +\indexlibrarymember{iter_swap}{split_view::\exposid{inner-iterator}}% \begin{itemdecl} friend constexpr void iter_swap(const @\exposid{inner-iterator}@& x, const @\exposid{inner-iterator}@& y) noexcept(noexcept(ranges::iter_swap(x.@\exposid{i_}@.@\placeholdernc{current}@, y.@\exposid{i_}@.@\placeholdernc{current}@))) From f12a8b5a2ccc9af6fc855292bbaeb2bbb53e198e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Thu, 1 Oct 2020 00:36:32 +0100 Subject: [PATCH 173/250] [iterator.concept.sentinel] Spell "see" with lower-case 's'. --- source/iterators.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/iterators.tex b/source/iterators.tex index c1e5b2ca51..67ea9ce40d 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -1520,7 +1520,7 @@ concept @\deflibconcept{sentinel_for}@ = @\libconcept{semiregular}@ && @\libconcept{input_or_output_iterator}@ && - @\exposconcept{weakly-equality-comparable-with}@; // See \ref{concept.equalitycomparable} + @\exposconcept{weakly-equality-comparable-with}@; // see \ref{concept.equalitycomparable} \end{itemdecl} \begin{itemdescr} From 625fe61ad2e2c6e8d7c2e985be4d298b6cbdab32 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 1 Oct 2020 12:29:15 +0200 Subject: [PATCH 174/250] [time.clock.utc.overview] Move explicit line break in example. (#4261) --- source/time.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/time.tex b/source/time.tex index b0e770b522..6324580dea 100644 --- a/source/time.tex +++ b/source/time.tex @@ -2814,8 +2814,8 @@ \begin{example} \\ \tcode{clock_cast(sys_seconds\{sys_days\{1970y/January/1\}\}).time_since_epoch()} is \tcode{0s}. \\ -\tcode{clock_cast(sys_seconds\{sys_days\{2000y/January/1\}\}).time_since_epoch()} \\ -is \tcode{946'684'822s}, which is \tcode{10'957 * 86'400s + 22s}. \\ +\tcode{clock_cast(sys_seconds\{sys_days\{2000y/January/1\}\}).time_since_epoch()} is \tcode{946'684'822s},\\ +which is \tcode{10'957 * 86'400s + 22s}. \\ \end{example} \pnum From 3aa14983e3be3a1e82513fa09eccaa1c30b9fd1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Thu, 24 Sep 2020 23:30:57 +0100 Subject: [PATCH 175/250] [intro] Add a page break. This prevents a footnote from spanning two pages and also makes all subclause headings appear at the top of a page. --- source/intro.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/intro.tex b/source/intro.tex index 6710ad90c0..03cebbf4f2 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -794,6 +794,8 @@ \indextext{conformance requirements!general|)}% \indextext{conformance requirements|)}% +\newpage + \rSec2[intro.abstract]{Abstract machine} \pnum From d8372823ec39cbbfffc8ccae3f5559a6d0b96083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Wed, 30 Sep 2020 22:36:31 +0100 Subject: [PATCH 176/250] [lex] Add a page break. --- source/lex.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/lex.tex b/source/lex.tex index 694326966b..3fba7f2bcd 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -918,6 +918,8 @@ \indextext{punctuator|)}% \indextext{operator|)} +\newpage + \rSec1[lex.literal]{Literals}% \indextext{literal|(} From d4eb329604722cbe26f8a423375873747c90f62c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sat, 26 Sep 2020 20:58:54 +0100 Subject: [PATCH 177/250] [basic] Add page breaks. --- source/basic.tex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/basic.tex b/source/basic.tex index e096189949..1d1748c9c7 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -235,6 +235,9 @@ copy assignment operator, move assignment operator\iref{class.copy.assign}, or destructor\iref{class.dtor} member functions. \end{note} + +\newpage + \begin{example} Given \begin{codeblock} @@ -4523,6 +4526,8 @@ \end{example} \end{note} +\newpage + The exceptions to this lifetime rule are: \begin{itemize} \item A temporary object bound to a reference parameter in a function call\iref{expr.call} @@ -5761,6 +5766,8 @@ \end{note} \indextext{program execution|)} +\newpage + \rSec2[intro.multithread]{Multi-threaded executions and data races} \rSec3[intro.multithread.general]{General} From d10f2f377fda3e9fd8d06202c60a803dfc8ea24a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 27 Sep 2020 22:16:29 +0100 Subject: [PATCH 178/250] [diff] Add page breaks. --- source/compatibility.tex | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/compatibility.tex b/source/compatibility.tex index 3ade25628f..82e1d097f1 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -88,6 +88,8 @@ or \tcode{requires} as an identifier is not valid in this revision of \Cpp{}. +\newpage + \diffref{lex.operators} \change New operator \tcode{<=>}. @@ -546,6 +548,8 @@ algorithms not explicitly specified to allow such in this version of \Cpp{} may fail to compile or have undefined behavior. +\newpage + \rSec2[diff.cpp17.input.output]{\ref{input.output}: input/output library} \diffref{istream.extractors} @@ -641,6 +645,8 @@ class templates \tcode{unary_negate} or \tcode{binary_negate}, may fail to compile. +\newpage + \nodiffref \change Remove redundant members from \tcode{std::allocator}. @@ -841,6 +847,8 @@ derived d2; // still OK \end{codeblock} +\newpage + \rSec2[diff.cpp14.class]{\ref{class}: classes} \diffref{class.inhctor.init} From 50db486f7cc8d916fb8ef75b56cead15a07f990c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 27 Sep 2020 22:46:01 +0100 Subject: [PATCH 179/250] [depr] Add page breaks. --- source/future.tex | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/future.tex b/source/future.tex index ba09cac4ab..927c92e032 100644 --- a/source/future.tex +++ b/source/future.tex @@ -85,6 +85,9 @@ \begin{note} Three-way comparisons\iref{expr.spaceship} between such operands are ill-formed. \end{note} + +\newpage + \begin{example} \begin{codeblock} int arr1[5]; @@ -173,6 +176,8 @@ \end{codeblock} \end{example} +\newpage + \rSec1[depr.local]{Non-local use of TU-local entities} \pnum @@ -305,6 +310,8 @@ \xrefc{7.15} +\newpage + \rSec2[depr.stdbool.h.syn]{Header \tcode{} synopsis} \indexheader{stdbool.h}% @@ -2132,6 +2139,8 @@ Attempting to write to a text file produces undefined behavior. \end{itemize} +\newpage + \pnum For the facet \tcode{codecvt_utf8_utf16}\indexlibraryglobal{codecvt_utf8_utf16}: \begin{itemize} From b76a564e2402e4089e4fadd516db138f3ec0003f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 27 Sep 2020 23:04:14 +0100 Subject: [PATCH 180/250] [expr, stmt.stmt] Add page breaks for the grammar summary. This only affects Annex A. --- source/expressions.tex | 1 + source/statements.tex | 1 + 2 files changed, 2 insertions(+) diff --git a/source/expressions.tex b/source/expressions.tex index 0140bf3cfb..75955f8a49 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -1,6 +1,7 @@ %!TEX root = std.tex \rSec0[expr]{Expressions} +\begin{extract}\newpage\end{extract} \gramSec[gram.expr]{Expressions} \indextext{\idxcode{operator new}|seealso{\tcode{new}}}% diff --git a/source/statements.tex b/source/statements.tex index 5a7cda05d5..590dff62ef 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -2,6 +2,7 @@ \rSec0[stmt.stmt]{Statements}% \indextext{statement|(} +\begin{extract}\newpage\end{extract} \gramSec[gram.stmt]{Statements} \indextext{block (statement)|see{statement, compound}} From 9ac220eed859bc7f6d5ed46fea7fccacab40cc0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Tue, 29 Sep 2020 15:48:09 +0100 Subject: [PATCH 181/250] [ranges] Add page breaks. --- source/ranges.tex | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/source/ranges.tex b/source/ranges.tex index 2375d887e1..c0e82140fa 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1276,6 +1276,8 @@ range && @\libconcept{same_as}@, sentinel_t>; \end{itemdecl} +\newpage + \pnum The \libconcept{viewable_range} concept specifies the requirements of a \libconcept{range} type that can be converted to a \libconcept{view} safely. @@ -2780,6 +2782,7 @@ if (@\exposid{stream_}@) { *@\exposid{stream_}@ >> @\exposid{object_}@; } + return @\exposid{iterator}@{*this}; } @@ -2884,6 +2887,8 @@ \expects \tcode{\exposid{parent_}->\exposid{stream_} != nullptr} is \tcode{true}. +\newpage + \pnum \effects Equivalent to: @@ -3439,6 +3444,8 @@ \end{codeblock} \end{itemdescr} +\newpage + \indexlibrarymember{operator\dcr}{filter_view::iterator}% \begin{itemdecl} constexpr @\exposid{iterator}@& operator--() requires @\libconcept{bidirectional_range}@; @@ -3579,6 +3586,8 @@ \tcode{views::transform(E, F)} is expression-equivalent to \tcode{transform_view\{E, F\}}. +\newpage + \pnum \begin{example} \begin{codeblock} @@ -3850,6 +3859,8 @@ \item Otherwise, \tcode{iterator_concept} denotes \tcode{input_iterator_tag}. \end{itemize} +\newpage + \pnum \tcode{iterator::iterator_category} is defined as follows: Let \tcode{C} denote the type @@ -4009,6 +4020,8 @@ \end{codeblock} \end{itemdescr} +\newpage + \indexlibrarymember{operator-=}{transform_view::iterator}% \begin{itemdecl} constexpr @\exposid{iterator}@& operator-=(difference_type n) @@ -4684,6 +4697,8 @@ Otherwise, \tcode{ranges::drop_view\{E, F\}}. \end{itemize} +\newpage + \pnum \begin{example} \begin{codeblock} @@ -4766,6 +4781,8 @@ \exposid{count_} with \tcode{count}. \end{itemdescr} +\newpage + \indexlibrarymember{begin}{drop_view}% \begin{itemdecl} constexpr auto begin() @@ -5239,6 +5256,8 @@ Equivalent to: \tcode{++*this}. \end{itemdescr} +\newpage + \indexlibrarymember{operator++}{join_view::iterator}% \begin{itemdecl} constexpr @\exposid{iterator}@ operator++(int) @@ -6262,6 +6281,8 @@ \tcode{keys_view} is an alias for \tcode{elements_view, 0>}, and is useful for extracting keys from associative containers. +\newpage + \begin{example} \begin{codeblock} auto names = keys_view{historical_figures}; @@ -6548,6 +6569,8 @@ \end{codeblock} \end{itemdescr} +\newpage + \indexlibrarymember{operator+=}{elements_view::iterator}% \begin{itemdecl} constexpr @\exposid{iterator}@& operator+=(difference_type n); @@ -6700,6 +6723,8 @@ Equivalent to: \tcode{return x.\exposid{current_} - y.\exposid{current_};} \end{itemdescr} +\newpage + \rSec3[range.elements.sentinel]{Class template \tcode{elements_view::\exposid{sentinel}}} \indexlibraryglobal{elements_view::sentinel}% From ffa073b18ce6b1806b0fa563e920ea7e69ecc1dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Wed, 30 Sep 2020 18:08:58 +0100 Subject: [PATCH 182/250] [iterators] Add page breaks, and reflow some code lines. --- source/iterators.tex | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index 67ea9ce40d..3db988b74a 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -426,6 +426,7 @@ -> decltype(std::begin(c)); template constexpr auto cend(const C& c) noexcept(noexcept(std::end(c))) -> decltype(std::end(c)); + template constexpr auto rbegin(C& c) -> decltype(c.rbegin()); template constexpr auto rbegin(const C& c) -> decltype(c.rbegin()); template constexpr auto rend(C& c) -> decltype(c.rend()); @@ -442,9 +443,11 @@ template constexpr auto ssize(const C& c) -> common_type_t>; template constexpr ptrdiff_t ssize(const T (&array)[N]) noexcept; + template [[nodiscard]] constexpr auto empty(const C& c) -> decltype(c.empty()); template [[nodiscard]] constexpr bool empty(const T (&array)[N]) noexcept; template [[nodiscard]] constexpr bool empty(initializer_list il) noexcept; + template constexpr auto data(C& c) -> decltype(c.data()); template constexpr auto data(const C& c) -> decltype(c.data()); template constexpr T* data(T (&array)[N]) noexcept; @@ -1523,6 +1526,8 @@ @\exposconcept{weakly-equality-comparable-with}@; // see \ref{concept.equalitycomparable} \end{itemdecl} +\newpage + \begin{itemdescr} \pnum Let \tcode{s} and \tcode{i} be values of type \tcode{S} and @@ -2423,8 +2428,7 @@ \begin{codeblock} template concept @\deflibconcept{indirectly_movable}@ = - @\libconcept{indirectly_readable}@ && - @\libconcept{indirectly_writable}@>; + @\libconcept{indirectly_readable}@ && @\libconcept{indirectly_writable}@>; \end{codeblock} \pnum @@ -2542,9 +2546,7 @@ \begin{codeblock} template concept @\deflibconcept{permutable}@ = - @\libconcept{forward_iterator}@ && - @\libconcept{indirectly_movable_storable}@ && - @\libconcept{indirectly_swappable}@; + @\libconcept{forward_iterator}@ && @\libconcept{indirectly_movable_storable}@ && @\libconcept{indirectly_swappable}@; \end{codeblock} \rSec3[alg.req.mergeable]{Concept \cname{mergeable}} @@ -2910,6 +2912,8 @@ the ending and starting positions of \tcode{i}. \end{itemdescr} +\newpage + \rSec3[range.iter.op.distance]{\tcode{ranges::distance}} \indexlibraryglobal{distance}% \begin{itemdecl} @@ -3477,6 +3481,8 @@ \tcode{x.base() < y.base()}. \end{itemdescr} +\newpage + \indexlibrarymember{operator<=}{reverse_iterator}% \begin{itemdecl} template @@ -4690,8 +4696,10 @@ void fun(ForwardIterator begin, ForwardIterator end); list s; + // populate the list \tcode{s} using CI = common_iterator::iterator>, default_sentinel_t>; + // call \tcode{fun} on a range of 10 ints fun(CI(counted_iterator(s.begin(), 10)), CI(default_sentinel)); \end{codeblock} @@ -5108,6 +5116,8 @@ a range of $N$ elements starting at a given position without needing to know the end position a priori. +\newpage + \pnum \begin{example} \begin{codeblock} From de10e5bf81e43200057a97a09956bebf3a9912e2 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Sat, 26 Sep 2020 12:59:13 -0700 Subject: [PATCH 183/250] [expr.const] Replace notes in sentences with footnotes. --- source/expressions.tex | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 75955f8a49..94cc99fec5 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -6889,12 +6889,9 @@ of $E$; \item -an invocation of a non-constexpr function -\begin{note} -Overload resolution\iref{over.match} -is applied as usual. -\end{note}% -; +an invocation of a non-constexpr function% +\footnote{Overload resolution\iref{over.match} +is applied as usual.}; \item an invocation of an undefined constexpr function; @@ -6918,14 +6915,11 @@ \item an operation that would have undefined behavior -as specified in \ref{intro} through \ref{cpp} -\begin{note} -including, +as specified in \ref{intro} through \ref{cpp}% +\footnote{This includes, for example, signed integer overflow\iref{expr.prop}, certain pointer arithmetic\iref{expr.add}, division by -zero\iref{expr.mul}, or certain shift operations\iref{expr.shift} -\end{note}% -; +zero\iref{expr.mul}, or certain shift operations\iref{expr.shift}.}; \item an lvalue-to-rvalue conversion\iref{conv.lval} unless From b4f1fcfafa76b1b4d95a8899d4e41d1d3fd9461d Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Sat, 26 Sep 2020 10:59:12 -0700 Subject: [PATCH 184/250] [expr] Add page breaks. --- source/expressions.tex | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source/expressions.tex b/source/expressions.tex index 94cc99fec5..0cf6429060 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -583,6 +583,8 @@ descriptions of those operators and contexts. \end{note} +\newpage + \rSec2[conv.lval]{Lvalue-to-rvalue conversion} \pnum @@ -1390,6 +1392,9 @@ template parameter object and a prvalue otherwise\iref{basic.lval}; it is a bit-field if the identifier designates a bit-field. + +\newpage + \begin{example} \begin{codeblock} void f() { @@ -2470,6 +2475,7 @@ template bool f(Args ...args) { +@\newpage@ return (args + ... + args); // error: both operands contain unexpanded packs } \end{codeblock} @@ -2797,6 +2803,7 @@ \begin{example} \begin{codeblock} template concept C = requires (T a) { +@\newpage@ requires sizeof(a) == 4; // OK requires a == 0; // error: evaluation of a constraint variable }; @@ -4597,6 +4604,7 @@ \begin{codeblock} template struct count { +@\newpage@ static const std::size_t value = sizeof...(Types); }; \end{codeblock} @@ -5724,6 +5732,8 @@ \tcode{(a/b)*b + a\%b} is equal to \tcode{a}; otherwise, the behavior of both \tcode{a/b} and \tcode{a\%b} is undefined. +\newpage + \rSec2[expr.add]{Additive operators}% \indextext{expression!additive operators}% \indextext{operator!additive} @@ -6615,6 +6625,9 @@ The exception is reactivated with the existing exception object; no new exception object is created. The exception is no longer considered to be caught. + +\newpage + \begin{example} An exception handler that cannot completely handle the exception itself can be written like this: From a009aad2b52a9df2f742f659a3c844008bb5a297 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 28 Sep 2020 13:51:22 -0700 Subject: [PATCH 185/250] [namespace.memdef] Delete blank line in example to fix lonely "-end example]". --- source/declarations.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/source/declarations.tex b/source/declarations.tex index 3a52cfeb47..77f87a7149 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -7369,7 +7369,6 @@ } using A::x; - void h() { A::f(x); A::X::f(x); // error: \tcode{f} is not a member of \tcode{A::X} From 716cd8f94100e14c66fb7134d948c73b9299821f Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Sat, 26 Sep 2020 11:56:01 -0700 Subject: [PATCH 186/250] [dcl.dcl] Add page breaks. --- source/declarations.tex | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/source/declarations.tex b/source/declarations.tex index 77f87a7149..f3f471928c 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -582,6 +582,9 @@ a \grammarterm{typedef-name} is thus a synonym for another type. A \grammarterm{typedef-name} does not introduce a new type the way a class declaration\iref{class.name} or enum declaration\iref{dcl.enum} does. + +\newpage + \begin{example} After \begin{codeblock} @@ -1213,6 +1216,8 @@ \grammarterm{type-specifier}{s} are discussed in the rest of \ref{dcl.type}. \end{note} +\newpage + \rSec3[dcl.type.cv]{The \fakegrammarterm{cv-qualifier}{s}}% \indextext{specifier!cv-qualifier}% \indextext{initialization!\idxcode{const}}% @@ -1731,6 +1736,9 @@ \end{codeblock} the \grammarterm{expression-list} shall be a single \grammarterm{assignment-expression}. + +\newpage + \begin{example} \begin{codeblock} auto x = 5; // OK: \tcode{x} has type \tcode{int} @@ -3668,6 +3676,8 @@ template void g4(T); \end{codeblock} +\newpage + Abbreviated function templates can be specialized like all function templates. \begin{codeblock} template<> void g1(const int*, const double&); // OK, specialization of \tcode{g1} @@ -3885,6 +3895,7 @@ a = 2; { int a = 3; +@\newpage@ g(); // \tcode{g(f(::a))} } } @@ -6148,6 +6159,8 @@ constitute a reference. \end{note} +\newpage + \pnum \begin{example} One can prevent default initialization and @@ -7298,6 +7311,9 @@ that the entity being defined was already declared in the namespace and the definition appears after the point of declaration in a namespace that encloses the declaration's namespace. + +\newpage + \begin{example} \begin{codeblock} namespace Q { @@ -7637,6 +7653,8 @@ \indextext{using-directive|)}% \indextext{namespaces|)} +\newpage + \rSec1[namespace.udecl]{The \tcode{using} declaration}% \indextext{using-declaration|(} @@ -7733,6 +7751,9 @@ X x; // OK: \tcode{B::g} and \tcode{D::g} introduced \end{codeblock} \end{example} + +\newpage + \begin{example} \begin{codeblock} class C { @@ -8349,6 +8370,9 @@ must not be defined in more than one namespace scope. \end{note} + +\newpage + \begin{example} \begin{codeblock} int x; @@ -8980,6 +9004,8 @@ implementations should not emit such a warning unless all of its structured bindings are unused. +\newpage + \pnum \begin{example} \begin{codeblock} From 28838f68a2b16202b9866dd1e61f315472ef06c5 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Sun, 27 Sep 2020 16:11:34 -0700 Subject: [PATCH 187/250] [temp] Add page breaks. --- source/templates.tex | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/templates.tex b/source/templates.tex index 92603951cd..31d0e8c065 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -1771,6 +1771,9 @@ The formation of the associated constraints establishes the order in which constraints are instantiated when checking for satisfaction\iref{temp.constr.constr}. + +\newpage + \begin{example} \begin{codeblock} template concept C = true; @@ -5273,6 +5276,7 @@ A::type i; // OK: refers to a member of the current instantiation typename A::other j; // error: neither a member of the current instantiation nor // a member of an unknown specialization +@\newpage@ } }; \end{codeblock} @@ -5749,6 +5753,8 @@ not just considering those declarations found in the template definition and template instantiation contexts, then the program has undefined behavior. +\newpage + \pnum \begin{example} \begin{codeblocktu}{Source file \tcode{"X.h"}} @@ -5984,6 +5990,9 @@ a member function template, the name of the function or member function explicitly specialized may be a \grammarterm{template-id}. + +\newpage + \begin{example} \begin{codeblock} template struct A { @@ -7717,6 +7726,9 @@ \end{example} \item Attempting to use a type that is not a class or enumeration type in a qualified name. + +\newpage + \begin{example} \begin{codeblock} template int f(typename T::B*); @@ -7891,6 +7903,9 @@ When a function parameter pack appears in a non-deduced context\iref{temp.deduct.type}, the type of that pack is never deduced. + +\newpage + \begin{example} \begin{codeblock} template void f(Types& ...); @@ -8397,6 +8412,7 @@ f(); // calls \#1 f(1, 2, 3); // calls \#2 +@\newpage@ f(1, 2); // calls \#3; non-variadic template \#3 is more specialized // than the variadic templates \#1 and \#2 \end{codeblock} @@ -9054,6 +9070,8 @@ can be deduced from a function, pointer to function, or pointer-to-member-function type. +\newpage + \begin{example} \begin{codeblock} template void f(void(*)(T,int)); From c03c9873c2787fbb34e6e50d80fbf073c24325bf Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 2 Oct 2020 01:21:53 -0700 Subject: [PATCH 188/250] [temp.dep.type] Replace note in sentence with footnote. --- source/templates.tex | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/source/templates.tex b/source/templates.tex index 31d0e8c065..748095e706 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -5335,12 +5335,10 @@ denoted by a \grammarterm{simple-template-id} in which either the template name is a template parameter or any of the template arguments is a dependent type or an expression that is type-dependent -or value-dependent or is a pack expansion -\begin{note} -This includes an injected-class-name\iref{class.pre} of a class template -used without a \grammarterm{template-argument-list}. -\end{note}% -, or +or value-dependent or is a pack expansion,% +\footnote{This includes an injected-class-name\iref{class.pre} of a class template +used without a \grammarterm{template-argument-list}.} +or \item denoted by \tcode{decltype(}\grammarterm{expression}{}\tcode{)}, where \grammarterm{expression} is type-dependent\iref{temp.dep.expr}. \end{itemize} From 4731589803de197e3999306520936e470656689b Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Sun, 27 Sep 2020 13:50:13 -0700 Subject: [PATCH 189/250] [enumerated.types] Add a page break to codeblock. --- 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 0b58b61d18..b118989075 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -509,7 +509,7 @@ \begin{codeblock} enum @\placeholder{enumerated}@ { @$\tcode{\placeholder{V}}_{0}$@, @$\tcode{\placeholder{V}}_{1}$@, @$\tcode{\placeholder{V}}_{2}$@, @$\tcode{\placeholder{V}}_{3}$@, @$\ldots$@ }; - +@\newpage@ inline const @$\tcode{\placeholder{enumerated C}}_{0}$@(@$\tcode{\placeholder{V}}_{0}$@); inline const @$\tcode{\placeholder{enumerated C}}_{1}$@(@$\tcode{\placeholder{V}}_{1}$@); inline const @$\tcode{\placeholder{enumerated C}}_{2}$@(@$\tcode{\placeholder{V}}_{2}$@); From cdc6e10e6f4b2d4be7fe0d81496ba46544052930 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Sun, 27 Sep 2020 14:33:09 -0700 Subject: [PATCH 190/250] [support] Add page breaks. --- source/support.tex | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source/support.tex b/source/support.tex index 137812b28f..a234614710 100644 --- a/source/support.tex +++ b/source/support.tex @@ -2207,6 +2207,8 @@ \end{example} \end{itemdescr} +\newpage + \indexlibrarymember{delete}{operator}% \begin{itemdecl} void operator delete(void* ptr) noexcept; @@ -2364,6 +2366,8 @@ respectively. \end{itemdescr} +\newpage + \rSec3[new.delete.array]{Array forms} \indexlibrarymember{new}{operator}% @@ -4496,6 +4500,8 @@ \tcode{v < 0 ?\ strong_ordering::greater :\ v > 0 ?\ strong_ordering::less :\ v}. \end{itemdescr} +\newpage + \rSec2[cmp.common]{Class template \tcode{common_comparison_category}} \pnum From a95c194ca55f4d9fa43eda898144e72217d0e24a Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Sun, 27 Sep 2020 17:42:16 -0700 Subject: [PATCH 191/250] [strings] Add page breaks. --- source/strings.tex | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/source/strings.tex b/source/strings.tex index 8c424da53f..0b1252c27a 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -786,6 +786,7 @@ template, class Allocator = allocator> class basic_string { +@\newpage@ public: // types using traits_type = traits; @@ -1328,6 +1329,8 @@ The second form throws nothing if \tcode{alloc == str.get_allocator()}. \end{itemdescr} +\newpage + \begin{itemdecl} template::value_type>> @@ -3683,6 +3686,8 @@ for the return type. \end{itemdescr} +\newpage + \indexlibraryglobal{stof}% \indexlibraryglobal{stod}% \indexlibraryglobal{stold}% @@ -3950,6 +3955,8 @@ User-defined types can define their own implicit conversions to \tcode{std::basic_string_view} in order to interoperate with these functions. \end{note} +\newpage + \rSec2[string.view.synop]{Header \tcode{} synopsis} \indexheader{string_view}% @@ -4945,6 +4952,9 @@ \tcode{t <=> sv} & \tcode{S(t) <=> sv} \\ \tcode{sv <=> t} & \tcode{sv <=> S(t)} \\ \end{libtab2} + +\newpage + \begin{example} A sample conforming implementation for \tcode{operator==} would be: \begin{codeblock} From 427c58dbf744e83b070ac893af2e29fdacca18fe Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Sun, 27 Sep 2020 19:13:11 -0700 Subject: [PATCH 192/250] [tab:container.hash.req] Add line breaks before next itemdecl clause. --- source/containers.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index ba87e2f391..c02e68b328 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -2788,7 +2788,7 @@ \indexunordmem{clear}% \tcode{a.clear()} & \tcode{void} -& \effects Erases all elements in the container. +& \effects Erases all elements in the container.\br \ensures \tcode{a.empty()} is \tcode{true}% & Linear in \tcode{a.size()}. \\ \rowsep @@ -2881,7 +2881,7 @@ & \expects \tcode{b.bucket_count() > 0}.\br \returns The index of the bucket in which elements with keys equivalent - to \tcode{k} would be found, if any such element existed. + to \tcode{k} would be found, if any such element existed.\br \ensures The return value shall be in the range \tcode{[0, b.bucket_count())}.% & Constant \\ \rowsep @@ -2928,7 +2928,7 @@ \indexunordmem{cend}% \tcode{b.cend(n)} & \tcode{const_local_iterator} -& \expects \tcode{n} is in the range \tcode{[0, b.bucket_count())}.% +& \expects \tcode{n} is in the range \tcode{[0, b.bucket_count())}.\br \returns An iterator which is the past-the-end value for the bucket.% & Constant From 39a3181219a792d15b7d20c9314e6aa6c5eda8a4 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 28 Sep 2020 11:56:19 -0700 Subject: [PATCH 193/250] [containers] Add page breaks. --- source/containers.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/containers.tex b/source/containers.tex index c02e68b328..64e8ef5d29 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -3656,6 +3656,7 @@ namespace std { template> class deque { +@\newpage@ public: // types using value_type = T; @@ -6698,6 +6699,8 @@ Constant. \end{itemdescr} +\newpage + \indexlibraryctor{map}% \begin{itemdecl} template @@ -9186,6 +9189,7 @@ class Hash = hash<@\placeholder{iter-value-type}@>, class Pred = equal_to<@\placeholder{iter-value-type}@>, class Allocator = allocator<@\placeholder{iter-value-type}@>> +@\newpage@ unordered_set(InputIterator, InputIterator, typename @\seebelow@::size_type = @\seebelow@, Hash = Hash(), Pred = Pred(), Allocator = Allocator()) -> unordered_set<@\placeholder{iter-value-type}@, From 147cf584aab8eed1bb6898432c97e4d1a27348a6 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 2 Oct 2020 02:08:18 -0700 Subject: [PATCH 194/250] [tab:container.seq.opt] Remove blank line in the description of emplace_back. --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 64e8ef5d29..41129a1ac4 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -1111,7 +1111,7 @@ \effects Appends an object of type \tcode{T} constructed with \tcode{std::forward<\brk{}Args\brk{}>(\brk{}args)...}.\br \expects \tcode{T} is \oldconcept{EmplaceConstructible} into \tcode{X} from \tcode{args}. For \tcode{vector}, \tcode{T} is also - \oldconcept{MoveInsertable} into \tcode{X}.\br + \oldconcept{MoveInsertable} into \tcode{X}. \returns \tcode{a.back()}. & \tcode{deque}, \tcode{list}, From 3f9520afa1379f2a17ca7b09f1ff09939e063476 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 28 Sep 2020 18:03:12 -0700 Subject: [PATCH 195/250] [class] Add page breaks. --- source/classes.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/classes.tex b/source/classes.tex index 3ee649350a..8504d8dd36 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -1502,6 +1502,7 @@ }; X a(1); // calls \tcode{X(int);} X b(a, 0); // calls \tcode{X(const X\&, int);} +@\newpage@ X c = b; // calls \tcode{X(const X\&, int);} \end{codeblock} \end{example} @@ -4438,6 +4439,9 @@ of a derived class to a pointer or reference to one of its base classes shall unambiguously refer to a unique object representing the base class. + +\newpage + \begin{example} \begin{codeblock} struct V { }; From 4844dff1c525b11baf0b42660be158684ea5c566 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Sun, 27 Sep 2020 17:40:13 -0700 Subject: [PATCH 196/250] [utilities] Add page breaks. --- source/utilities.tex | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/source/utilities.tex b/source/utilities.tex index c615db6b0f..3a6b5af161 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -3291,6 +3291,8 @@ This function is a constexpr function. \end{itemdescr} +\newpage + \indexlibrarymember{value}{optional}% \begin{itemdecl} constexpr const T& value() const&; @@ -10725,6 +10727,8 @@ A \tcode{shared_ptr} to an object of type \tcode{U[N]}, where \tcode{U} is \tcode{remove_extent_t}. +\newpage + \pnum \begin{example} \begin{codeblock} @@ -17064,6 +17068,7 @@ // the following assertions hold: assert(rank_v == 0); assert(rank_v == 1); +@\newpage@ assert(rank_v == 2); \end{codeblock} \end{example} @@ -18807,6 +18812,8 @@ have the data members and special members specified above. They have no base classes or members other than those specified. +\newpage + \rSec2[charconv.to.chars]{Primitive numeric output conversion} \pnum From 52f78e5c81a0d0e5335981ecfe3c1edffb0fac4a Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 28 Sep 2020 17:06:21 -0700 Subject: [PATCH 197/250] [tab:meta.trans.other] Remove blank line before Preconditions. --- source/utilities.tex | 1 - 1 file changed, 1 deletion(-) diff --git a/source/utilities.tex b/source/utilities.tex index 3a6b5af161..d35fae2354 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -17653,7 +17653,6 @@ functions, and so on. Such side effects are not in the ``immediate context'' and can result in the program being ill-formed. \end{note} -\br \expects \tcode{Fn} and all types in the template parameter pack \tcode{ArgTypes} are complete types, \cv{}~\tcode{void}, or arrays of unknown bound.\\ \rowsep From cc27dd7c773d31cc6c1a37e4855a8bd0a6488b5a Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 2 Oct 2020 01:35:13 -0700 Subject: [PATCH 198/250] [cpp.replace.general] Add a page break. --- source/preprocessor.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/preprocessor.tex b/source/preprocessor.tex index b74f2f6c78..852ad03924 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -1024,6 +1024,8 @@ at the point at which a preprocessing directive could begin, the identifier is not subject to macro replacement. +\newpage + \pnum A preprocessing directive of the form \begin{ncsimplebnf} From 9ad32a48bb74588a730cd0a969deb493984fb5f6 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 1 Oct 2020 12:25:24 +0200 Subject: [PATCH 199/250] [thread] Page breaks --- source/threads.tex | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source/threads.tex b/source/threads.tex index a440cc74b0..2972d342a3 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -2464,6 +2464,8 @@ \tcode{try_lock_until()}. Only when all levels of ownership have been released may ownership of the object be acquired by another thread. +\newpage + \pnum The behavior of a program is undefined if: \begin{itemize} @@ -2595,6 +2597,8 @@ Nothing. \end{itemdescr} +\newpage + \rSec4[thread.sharedmutex.class]{Class \tcode{shared_mutex}} \indexlibraryglobal{shared_mutex}% @@ -3511,6 +3515,8 @@ \rSec4[thread.lock.shared.general]{General} +\enlargethispage{1ex} + \indexlibraryglobal{shared_lock}% \begin{codeblock} namespace std { @@ -4509,6 +4515,8 @@ exceptions\iref{thread.req.timing}. \end{itemdescr} +\newpage + \indexlibrarymember{wait_for}{condition_variable}% \begin{itemdecl} template @@ -6855,6 +6863,8 @@ \end{itemize} \end{itemdescr} +\newpage + \indexlibrarymember{operator=}{shared_future}% \begin{itemdecl} shared_future& operator=(shared_future&& rhs) noexcept; @@ -7017,6 +7027,8 @@ timeout-related exceptions\iref{thread.req.timing}. \end{itemdescr} +\newpage + \indexlibrarymember{wait_until}{shared_future}% \begin{itemdecl} template From 581f179844312ecc4182f721faea09b451cc9a74 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 25 Sep 2020 21:24:11 +0200 Subject: [PATCH 200/250] [atomics] Page breaks --- source/atomics.tex | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/atomics.tex b/source/atomics.tex index 3b6ea73ba1..d27751b89e 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -2588,6 +2588,8 @@ subtraction \\ \end{floattable} +\newpage + \indexlibraryglobal{atomic_fetch_add}% \indexlibraryglobal{atomic_fetch_sub}% \indexlibraryglobal{atomic_fetch_add_explicit}% @@ -2753,6 +2755,8 @@ resulting from this is performed. \end{note} +\newpage + \pnum \begin{example} \begin{codeblock} From 5bfef2a41e814dcfa063656ea2d47c6733e2d51b Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sat, 26 Sep 2020 22:02:52 +0200 Subject: [PATCH 201/250] [re] Page break --- source/regex.tex | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/regex.tex b/source/regex.tex index f97cb0436c..db2a676c1c 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -2364,6 +2364,8 @@ sub-expressions stored in \tcode{*this}. \end{itemdescr} +\newpage + \indexlibrarymember{match_results}{end}% \begin{itemdecl} const_iterator end() const; From b878d88ede09897f54b31e2a9b4c8fe2fa6c594d Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 27 Sep 2020 13:42:48 +0200 Subject: [PATCH 202/250] [input.output] Add page breaks --- source/iostreams.tex | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index a493a89f23..650d6c0979 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -605,6 +605,8 @@ declared in \libheaderref{cstdio}. \end{itemdescr} +\newpage + \rSec1[iostreams.base]{Iostreams base classes} \rSec2[ios.syn]{Header \tcode{} synopsis} @@ -1742,6 +1744,8 @@ then the behavior of that function is undefined. \indextext{undefined}% +\newpage + \rSec2[ios]{Class template \tcode{basic_ios}} \rSec3[ios.overview]{Overview} @@ -7622,6 +7626,8 @@ then calls \tcode{init_buf_ptrs()}. \end{itemdescr} +\newpage + \indexlibraryctor{basic_stringbuf}% \begin{itemdecl} basic_stringbuf(basic_stringbuf&& rhs); @@ -8290,6 +8296,8 @@ \tcode{basic_stringbuf(which | ios_base::in)}\iref{stringbuf.cons}. \end{itemdescr} +\newpage + \indexlibraryctor{basic_istringstream}% \begin{itemdecl} explicit basic_istringstream( @@ -8659,8 +8667,7 @@ \begin{itemdecl} template basic_ostringstream( - const basic_string& s, - ios_base::openmode which, const Allocator& a); + const basic_string& s, ios_base::openmode which, const Allocator& a); \end{itemdecl} \begin{itemdescr} @@ -8830,6 +8837,8 @@ Equivalent to: \tcode{rdbuf()->str(std::move(s));} \end{itemdescr} +\newpage + \rSec2[stringstream]{Class template \tcode{basic_stringstream}} \rSec3[stringstream.general]{General} @@ -9900,6 +9909,8 @@ \tcode{pos_type(off_type(-1))}. \end{itemdescr} +\newpage + \indexlibrarymember{seekpos}{basic_filebuf}% \begin{itemdecl} pos_type seekpos(pos_type sp, @@ -11900,6 +11911,7 @@ template friend basic_ostream& operator<<(basic_ostream& os, const path& p); +@\newpage@ template friend basic_istream& operator>>(basic_istream& is, path& p); @@ -15489,6 +15501,8 @@ At most one direct or indirect invocation of \tcode{status(to)}. \end{itemdescr} +\newpage + \rSec3[fs.op.copy.symlink]{Copy symlink} \indexlibraryglobal{copy_symlink}% From 7ff609678cfbfe769aed9cb7802196359eb1fd23 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 27 Sep 2020 20:52:47 +0200 Subject: [PATCH 203/250] [localization] Add page break --- source/locales.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/locales.tex b/source/locales.tex index c0dd8c97a5..6b75da1552 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -1480,7 +1480,7 @@ using mask = typename ctype::mask; explicit ctype_byname(const char*, size_t refs = 0); explicit ctype_byname(const string&, size_t refs = 0); - +@\newpage@ protected: ~ctype_byname(); }; From dc81e494a2d9ee8b198207100860117258cd45bf Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Sun, 27 Sep 2020 21:40:49 +0200 Subject: [PATCH 204/250] [time] Add page breaks --- source/time.tex | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/time.tex b/source/time.tex index 6324580dea..684055193d 100644 --- a/source/time.tex +++ b/source/time.tex @@ -3164,6 +3164,8 @@ \tcode{is}. \end{itemdescr} +\newpage + \rSec2[time.clock.gps]{Class \tcode{gps_clock}} \rSec3[time.clock.gps.overview]{Overview} @@ -3262,6 +3264,8 @@ \end{note} \end{itemdescr} +\newpage + \rSec3[time.clock.gps.nonmembers]{Non-member functions} \indexlibrarymember{operator<<}{gps_time}% @@ -6735,6 +6739,8 @@ \end{codeblock} \end{itemdescr} +\newpage + \indexlibrarymember{from_stream}{year_month_day}% \begin{itemdecl} template> @@ -7159,7 +7165,7 @@ constexpr chrono::weekday weekday() const noexcept; constexpr unsigned index() const noexcept; constexpr chrono::weekday_indexed weekday_indexed() const noexcept; - +@\newpage@ constexpr operator sys_days() const noexcept; constexpr explicit operator local_days() const noexcept; constexpr bool ok() const noexcept; From 162f43df6b59a1886ce2e5789b31cbdba69de202 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 30 Sep 2020 22:16:39 +0200 Subject: [PATCH 205/250] [algorithm.syn] Improve linebreaking. --- source/algorithms.tex | 33 +++++++++++---------------------- 1 file changed, 11 insertions(+), 22 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index aa6c88ca75..00b051dcb3 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -832,15 +832,13 @@ template<@\libconcept{input_iterator}@ I1, @\libconcept{sentinel_for}@ S1, @\libconcept{forward_iterator}@ I2, sentinel_for S2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> requires @\libconcept{indirectly_comparable}@ - constexpr I1 find_first_of(I1 first1, S1 last1, I2 first2, S2 last2, - Pred pred = {}, + constexpr I1 find_first_of(I1 first1, S1 last1, I2 first2, S2 last2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); template<@\libconcept{input_range}@ R1, @\libconcept{forward_range}@ R2, class Pred = ranges::equal_to, class Proj1 = identity, class Proj2 = identity> requires @\libconcept{indirectly_comparable}@, iterator_t, Pred, Proj1, Proj2> constexpr borrowed_iterator_t - find_first_of(R1&& r1, R2&& r2, - Pred pred = {}, + find_first_of(R1&& r1, R2&& r2, Pred pred = {}, Proj1 proj1 = {}, Proj2 proj2 = {}); } @@ -1097,8 +1095,7 @@ template constexpr ForwardIterator search_n(ForwardIterator first, ForwardIterator last, - Size count, const T& value, - BinaryPredicate pred); + Size count, const T& value, BinaryPredicate pred); template ForwardIterator search_n(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads} @@ -1840,22 +1837,18 @@ } template - constexpr void partial_sort(RandomAccessIterator first, - RandomAccessIterator middle, + constexpr void partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last); template - constexpr void partial_sort(RandomAccessIterator first, - RandomAccessIterator middle, + constexpr void partial_sort(RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp); template void partial_sort(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads} - RandomAccessIterator first, - RandomAccessIterator middle, + RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last); template void partial_sort(ExecutionPolicy&& exec, // see \ref{algorithms.parallel.overloads} - RandomAccessIterator first, - RandomAccessIterator middle, + RandomAccessIterator first, RandomAccessIterator middle, RandomAccessIterator last, Compare comp); namespace ranges { @@ -6975,8 +6968,7 @@ \indexlibraryglobal{partition_copy}% \begin{itemdecl} -template +template constexpr pair partition_copy(InputIterator first, InputIterator last, OutputIterator1 out_true, OutputIterator2 out_false, Predicate pred); @@ -7357,8 +7349,7 @@ \indexlibraryglobal{set_union}% \begin{itemdecl} -template +template constexpr OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, @@ -7371,8 +7362,7 @@ ForwardIterator2 first2, ForwardIterator2 last2, ForwardIterator result); -template +template constexpr OutputIterator set_union(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, @@ -8357,8 +8347,7 @@ Compare comp); template ForwardIterator min_element(ExecutionPolicy&& exec, - ForwardIterator first, ForwardIterator last, - Compare comp); + ForwardIterator first, ForwardIterator last, Compare comp); template<@\libconcept{forward_iterator}@ I, @\libconcept{sentinel_for}@ S, class Proj = identity, @\libconcept{indirect_strict_weak_order}@> Comp = ranges::less> From 914092d704048fbc88fb62027b0f19f691784108 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 30 Sep 2020 22:20:42 +0200 Subject: [PATCH 206/250] [algorithm] Page breaks --- source/algorithms.tex | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index 00b051dcb3..dcbc147a57 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -903,6 +903,7 @@ @\libconcept{indirect_unary_predicate}@> Pred> constexpr iter_difference_t count_if(I first, S last, Pred pred, Proj proj = {}); +@\newpage@ template<@\libconcept{input_range}@ R, class Proj = identity, @\libconcept{indirect_unary_predicate}@, Proj>> Pred> constexpr range_difference_t @@ -2354,6 +2355,7 @@ ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, ForwardIterator result); +@\newpage@ template ForwardIterator @@ -2793,6 +2795,7 @@ Proj1 proj1 = {}, Proj2 proj2 = {}); } +@\newpage@ // \ref{alg.three.way}, three-way comparison algorithms template constexpr auto @@ -4177,6 +4180,8 @@ At most \tcode{last - first} applications of the corresponding predicate. \end{itemdescr} +\newpage + \indexlibraryglobal{search_n}% \begin{itemdecl} template<@\libconcept{forward_iterator}@ I, @\libconcept{sentinel_for}@ S, class T, @@ -6296,6 +6301,8 @@ Proj1 proj1 = {}, Proj2 proj2 = {}); \end{itemdecl} +\newpage + \begin{itemdescr} \pnum Let $N$ be $\min(\tcode{last - first}, \ \tcode{result_last - result_first})$. @@ -6848,6 +6855,8 @@ ranges::partition(R&& r, Pred pred, Proj proj = {}); \end{itemdecl} +\newpage + \begin{itemdescr} \pnum Let \tcode{proj} be \tcode{identity\{\}} @@ -7078,6 +7087,8 @@ of \tcode{pred} and \tcode{proj}. \end{itemdescr} +\newpage + \rSec2[alg.merge]{Merge} \indexlibraryglobal{merge}% @@ -8950,7 +8961,7 @@ ForwardIterator1 first, ForwardIterator1 last, ForwardIterator2 result, BinaryOperation binary_op, UnaryOperation unary_op, T init); - +@\enlargethispage{10pt}@ // \ref{adjacent.difference}, adjacent difference template constexpr OutputIterator @@ -9293,6 +9304,8 @@ \end{itemize} are convertible to \tcode{T}. +\newpage + \pnum \expects \begin{itemize} @@ -9746,6 +9759,7 @@ transform_inclusive_scan(InputIterator first, InputIterator last, OutputIterator result, BinaryOperation binary_op, UnaryOperation unary_op); +@\newpage@ template @@ -10350,6 +10364,8 @@ \end{codeblock} \end{itemdescr} +\enlargethispage{10pt} + \indexlibraryglobal{uninitialized_value_construct_n}% \begin{itemdecl} namespace ranges { @@ -10359,6 +10375,8 @@ } \end{itemdecl} +\newpage + \begin{itemdescr} \pnum \effects From 62ae9641bb784149d4259dc9e51ae3b30444f133 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Wed, 30 Sep 2020 18:27:36 -0700 Subject: [PATCH 207/250] [intro.refs], Bibliography: Reorder ISO before all others and in numerical order. Add a footnote to ISO/IEC 10646:2003 noting that it's withdrawn. As suggested by the new ISO house style rules. --- source/back.tex | 39 +++++++++++++++++++++------------------ source/future.tex | 3 ++- source/intro.tex | 18 ++++++++++-------- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/source/back.tex b/source/back.tex index b7d5a27eef..d3dce8c1a6 100644 --- a/source/back.tex +++ b/source/back.tex @@ -4,38 +4,41 @@ \chapter{Bibliography} \begin{itemize} \renewcommand{\labelitemi}{---} +% ISO documents in numerical order. \item - Bjarne Stroustrup, - \doccite{The \Cpp{} Programming Language, second edition}, Chapter R. - Addison-Wesley Publishing Company, ISBN 0-201-53992-6, copyright \copyright 1991 AT\&T -\item - Brian W. Kernighan and Dennis M. Ritchie, - \doccite{The C Programming Language}, Appendix A. - Prentice-Hall, 1978, ISBN 0-13-110163-3, copyright \copyright 1978 AT\&T -\item - P.J. Plauger, - \doccite{The Draft Standard \Cpp{} Library}. - Prentice-Hall, ISBN 0-13-117003-1, copyright \copyright 1995 P.J. Plauger) -\item - IANA Time Zone Database, - available at \url{https://www.iana.org/time-zones} + ISO 4217:2015, + \doccite{Codes for the representation of currencies} \item ISO/IEC 10967-1:2012, \doccite{Information technology --- Language independent arithmetic --- Part 1: Integer and floating point arithmetic} -\item - ISO 4217:2015, - \doccite{Codes for the representation of currencies} \item ISO/IEC/IEEE 60559:2011, \doccite{Information technology --- Microprocessor Systems --- Floating-Point arithmetic} +% Other international standards. \item %%% Format for the following entry is based on that specified at %%% http://www.iec.ch/standardsdev/resources/draftingpublications/directives/principles/referencing.htm The Unicode Consortium. Unicode Standard Annex, UAX \#29, \doccite{Unicode Text Segmentation} [online]. Edited by Mark Davis. Revision 35; issued for Unicode 12.0.0. 2019-02-15 [viewed 2020-02-23]. - Available at \url{http://www.unicode.org/reports/tr29/tr29-35.html} + Available from: \url{http://www.unicode.org/reports/tr29/tr29-35.html} +\item + IANA Time Zone Database. + Available from: \url{https://www.iana.org/time-zones} +% Literature references. +\item + Bjarne Stroustrup, + \doccite{The \Cpp{} Programming Language, second edition}, Chapter R. + Addison-Wesley Publishing Company, ISBN 0-201-53992-6, copyright \copyright 1991 AT\&T +\item + Brian W. Kernighan and Dennis M. Ritchie, + \doccite{The C Programming Language}, Appendix A. + Prentice-Hall, 1978, ISBN 0-13-110163-3, copyright \copyright 1978 AT\&T +\item + P.J. Plauger, + \doccite{The Draft Standard \Cpp{} Library}. + Prentice-Hall, ISBN 0-13-117003-1, copyright \copyright 1995 P.J. Plauger) \end{itemize} The arithmetic specification described in ISO/IEC 10967-1:2012 is diff --git a/source/future.tex b/source/future.tex index 927c92e032..9ef3187f9a 100644 --- a/source/future.tex +++ b/source/future.tex @@ -2155,7 +2155,8 @@ \pnum The encoding forms UTF-8, UTF-16, and UTF-32 are specified in ISO/IEC 10646. -The encoding form UCS-2 is specified in ISO/IEC 10646:2003. +The encoding form UCS-2 is specified in ISO/IEC 10646:2003.% +\footnote{Cancelled and replaced by ISO/IEC 10646:2017.} \rSec1[depr.conversions]{Deprecated convenience conversion interfaces} diff --git a/source/intro.tex b/source/intro.tex index 03cebbf4f2..400018e1dd 100644 --- a/source/intro.tex +++ b/source/intro.tex @@ -33,13 +33,6 @@ For undated references, the latest edition of the referenced document (including any amendments) applies. \begin{itemize} -\item Ecma International, \doccite{ECMAScript% -\footnote{ECMAScript\textregistered\ is a registered trademark of Ecma -International. -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.} -Language Specification}, -Standard Ecma-262, third edition, 1999. \item ISO/IEC 2382, \doccite{Information technology --- Vocabulary} \item ISO 8601:2004, \doccite{Data elements and interchange formats --- Information interchange --- Representation of dates and times} @@ -52,11 +45,20 @@ does not constitute an endorsement by ISO or IEC of this product.})} \item ISO/IEC 10646, \doccite{Information technology --- Universal Coded Character Set (UCS)} -\item ISO/IEC 10646:2003, \doccite{Information technology --- +\item ISO/IEC 10646:2003,% +\footnote{Cancelled and replaced by ISO/IEC 10646:2017.} +\doccite{Information technology --- Universal Multiple-Octet Coded Character Set (UCS)} \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 Ecma International, \doccite{ECMAScript% +\footnote{ECMAScript\textregistered\ is a registered trademark of Ecma +International. +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.} +Language Specification}, +Standard Ecma-262, third edition, 1999. \end{itemize} \pnum From 00a336a069789fbd8c8d4a3dbbba66783a97975b Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 2 Oct 2020 20:47:21 -0700 Subject: [PATCH 208/250] [gslice.cons] Fix indentation in itemdecl for gslice. --- source/numerics.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/numerics.tex b/source/numerics.tex index 3569c540d8..bb31e02501 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -8491,7 +8491,7 @@ \begin{itemdecl} gslice(); gslice(size_t start, const valarray& lengths, - const valarray& strides); + const valarray& strides); gslice(const gslice&); \end{itemdecl} From 2c26ae622ab935093f805fa7ff3fbdbe29118966 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 2 Oct 2020 21:49:40 -0700 Subject: [PATCH 209/250] [locale.messages.general] Fix indentation of get. --- source/locales.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/locales.tex b/source/locales.tex index 6b75da1552..e413d1dbfc 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -4876,7 +4876,7 @@ catalog open(const string& fn, const locale&) const; string_type get(catalog c, int set, int msgid, - const string_type& dfault) const; + const string_type& dfault) const; void close(catalog c) const; static locale::id id; From 7ef03e1704f0a81eb5c2a5abc8eb9f0f7a93ce46 Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Fri, 2 Oct 2020 22:59:00 -0700 Subject: [PATCH 210/250] [tab:re.synopt] Remove blank line in the description of collate. --- source/regex.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/regex.tex b/source/regex.tex index db2a676c1c..d46025d846 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -583,7 +583,7 @@ % \tcode{collate} & Specifies that character ranges of the form \tcode{"[a-b]"} shall be locale -sensitive. +sensitive.% \indexlibrarymember{syntax_option_type}{collate}% \indextext{locale}% \\ \rowsep From ea15e35af0b8b23239b4f3026e81ad88482cab88 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sun, 4 Oct 2020 19:53:23 -0700 Subject: [PATCH 211/250] [dcl.type.simple] Fix excess vertical whitespace before grammar excerpt. --- source/declarations.tex | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/declarations.tex b/source/declarations.tex index f3f471928c..141298caae 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -1390,9 +1390,11 @@ the \grammarterm{template-name} shall name a deducible template. A \defnadj{deducible}{template} is either a class template or is an alias template whose \grammarterm{defining-type-id} is of the form + \begin{ncsimplebnf} \opt{\keyword{typename}} \opt{nested-name-specifier} \opt{\keyword{template}} simple-template-id \end{ncsimplebnf} + where the \grammarterm{nested-name-specifier} (if any) is non-dependent and the \grammarterm{template-name} of the \grammarterm{simple-template-id} names a deducible template. @@ -1492,7 +1494,9 @@ An \grammarterm{attribute-specifier-seq} shall not appear in an \grammarterm{elaborated-type-specifier} unless the latter is the sole constituent of a declaration. If an \grammarterm{elaborated-type-specifier} is the sole constituent of a -declaration, the declaration is ill-formed unless it is an explicit +declaration, the declaration is +\break\newpage +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 forms: From 57b51cb6a0f5f0ae14d4c516f5eadf855666d7c6 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sun, 4 Oct 2020 19:55:45 -0700 Subject: [PATCH 212/250] [class.union.anon] Remove bogus index entry that was causing excess vertical whitespace. --- source/classes.tex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/classes.tex b/source/classes.tex index 8504d8dd36..6106b31d2d 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3296,7 +3296,6 @@ is declared. For the purpose of name lookup, after the anonymous union definition, the members of the anonymous union are considered to have been defined in the scope in which the anonymous union is declared. -\indextext{initialization!\idxcode{union}}% \begin{example} \begin{codeblock} void f() { @@ -3354,6 +3353,9 @@ union is a variant member of \tcode{X}. In addition, a non-static data member of an anonymous union that is a member of \tcode{X} is also a variant member of \tcode{X}. At most one variant member of a union may have a default member initializer. + +\newpage + \begin{example} \begin{codeblock} union U { From 828e5d92eab01daf319f6ec152059d95f3948b5c Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sun, 4 Oct 2020 19:57:44 -0700 Subject: [PATCH 213/250] [class.derived.general] Move figure out of note to fix excessive vertical space if the figure gets moved to another page. --- source/classes.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/classes.tex b/source/classes.tex index 6106b31d2d..f6f16d771b 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -3584,13 +3584,13 @@ from'' (see \fref{class.dag}). An arrow need not have a physical representation in memory. A DAG of subobjects is often referred to as a ``subobject lattice''. +\end{note} \begin{importgraphic} {Directed acyclic graph} {class.dag} {figdag.pdf} \end{importgraphic} -\end{note} \pnum \begin{note} From 46df066a4af69581cd68023d084ce5771382591a Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sun, 4 Oct 2020 21:11:24 -0700 Subject: [PATCH 214/250] [char.traits.require] Fix excess vertical space in table. --- source/strings.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/strings.tex b/source/strings.tex index 0b1252c27a..7f95f288b9 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -155,7 +155,7 @@ Copies correctly even where the ranges \tcode{[p,p+n)} and \tcode{[s,s+n)} overlap.\br \returns \tcode{s}. & linear \\ \rowsep \tcode{X::copy(s,p,n)} & \tcode{X::char_type*} & \expects -\tcode{p} not in \tcode{[s,s+n)}. \br +\tcode{p} not in \tcode{[s,s+n)}.\par \returns \tcode{s}.\br for each \tcode{i} in From e76f9ff30de904abf35294c33855d14802435ab9 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sun, 4 Oct 2020 21:22:08 -0700 Subject: [PATCH 215/250] [container.requirements.general] Add missing paragraph number. --- source/containers.tex | 1 + 1 file changed, 1 insertion(+) diff --git a/source/containers.tex b/source/containers.tex index 41129a1ac4..accdbc7b01 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -523,6 +523,7 @@ meet the additional requirements of an allocator-aware container, as described in \tref{container.alloc.req}. +\pnum Given an allocator type \tcode{A} and given a container type \tcode{X} having a \tcode{value_type} identical to \tcode{T} and an \tcode{allocator_type} identical to \tcode{allocator_traits::rebind_alloc} From f3773490422b5de58671ea7d6c6647a002a0d38b Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sun, 4 Oct 2020 22:10:37 -0700 Subject: [PATCH 216/250] [time.clock.system.members] Remove extraneous vertical space. --- source/time.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/time.tex b/source/time.tex index 684055193d..bcead7c5d8 100644 --- a/source/time.tex +++ b/source/time.tex @@ -2652,7 +2652,7 @@ \begin{itemdescr} \pnum \constraints -\tcode{system_clock::duration::min() < system_clock::duration::zero()} is \tcode{true}. \\ +\tcode{system_clock::duration::min() < system_clock::duration::zero()} is \tcode{true}. \begin{note} This implies that \tcode{rep} is a signed type. \end{note} From 04f6083afe12c3bf85c23742f53df7dec94a7807 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Sun, 4 Oct 2020 22:45:58 -0700 Subject: [PATCH 217/250] [ostream.formatted.reqmts] Fix incomplete sentence in footnote. --- source/iostreams.tex | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 650d6c0979..9ce137b7eb 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -6152,7 +6152,7 @@ which can throw an exception. If an exception is thrown during output, then \tcode{ios_base::badbit} -is turned on\footnote{without causing an +is turned on\footnote{This is done without causing an \tcode{ios_base::failure} to be thrown.} in @@ -6556,8 +6556,7 @@ to generate the requested output. If an exception is thrown during output, then \tcode{ios_base::badbit} -% .Fs new -is turned on\footnote{without causing an +is turned on\footnote{This is done without causing an \tcode{ios_base::failure} to be thrown.} in From 4f515770a2803b882590e7b30b4907b0cdf4afd0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20K=C3=B6ppe?= Date: Sun, 4 Oct 2020 15:58:18 +0100 Subject: [PATCH 218/250] [intro.races] Harmonize index entry for "visible side effect(s)". --- source/basic.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/basic.tex b/source/basic.tex index 1d1748c9c7..604ee092bd 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -6029,7 +6029,7 @@ \end{note} \pnum -A \defnadj{visible}{side effect} $A$ on a scalar object or bit-field $M$ +A \defnadjx{visible}{side effect}{side effects} $A$ on a scalar object or bit-field $M$ with respect to a value computation $B$ of $M$ satisfies the conditions: \begin{itemize} From 29ee0e52ec7647e61e9a4b323f07e87986b6151e Mon Sep 17 00:00:00 2001 From: Dawn Perchik Date: Mon, 5 Oct 2020 10:25:28 -0700 Subject: [PATCH 219/250] [tab:container.alloc.req] Indent clauses to fix the build. --- source/containers.tex | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/containers.tex b/source/containers.tex index accdbc7b01..715b009084 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -652,9 +652,9 @@ \tcode{X(m)} & & -\ensures -\tcode{u.empty()} returns \tcode{true}, & -constant \\ + \ensures + \tcode{u.empty()} returns \tcode{true}, & + constant \\ \tcode{X u(m);} & & \tcode{u.get_allocator() == m} & @@ -663,11 +663,11 @@ \tcode{X(t, m)}\br \tcode{X u(t, m);} & & -\expects -\tcode{T} is \oldconcept{CopyInsertable} into \tcode{X}.\br -\ensures -\tcode{u == t}, \tcode{u.get_allocator() == m} & -linear \\ \rowsep + \expects + \tcode{T} is \oldconcept{CopyInsertable} into \tcode{X}.\br + \ensures + \tcode{u == t}, \tcode{u.get_allocator() == m} & + linear \\ \rowsep \tcode{X(rv)}\br \tcode{X u(rv);} From 9be38e5e9d1bd887db9577f3b73bc95591ca691b Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 10 Nov 2020 22:40:37 +0100 Subject: [PATCH 220/250] [strings] Replace 'could' and 'might' as directed by ISO/CS. --- source/strings.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/strings.tex b/source/strings.tex index 7f95f288b9..b6fe0a87b5 100644 --- a/source/strings.tex +++ b/source/strings.tex @@ -3679,7 +3679,7 @@ \pnum \throws \tcode{invalid_argument} if \tcode{strtol}, \tcode{strtoul}, -\tcode{strtoll}, or \tcode{strtoull} reports that no conversion could be +\tcode{strtoll}, or \tcode{strtoull} reports that no conversion can be performed. Throws \tcode{out_of_range} if \tcode{strtol}, \tcode{strtoul}, \tcode{strtoll} or \tcode{strtoull} sets \tcode{errno} to \tcode{ERANGE}, or if the converted value is outside the range of representable values @@ -3716,7 +3716,7 @@ \pnum \throws \tcode{invalid_argument} if \tcode{strtof}, \tcode{strtod}, or -\tcode{strtold} reports that no conversion could be performed. Throws +\tcode{strtold} reports that no conversion can be performed. Throws \tcode{out_of_range} if \tcode{strtof}, \tcode{strtod}, or \tcode{strtold} sets \tcode{errno} to \tcode{ERANGE} or if the converted value is outside the range of representable @@ -3785,7 +3785,7 @@ \pnum \throws \tcode{invalid_argument} if \tcode{wcstol}, \tcode{wcstoul}, \tcode{wcstoll}, or -\tcode{wcstoull} reports that no conversion could be performed. Throws +\tcode{wcstoull} reports that no conversion can be performed. Throws \tcode{out_of_range} if the converted value is outside the range of representable values for the return type. \end{itemdescr} @@ -3817,7 +3817,7 @@ \pnum \throws \tcode{invalid_argument} if \tcode{wcstof}, \tcode{wcstod}, or \tcode{wcstold} reports that no -conversion could be performed. Throws \tcode{out_of_range} if \tcode{wcstof}, \tcode{wcstod}, or +conversion can be performed. Throws \tcode{out_of_range} if \tcode{wcstof}, \tcode{wcstod}, or \tcode{wcstold} sets \tcode{errno} to \tcode{ERANGE}. \end{itemdescr} From b4fd86d8c911290f128f163482ba8b1f94005812 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 08:42:12 +0100 Subject: [PATCH 221/250] [containers] Replace 'could' and 'might' as directed by ISO/CS. --- source/containers.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/containers.tex b/source/containers.tex index 715b009084..c975a85eae 100644 --- a/source/containers.tex +++ b/source/containers.tex @@ -65,7 +65,7 @@ container's element type, not for internal types used by the container. \begin{note} This -means, for example, that a node-based container might need to construct nodes containing +means, for example, that a node-based container would need to construct nodes containing aligned buffers and call \tcode{construct} to place the element into the buffer. \end{note} From 8e06192c3ad67ab16243120f3910366dfef70704 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 09:03:17 +0100 Subject: [PATCH 222/250] [iterators] Replace 'could' and 'might' as directed by ISO/CS. --- source/iterators.tex | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index 3db988b74a..c5793d825c 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -2081,7 +2081,7 @@ The only valid use of an \tcode{operator*} is on the left side of the assignment statement. Assignment through the same value of the iterator happens only once. -Equality and inequality might not be defined. +Equality and inequality are not necessarily defined. \end{note} \rSec3[forward.iterators]{Forward iterators} @@ -2636,12 +2636,9 @@ \pnum \begin{example} -For a program-defined iterator -\tcode{BinaryTreeIterator}, -it could be included -into the bidirectional iterator category by specializing the -\tcode{iterator_traits} -template: +A program-defined iterator \tcode{BinaryTreeIterator} +can be included into the bidirectional iterator category by +specializing the \tcode{iterator_traits} template: \begin{codeblock} template struct iterator_traits> { From f9d2135d5cb3fb6de315f33256cceaf4fd6f8bab Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 09:09:46 +0100 Subject: [PATCH 223/250] [ranges] Replace 'could' and 'might' as directed by ISO/CS. --- source/ranges.tex | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index c0e82140fa..eb5e09b56a 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -1016,8 +1016,9 @@ algorithms and making multiple passes over the range by repeated calls to \tcode{ranges::begin} and \tcode{ranges::end}. Since \tcode{ranges::begin} is not required to be equality-preserving -when the return type does not model \libconcept{forward_iterator}, repeated calls -might not return equal values or might not be well-defined. +when the return type does not model \libconcept{forward_iterator}, +it is possible for repeated calls +to not return equal values or to not be well-defined. \end{note} \end{itemdescr} @@ -1104,7 +1105,7 @@ \begin{note} \tcode{ranges::size(t)} is otherwise not required to be well-defined after evaluating \tcode{ranges::begin(t)}. -For example, \tcode{ranges::size(t)} might be well-defined +For example, it is possible for \tcode{ranges::size(t)} to be well-defined for a \libconcept{sized_range} whose iterator type does not model \libconcept{forward_iterator} only if evaluated before the first call to \tcode{ranges::begin(t)}. @@ -1817,7 +1818,7 @@ to indicate that an algorithm that typically returns an iterator into or subrange of a \tcode{range} argument does not return an iterator or subrange -which could potentially reference a range +which would potentially reference a range whose lifetime has ended for a particular rvalue \tcode{range} argument which does not model \libconcept{borrowed_range}\iref{range.range}. \indexlibraryglobal{dangling}% @@ -1845,7 +1846,7 @@ \end{codeblock} The call to \tcode{ranges::find} at \#1 returns \tcode{ranges::dangling} since \tcode{f()} is an rvalue \tcode{vector}; -the \tcode{vector} could potentially be destroyed +it is possible for the \tcode{vector} to be destroyed before a returned iterator is dereferenced. However, the calls at \#2 and \#3 both return iterators since the lvalue \tcode{vec} and specializations of \tcode{subrange} From 2deefd5ea94f0c45ec8ceff09e3f11b6414abd95 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 09:23:56 +0100 Subject: [PATCH 224/250] [numerics] Replace 'could' and 'might' as directed by ISO/CS. --- source/numerics.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/numerics.tex b/source/numerics.tex index bb31e02501..5e3fe3082f 100644 --- a/source/numerics.tex +++ b/source/numerics.tex @@ -4119,7 +4119,7 @@ \throws A value of an \impldef{exception type when \tcode{random_device} constructor fails} type derived from \tcode{exception} - if the \tcode{random_device} could not be initialized. + if the \tcode{random_device} cannot be initialized. \end{itemdescr} \indexlibrarymember{entropy}{random_device}% @@ -4162,7 +4162,7 @@ \throws A value of an \impldef{exception type when \tcode{random_device::operator()} fails} type derived from \tcode{exception} - if a random number could not be obtained. + if a random number cannot be obtained. \end{itemdescr} From 9011e9a6c250928d95bc97ed29632cce5918f2ac Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 09:28:41 +0100 Subject: [PATCH 225/250] [localization] Replace 'could' and 'might' as directed by ISO/CS. --- source/locales.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/locales.tex b/source/locales.tex index e413d1dbfc..b5d0111dd5 100644 --- a/source/locales.tex +++ b/source/locales.tex @@ -176,7 +176,7 @@ \pnum \begin{example} -An iostream \tcode{operator<<} might be implemented as:% +An iostream \tcode{operator<<} can be implemented as:% \footnote{Note that in the call to \tcode{put}, the stream is implicitly converted to an \tcode{ostreambuf_iterator}.} @@ -192,7 +192,7 @@ use_facet>>( s.getloc()).put(s, s, s.fill(), &tmbuf, 'x').failed(); if (failed) - s.setstate(s.badbit); // might throw + s.setstate(s.badbit); // can throw } return s; } @@ -2084,7 +2084,7 @@ \tcode{partial} & not all source characters converted \\ \tcode{error} & encountered a character in \range{from}{from_end} -that it could not convert \\ +that cannot be converted \\ \tcode{noconv} & \tcode{internT} and \tcode{externT} are the same type, and input sequence is identical to converted sequence \\ @@ -3834,7 +3834,7 @@ \effects Reads characters starting at \tcode{s} until it has extracted the (perhaps abbreviated) name of a weekday or month. -If it finds an abbreviation that is followed by characters that could +If it finds an abbreviation that is followed by characters that can match a full name, it continues reading until it matches the full name or fails. It sets the appropriate From a509eaaccff8bb523786d79980a6c4ee6059f04b Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 09:18:11 +0100 Subject: [PATCH 226/250] [algorithms] Replace 'could' and 'might' as directed by ISO/CS. --- source/algorithms.tex | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/source/algorithms.tex b/source/algorithms.tex index dcbc147a57..03ea68da65 100644 --- a/source/algorithms.tex +++ b/source/algorithms.tex @@ -136,7 +136,7 @@ the copying version is not included. For example, \tcode{sort_copy} is not included because the cost of sorting is much more significant, -and users might as well do \tcode{copy} followed by \tcode{sort}.} +and users can invoke \tcode{copy} followed by \tcode{sort}.} When such a version is provided for \textit{algorithm} it is called \textit{algorithm\tcode{_copy}}. Algorithms that take predicates end with the suffix \tcode{_if} @@ -4398,7 +4398,7 @@ do not overlap. \begin{note} For the overload with an \tcode{ExecutionPolicy}, -there might be a performance cost +a performance cost is possible if \tcode{iterator_traits::value_type} is not \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}). \end{note} @@ -5296,9 +5296,9 @@ do not overlap. \begin{note} For the overloads with an \tcode{ExecutionPolicy}, -there might be a performance cost -if \tcode{iterator_traits::value_type} does not meet -the \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}) requirements. +a performance cost is possible +if \tcode{iterator_traits::value_type} does not meet +the \oldconcept{MoveConstructible} (\tref{cpp17.moveconstructible}) requirements. \end{note} \pnum @@ -5483,7 +5483,7 @@ \oldconcept{CopyAssignable} requirements. \begin{note} For the overloads with an \tcode{ExecutionPolicy}, - there might be a performance cost + a performance cost is possible if the value type of \tcode{ForwardIterator1} does not meet both the \oldconcept{CopyConstructible} and \oldconcept{CopyAssignable} requirements. \end{note} @@ -7022,7 +7022,8 @@ \begin{note} For the overload with an \tcode{ExecutionPolicy}, -there might be a performance cost if \tcode{first}'s value type +a performance cost is possible +if \tcode{first}'s value type does not meet the \oldconcept{CopyConstructible} requirements. \end{note} @@ -8598,7 +8599,7 @@ \pnum \begin{example} \tcode{ranges::lexicographical_compare(I1, S1, I2, S2, Comp, Proj1, Proj2)} -could be implemented as: +can be implemented as: \begin{codeblock} for ( ; first1 != last1 && first2 != last2 ; ++first1, (void) ++first2) { if (invoke(comp, invoke(proj1, *first1), invoke(proj2, *first2))) return true; @@ -9541,7 +9542,7 @@ that \tcode{exclusive_scan} excludes the $i^\text{th}$ input element from the $i^\text{th}$ sum. If \tcode{binary_op} is not mathematically associative, -the behavior of \tcode{exclusive_scan} might be nondeterministic. +the behavior of \tcode{exclusive_scan} can be nondeterministic. \end{note} \end{itemdescr} @@ -9668,7 +9669,7 @@ that \tcode{inclusive_scan} includes the $i^\text{th}$ input element in the $i^\text{th}$ sum. If \tcode{binary_op} is not mathematically associative, -the behavior of \tcode{inclusive_scan} might be nondeterministic. +the behavior of \tcode{inclusive_scan} can be nondeterministic. \end{note} \end{itemdescr} @@ -9743,7 +9744,7 @@ \tcode{transform_inclusive_scan} is that \tcode{trans\-form\-_\-exclusive_scan} excludes the $i^\text{th}$ input element from the $i^\text{th}$ sum. If \tcode{binary_op} is not mathematically associative, -the behavior of \tcode{transform_exclusive_scan} might be nondeterministic. +the behavior of \tcode{transform_exclusive_scan} can be nondeterministic. \tcode{transform_exclusive_scan} does not apply \tcode{unary_op} to \tcode{init}. \end{note} @@ -9848,7 +9849,7 @@ \tcode{transform_inclusive_scan} is that \tcode{trans\-form\-_\-inclusive_scan} includes the $i^\text{th}$ input element in the $i^\text{th}$ sum. If \tcode{binary_op} is not mathematically associative, -the behavior of \tcode{transform_inclusive_scan} might be nondeterministic. +the behavior of \tcode{transform_inclusive_scan} can be nondeterministic. \tcode{transform_inclusive_scan} does not apply \tcode{unary_op} to \tcode{init}. \end{note} From 98415d40ef3ac6d8695503fa3bec4cc3e44d48be Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 23:50:01 +0100 Subject: [PATCH 227/250] [std] Add hyphenation rule for 'implemented'. This avoids an overfull \hbox. --- source/std.tex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/std.tex b/source/std.tex index f7d181b06e..704af5b20c 100644 --- a/source/std.tex +++ b/source/std.tex @@ -78,7 +78,7 @@ %%-------------------------------------------------- %% add special hyphenation rules -\hyphenation{tem-plate ex-am-ple in-put-it-er-a-tor name-space name-spaces non-zero cus-tom-i-za-tion} +\hyphenation{tem-plate ex-am-ple in-put-it-er-a-tor name-space name-spaces non-zero cus-tom-i-za-tion im-ple-men-ted} %%-------------------------------------------------- %% turn off all ligatures inside \texttt From 85a3ba34693b0af95625d1ca88eaf13fd4b41c30 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 13 Nov 2020 00:49:41 +0100 Subject: [PATCH 228/250] [thread] Replace 'could' and 'might' as directed by ISO/CS. --- source/threads.tex | 38 ++++++++++++++++++++------------------ 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/source/threads.tex b/source/threads.tex index 2972d342a3..fdfb64e042 100644 --- a/source/threads.tex +++ b/source/threads.tex @@ -133,8 +133,8 @@ \pnum \begin{note} -If the clock is not synchronized with a steady clock, e.g., a CPU time clock, these -timeouts might not provide useful functionality. +If the clock is not synchronized with a steady clock, e.g., a CPU time clock, +it is possible that these timeouts do not provide useful functionality. \end{note} \pnum @@ -638,7 +638,7 @@ \pnum \throws -\tcode{bad_alloc} if memory could not be allocated for the stop state. +\tcode{bad_alloc} if memory cannot be allocated for the stop state. \end{itemdescr} \indexlibraryctor{stop_source}% @@ -1270,7 +1270,7 @@ If \tcode{joinable()}, calls \tcode{terminate()}. Otherwise, has no effects. \begin{note} Either implicitly detaching or joining a \tcode{joinable()} thread in its -destructor could result in difficult to debug correctness (for detach) or performance +destructor can result in difficult to debug correctness (for detach) or performance (for join) bugs encountered only when an exception is thrown. These bugs can be avoided by ensuring that the destructor is never executed while the thread is still joinable. @@ -2194,7 +2194,7 @@ \begin{note} A program can deadlock if the thread that owns a \tcode{mutex} object calls \tcode{lock()} on that object. If the implementation can detect the deadlock, -a \tcode{resource_deadlock_would_occur} error condition might be observed. +a \tcode{resource_deadlock_would_occur} error condition can be observed. \end{note} \pnum @@ -4248,7 +4248,7 @@ \pnum \begin{note} The supplied lock is held until the thread exits, -which might cause deadlock due to lock ordering issues. +which can cause deadlock due to lock ordering issues. \end{note} \pnum @@ -4332,7 +4332,7 @@ There is no thread blocked on \tcode{*this}. \begin{note} That is, all -threads have been notified; they could subsequently block on the lock specified in the +threads have been notified; they can subsequently block on the lock specified in the wait. This relaxes the usual rules, which would have required all wait calls to happen before destruction. Only the notification to unblock the wait needs to happen before destruction. @@ -4776,7 +4776,7 @@ There is no thread blocked on \tcode{*this}. \begin{note} That is, all -threads have been notified; they could subsequently block on the lock specified in the +threads have been notified; they can subsequently block on the lock specified in the wait. This relaxes the usual rules, which would have required all wait calls to happen before destruction. Only the notification to unblock the wait needs to happen before destruction. @@ -6934,7 +6934,7 @@ \pnum \begin{note} Access to a value object stored in the shared state is -unsynchronized, so operations on \tcode{R} might +unsynchronized, so it is possible for operations on \tcode{R} to introduce a data race\iref{intro.multithread}. \end{note} @@ -7192,8 +7192,8 @@ The completion of the function \tcode{f} is sequenced before\iref{intro.multithread} the shared state is made ready. \begin{note} -\tcode{f} might not be called at all, -so its completion might never happen. +It is possible for \tcode{f} not to be called at all, +in which case its completion never happens. \end{note} \end{itemize} @@ -7220,7 +7220,7 @@ \tcode{system_error} if \tcode{policy == launch::async} and the implementation is unable to start a new thread, or \tcode{std::bad_alloc} if memory for the internal data structures -could not be allocated. +cannot be allocated. \pnum \errors @@ -7243,10 +7243,12 @@ \end{codeblock} \begin{note} -Line \#1 might not result in concurrency because -the \tcode{async} call uses the default policy, which might use -\tcode{launch::deferred}, in which case the lambda might not be invoked until the -\tcode{get()} call; in that case, \tcode{work1} and \tcode{work2} are called on the +It is possible for line \#1 not to result in concurrency +because the \tcode{async} call uses the default policy, +which can use \tcode{launch::deferred}, +in which case it is possible that the lambda is not invoked until the +\tcode{get()} call; +in that case, \tcode{work1} and \tcode{work2} are called on the same thread and there is no concurrency. \end{note} \end{example} @@ -7347,7 +7349,7 @@ \throws Any exceptions thrown by the copy or move constructor of \tcode{f}, or \tcode{bad_alloc} if memory for the internal data structures -could not be allocated. +cannot be allocated. \end{itemdescr} \indexlibraryctor{packaged_task}% @@ -7539,7 +7541,7 @@ \pnum \throws \begin{itemize} -\item \tcode{bad_alloc} if memory for the new shared state could not be allocated. +\item \tcode{bad_alloc} if memory for the new shared state cannot be allocated. \item any exception thrown by the move constructor of the task stored in the shared state. \item \tcode{future_error} with an error condition of \tcode{no_state} if \tcode{*this} From 99dac1c62283365b9b70ba4ef5d141d746418326 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 10 Nov 2020 22:24:44 +0100 Subject: [PATCH 229/250] [time] Replace 'could' and 'might' as directed by ISO/CS. --- source/time.tex | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source/time.tex b/source/time.tex index bcead7c5d8..e343188d86 100644 --- a/source/time.tex +++ b/source/time.tex @@ -1324,7 +1324,7 @@ \begin{note} This requirement prevents implicit truncation error when converting between -integral-based \tcode{duration} types. Such a construction could easily lead to +integral-based \tcode{duration} types. Such a construction can lead to confusion about the value of the \tcode{duration}. \end{note} \begin{example} @@ -6386,7 +6386,7 @@ \tcode{d_} with \tcode{ymdl.day()}. \begin{note} This conversion from \tcode{year_month_day_last} to \tcode{year_month_day} -might be more efficient than converting a \tcode{year_month_day_last} to a \tcode{sys_days}, +can be more efficient than converting a \tcode{year_month_day_last} to a \tcode{sys_days}, and then converting that \tcode{sys_days} to a \tcode{year_month_day}. \end{note} \end{itemdescr} @@ -6957,7 +6957,7 @@ \pnum \begin{note} -This value might be computed on demand. +This value can be computed on demand. \end{note} \end{itemdescr} @@ -9267,13 +9267,14 @@ The \tcode{save} data member is extra information not normally needed for conversion between \tcode{local_time} and \tcode{sys_time}. If \tcode{save != 0min}, this \tcode{sys_info} is said to be on ``daylight saving'' time, -and \tcode{offset - save} suggests what offset this \tcode{time_zone} might use +and \tcode{offset - save} provides a non-authoritative suggestion of +the offset this \tcode{time_zone} would use if it were off daylight saving time. -However, this information should not be taken as authoritative. -The only sure way to get such information -is to query the \tcode{time_zone} with a \tcode{time_point} +A correct offset for the \tcode{time_zone} off daylight saving time +can be obtained by querying the \tcode{time_zone} with a \tcode{time_point} that returns a \tcode{sys_info} where \tcode{save == 0min}. -There is no guarantee what \tcode{time_point} might return such a \tcode{sys_info} +There is no guarantee +what \tcode{time_point} (if any) returns such a \tcode{sys_info} except that it is guaranteed not to be in the range \range{begin}{end} (if \tcode{save != 0min} for this \tcode{sys_info}). From 9a1e929efe6e88c64538d5aacc4992591e4e762f Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 20:19:17 +0100 Subject: [PATCH 230/250] [diff] Replace 'could' and 'might' as directed by ISO/CS. --- source/compatibility.tex | 49 ++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 24 deletions(-) diff --git a/source/compatibility.tex b/source/compatibility.tex index 82e1d097f1..2c2ef5e222 100644 --- a/source/compatibility.tex +++ b/source/compatibility.tex @@ -379,9 +379,9 @@ \effect Equality and inequality expressions between two objects of different types, where one is convertible to the other, -could invoke a different operator. +can invoke a different operator. Equality and inequality expressions between two objects of the same type -could become ambiguous. +can become ambiguous. \begin{codeblock} struct A { operator int() const; @@ -517,7 +517,7 @@ \rationale Improve efficiency and convenience of finding number of removed elements. \effect -Code that depends on the return types might have different semantics in this revision of \Cpp{}. +Code that depends on the return types can have different semantics in this revision of \Cpp{}. Translation units compiled against this version of \Cpp{} may be incompatible with translation units compiled against \CppXVII{}, either failing to link or having undefined behavior. @@ -626,14 +626,14 @@ active, and has been superseded by \tcode{uncaught_exceptions}. \effect A valid \CppXVII{} program that calls \tcode{std::uncaught_exception} may fail -to compile. It might be revised to use \tcode{std::uncaught_exceptions} instead, +to compile. It can be revised to use \tcode{std::uncaught_exceptions} instead, for clear and portable semantics. \nodiffref \change Remove support for adaptable function API. \rationale -The deprecated support relied on a limited convention that could not be +The deprecated support relied on a limited convention that cannot be extended to support the general case or new language features. It has been superseded by direct language support with \tcode{decltype}, and by the \tcode{std::bind} and \tcode{std::not_fn} function templates. @@ -664,8 +664,8 @@ \change Remove \tcode{raw_storage_iterator}. \rationale -The iterator encouraged use of algorithms that might throw exceptions, but did -not return the number of elements successfully constructed that might need to +The iterator encouraged use of potentially-throwing algorithms, but did +not return the number of elements successfully constructed, which need to be destroyed in order to avoid leaks. \effect A valid \CppXVII{} program that uses this iterator class may fail to compile. @@ -701,7 +701,7 @@ The traits had unreliable or awkward interfaces. The \tcode{is_literal_type} trait provided no way to detect which subset of constructors and member functions of a type were declared \tcode{constexpr}. The \tcode{result_of} -trait had a surprising syntax that could not report the result of a regular +trait had a surprising syntax that would not report the result of a regular function type. It has been superseded by the \tcode{invoke_result} trait. \effect A valid \CppXVII{} program that relies on the \tcode{is_literal_type} or @@ -762,7 +762,7 @@ \effect A valid \CppXIV{} expression utilizing the increment operator on a \tcode{bool} lvalue is ill-formed in this revision of \Cpp{}. -Note that this might occur when the lvalue has a type given by a template +Note that this can occur when the lvalue has a type given by a template parameter. \diffref{expr.new,expr.delete} @@ -920,7 +920,7 @@ Violating a non-throwing dynamic exception specification calls \tcode{terminate} rather than \tcode{unexpected} -and might not perform stack unwinding prior to such a call. +and it is unspecified whether stack unwinding is performed prior to such a call. \rSec2[diff.cpp14.library]{\ref{library}: library introduction} @@ -948,7 +948,7 @@ New reserved namespaces. \rationale Reserve namespaces for future revisions of the standard library -that might otherwise be incompatible with existing programs. +that can otherwise be incompatible with existing programs. \effect The global namespaces \tcode{std} followed by an arbitrary sequence of \grammarterm{digit}{s}\iref{lex.name} @@ -1109,7 +1109,7 @@ \rationale Required for sized deallocation. \effect -Valid \CppXI{} code could declare a global placement allocation function and +Valid \CppXI{} code can declare a global placement allocation function and deallocation function as follows: \begin{codeblock} void* operator new(std::size_t, std::size_t); @@ -1117,7 +1117,7 @@ \end{codeblock} In this revision of \Cpp{}, however, the declaration of \tcode{operator delete} -might match a predefined usual (non-placement) +can match a predefined usual (non-placement) \tcode{operator delete}\iref{basic.stc.dynamic}. If so, the program is ill-formed, as it was for class member allocation functions and deallocation functions\iref{expr.new}. @@ -1298,8 +1298,9 @@ \rationale C99 compatibility. \effect -Certain integer literals larger than can be represented by \tcode{long} could -change from an unsigned integer type to \tcode{signed long long}. +Certain integer literals +whose value is larger than the maximum representable value of type \tcode{long} +can change from an unsigned integer type to \tcode{signed long long}. \rSec2[diff.cpp03.expr]{\ref{expr}: expressions} @@ -1437,7 +1438,7 @@ \rationale Overly constrained, simplify overload resolution rules. \effect -A valid \CppIII{} program could get a different result than in this +A valid \CppIII{} program can get a different result than in this revision of \Cpp{}. \rSec2[diff.cpp03.library]{\ref{library}: library introduction} @@ -1849,7 +1850,7 @@ to ``array of \tcode{const wchar_t}''. \rationale This avoids calling an inappropriate overloaded function, -which might expect to be able to modify its argument. +which would possibly attempt to modify its argument. \effect Change to semantics of well-defined feature. \difficulty @@ -1994,7 +1995,7 @@ \effect Deletion of semantically well-defined feature. \difficulty -Could be automated. +Can be automated. Violations will be diagnosed by the \Cpp{} translator. The fix is to add a cast. @@ -2095,7 +2096,7 @@ block. Allowing jump past initializers would require complicated runtime determination of allocation. -Furthermore, any use of the uninitialized object could be a +Furthermore, any use of the uninitialized object can be a disaster. With this simple compile-time rule, \Cpp{} assures that if an initialized variable is in scope, then it has assuredly been @@ -2153,7 +2154,7 @@ In \Cpp{}, class members can be declared with the \tcode{static} storage class specifier. Allowing storage class specifiers on type -declarations could render the code confusing for users. +declarations can render the code confusing for users. \effect Deletion of semantically well-defined feature. \difficulty @@ -2253,7 +2254,7 @@ Deletion of semantically well-defined feature. \difficulty Syntactic transformation. -Could be automated. +Can be automated. \howwide Common. @@ -2545,7 +2546,7 @@ \indextext{bit-field!implementation-defined sign of}% Bit-fields of type plain \tcode{int} are signed. \rationale -Leaving the choice of signedness to implementations could lead to +Leaving the choice of signedness to implementations can lead to inconsistent definitions of template specializations. For consistency, the implementation freedom was eliminated for non-dependent types, too. @@ -2583,7 +2584,7 @@ \difficulty Semantic transformation. To make the struct type name visible in the scope of the enclosing -struct, the struct tag could be declared in the scope of the +struct, the struct tag can be declared in the scope of the enclosing struct, before the enclosing struct is defined. Example: \begin{codeblock} @@ -2595,7 +2596,7 @@ All the definitions of C struct types enclosed in other struct definitions and accessed outside the scope of the enclosing -struct could be exported to the scope of the enclosing struct. +struct can be exported to the scope of the enclosing struct. Note: this is a consequence of the difference in scope rules, which is documented in \ref{basic.scope}. \howwide From e240285cf892f27147d28c301ba4c77ef909a636 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 13 Nov 2020 01:15:01 +0100 Subject: [PATCH 231/250] [diagnostics] Replace 'could' and 'might' as directed by ISO/CS. --- source/diagnostics.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/diagnostics.tex b/source/diagnostics.tex index ac074815b2..7bd8909037 100644 --- a/source/diagnostics.tex +++ b/source/diagnostics.tex @@ -1051,7 +1051,7 @@ system is unspecified. \begin{note} The number of potential system error codes is large -and unbounded, and some might not correspond to any POSIX \tcode{errno} value. Thus +and unbounded, and it is possible that some do not correspond to any POSIX \tcode{errno} value. Thus implementations are given latitude in determining correspondence. \end{note} \end{itemdescr} @@ -1673,7 +1673,7 @@ An \ntbs{} incorporating the arguments supplied in the constructor. \begin{note} -The returned \ntbs{} might be the contents of \tcode{what_arg + ": " + +The returned \ntbs{} can be the contents of \tcode{what_arg + ": " + code.message()}. \end{note} \end{itemdescr} From 7928e1830f64a64295482a3c409a581812aa52e6 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 22:43:12 +0100 Subject: [PATCH 232/250] [library] Replace 'could' and 'might' as directed by ISO/CS. --- source/lib-intro.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/lib-intro.tex b/source/lib-intro.tex index b118989075..546498a61d 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -296,7 +296,7 @@ Failure to meet such a condition results in the function's silent non-viability. \end{note} \begin{example} -An implementation might express such a condition +An implementation can express such a condition via a \grammarterm{constraint-expression}\iref{temp.constr.decl}. \end{example} @@ -304,12 +304,12 @@ \mandates the conditions that, if not met, render the program ill-formed. \begin{example} -An implementation might express such a condition +An implementation can express such a condition via the \grammarterm{constant-expression} in a \grammarterm{static_assert-declaration}\iref{dcl.pre}. If the diagnostic is to be emitted only after the function has been selected by overload resolution, -an implementation might express such a condition +an implementation can express such a condition via a \grammarterm{constraint-expression}\iref{temp.constr.decl} and also define the function as deleted. \end{example} @@ -1583,7 +1583,7 @@ of type \tcode{P} may have an indeterminate value. \begin{note} Operations involving -indeterminate values might cause undefined behavior. +indeterminate values can cause undefined behavior. \end{note} \pnum @@ -2661,7 +2661,7 @@ (e.g., by calling the function with the argument \tcode{std::move(x)}), the program is effectively asking that function to treat that lvalue as a temporary object. The implementation -is free to optimize away aliasing checks which might be needed if the argument was +is free to optimize away aliasing checks which would possibly be needed if the argument was an lvalue. \end{note} \end{itemize} From b66416abb2ccda4e5974400297223fcb34f0241c Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 12 Nov 2020 17:46:30 +0100 Subject: [PATCH 233/250] [cpp] Replace 'could' and 'might' as directed by ISO/CS. --- source/preprocessor.tex | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/preprocessor.tex b/source/preprocessor.tex index 852ad03924..dec5bfbea2 100644 --- a/source/preprocessor.tex +++ b/source/preprocessor.tex @@ -1021,7 +1021,7 @@ preprocessing token, followed by an identifier, occurs lexically -at the point at which a preprocessing directive could begin, +at the point at which a preprocessing directive can begin, the identifier is not subject to macro replacement. \newpage @@ -1644,8 +1644,9 @@ The macros defined in \tref{cpp.predefined.ft} shall be defined to the corresponding integer literal. \begin{note} -Future revisions of \Cpp{} might replace -the values of these macros with greater values. +Future revisions of \Cpp{} will replace +the values of these macros with greater values +when the corresponding feature is modified. \end{note} \item From c58d5f3fa721417f3cd53d1f7f70b23e1e9a5cd5 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 12 Nov 2020 17:50:55 +0100 Subject: [PATCH 234/250] [except] Replace 'could' and 'might' as directed by ISO/CS. --- source/exceptions.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/exceptions.tex b/source/exceptions.tex index 765d26834b..f6fd215f7b 100644 --- a/source/exceptions.tex +++ b/source/exceptions.tex @@ -797,7 +797,7 @@ the function \tcode{std::terminate} is called\iref{except.terminate}. \begin{note} An implementation is not permitted to reject an expression merely because, when -executed, it throws or might +executed, it throws or can throw an exception from a function with a non-throwing exception specification. \end{note} \begin{example} @@ -811,9 +811,9 @@ \end{codeblock} The call to \tcode{f} -is well-formed even though, when called, -\tcode{f} -might throw an exception. +is well-formed even though +it is possible for \tcode{f} to +throw an exception when called. \end{example} \pnum From 7e0f150afcc9e78143acbd9bcb46512929fc2102 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 12 Nov 2020 20:33:59 +0100 Subject: [PATCH 235/250] [stmt.stmt] Replace 'could' and 'might' as directed by ISO/CS. --- source/statements.tex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/statements.tex b/source/statements.tex index 590dff62ef..0fd942cb98 100644 --- a/source/statements.tex +++ b/source/statements.tex @@ -1006,7 +1006,7 @@ \begin{note} A conforming implementation cannot introduce any deadlock around execution of the initializer. -Deadlocks might still be caused by the program logic; +Deadlocks can still be caused by the program logic; the implementation need only avoid deadlocks due to its own synchronization operations. \end{note} @@ -1048,7 +1048,7 @@ If the \grammarterm{statement} cannot syntactically be a \grammarterm{declaration}, there is no ambiguity, so this rule does not apply. -The whole \grammarterm{statement} might need to be examined +In some cases, the whole \grammarterm{statement} needs to be examined to determine whether this is the case. This resolves the meaning of many examples. \begin{example} From c030451740ab7dd90e2d3fb2997503f39eecf6fe Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 09:42:03 +0100 Subject: [PATCH 236/250] [input.output] Replace 'could' and 'might' as directed by ISO/CS. --- source/iostreams.tex | 52 ++++++++++++++++++++++---------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/source/iostreams.tex b/source/iostreams.tex index 9ce137b7eb..639c2b76be 100644 --- a/source/iostreams.tex +++ b/source/iostreams.tex @@ -3659,7 +3659,7 @@ will fail.\footnote{\tcode{underflow} or \tcode{uflow} -might fail by throwing an exception prematurely. +can fail by throwing an exception prematurely. The intention is not only that the calls will not return \tcode{eof()} but that they will return ``immediately''.} @@ -3895,8 +3895,8 @@ \returns \tcode{traits::eof()} to indicate failure. -Failure may occur because the input sequence could not be backed up, or if for some -other reason the pointers could not be set consistent with the constraints. +Failure may occur because the input sequence cannot be backed up, or if for some +other reason the pointers cannot be set consistent with the constraints. \tcode{pbackfail()} is called only when put back has really failed. @@ -7774,7 +7774,7 @@ \pnum \begin{note} For efficiency reasons, -stream buffer operations might violate invariants of \tcode{buf} +stream buffer operations can violate invariants of \tcode{buf} while it is held encapsulated in the \tcode{basic_stringbuf}, e.g., by writing to characters in the range \range{\tcode{buf.data() + buf.size()}}{\tcode{buf.data() + buf.capacity()}}. @@ -11165,7 +11165,7 @@ \begin{note} The member functions of the provided stream buffer can be called from \tcode{emit()} while a lock is held, -which might result in a deadlock if used incautiously. +which can result in a deadlock if used incautiously. \end{note} \pnum @@ -12512,9 +12512,9 @@ \pnum \begin{example} Even if \tcode{//host} is interpreted as a \grammarterm{root-name}, +and even if \tcode{operator/} appends a backslash as the separator, both of the paths \tcode{path("//host")/"foo"} and \tcode{path("//host/")/"foo"} -equal \tcode{"//host/foo"} (although the former might use backslash as the -preferred separator). +equal \tcode{"//host/foo"}. Expression examples: \begin{codeblock} @@ -12586,8 +12586,8 @@ \effects Appends \tcode{path(x).native()} to the pathname in the native format. \begin{note} -This directly manipulates the value of \tcode{native()} -and might not be portable between operating systems. +This directly manipulates the value of \tcode{native()}, +which is not necessarily portable between operating systems. \end{note} \pnum @@ -13772,7 +13772,7 @@ \tcode{file_type} constants to separately identify each of those additional file types \\ \rowsep \tcode{unknown} & -The file exists but the type could not be determined \\ +The file exists but the type cannot be determined \\ \end{floattable} \rSec3[fs.enum.copy.opts]{Enum class \tcode{copy_options}} @@ -14624,11 +14624,12 @@ \pnum \begin{note} -A path obtained by dereferencing a directory iterator might not actually exist; -it could be a symbolic link to a non-existent file. +It is possible for a path obtained by dereferencing a directory iterator +to not actually exist; +for example if it is a symbolic link to a non-existent file. Recursively walking directory trees for purposes of removing and renaming entries -might invalidate symbolic links that are being followed. +can invalidate symbolic links that are being followed. \end{note} \pnum @@ -14837,7 +14838,7 @@ \pnum \begin{note} If the directory structure being iterated over contains cycles -then the end iterator might be unreachable. +then it is possible for the end iterator to be unreachable. \end{note} \rSec3[fs.rec.dir.itr.members]{Members} @@ -15185,8 +15186,8 @@ \pnum \begin{note} -To resolve symlinks, -or perform other sanitization which might require queries to secondary storage, +To resolve symlinks +or perform other sanitization that can involve queries to secondary storage, such as hard disks, consider \tcode{canonical}\iref{fs.op.canonical}. \end{note} @@ -15201,7 +15202,7 @@ For POSIX-based operating systems, \tcode{absolute(p)} is simply \tcode{current_path()/p}. For Windows-based operating systems, -\tcode{absolute} might have the same semantics as \tcode{GetFullPathNameW}. +\tcode{absolute} typically has the same semantics as \tcode{GetFullPathNameW}. \end{example} \end{itemdescr} @@ -15762,7 +15763,7 @@ \pnum \begin{note} The current path as returned by many operating systems is a dangerous - global variable. It might be changed unexpectedly by third-party or system + global variable, and can be changed unexpectedly by third-party or system library functions, or by another thread. \end{note} \end{itemdescr} @@ -15789,7 +15790,7 @@ \pnum \begin{note} The current path for many operating systems is a dangerous - global state. It might be changed unexpectedly by a third-party or system + global state, and can be changed unexpectedly by a third-party or system library functions, or by another thread. \end{note} \end{itemdescr} @@ -16277,8 +16278,8 @@ \pnum \begin{note} -A postcondition of \tcode{last_write_time(p) == new_time} is not specified since it might not hold for file systems - with coarse time granularity. +A postcondition of \tcode{last_write_time(p) == new_time} is not specified +because it does not necessarily hold for file systems with coarse time granularity. \end{note} \end{itemdescr} @@ -16520,7 +16521,7 @@ \tcode{new_p} is removed; otherwise, \item if \tcode{new_p} resolves to an existing directory, \tcode{new_p} is removed if empty on POSIX compliant operating systems - but might be an error on other operating systems. + but can be an error on other operating systems. \end{itemize} \end{itemize} A symbolic link is itself renamed, rather than the file it resolves to. @@ -16583,8 +16584,7 @@ The value of member \tcode{space_info::available} is operating system dependent. \begin{note} -\tcode{available} might be - less than \tcode{free}. +\tcode{available} can be less than \tcode{free}. \end{note} \end{itemdescr} @@ -16789,12 +16789,12 @@ \pnum \begin{example} -For POSIX-based operating systems, an implementation might +For POSIX-based operating systems, an implementation can return the path supplied by the first environment variable found in the list TMPDIR, TMP, TEMP, TEMPDIR, or if none of these are found, \tcode{"/tmp"}. -For Windows-based operating systems, an implementation might return the path +For Windows-based operating systems, an implementation can return the path reported by the Windows \tcode{GetTempPath} API function. \end{example} \end{itemdescr} From 011b3e16cf875314e48f1c1844469d6619bc8b1a Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 13 Nov 2020 03:23:33 +0100 Subject: [PATCH 237/250] [concepts] Replace 'could' and 'might' (#4353) as directed by ISO/CS. --- source/concepts.tex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/concepts.tex b/source/concepts.tex index 9d6d69880d..6d1e0df5fa 100644 --- a/source/concepts.tex +++ b/source/concepts.tex @@ -63,7 +63,7 @@ equality-preserving expressions. It effectively forbids spontaneous changes to an object, changes to an object from another thread of execution, changes to an object as side effects of non-modifying expressions, and changes to an object as -side effects of modifying a distinct object if those changes could be observable +side effects of modifying a distinct object if those changes can be observable to a library function via an equality-preserving expression that is required to be valid for that object. \end{note} @@ -394,7 +394,7 @@ are modeled, then \tcode{T} and \tcode{U} share a \term{common reference type}, \tcode{C}. \begin{note} -\tcode{C} could be the same as \tcode{T}, or \tcode{U}, or it could be a +\tcode{C} can be the same as \tcode{T} or \tcode{U}, or can be a different type. \tcode{C} can be a reference type. \end{note} @@ -437,8 +437,8 @@ \tcode{C}, then \tcode{T} and \tcode{U} share a \term{common type}, \tcode{C}. \begin{note} -\tcode{C} could be the same as \tcode{T}, or \tcode{U}, or it could be a -different type. \tcode{C} might not be unique. +\tcode{C} can be the same as \tcode{T} or \tcode{U}, or can be a +different type. \tcode{C} is not necessarily unique. \end{note} \begin{itemdecl} @@ -1138,7 +1138,7 @@ \pnum \begin{note} The \libconcept{semiregular} concept is modeled by types that behave similarly -to built-in types like \tcode{int}, except that they might not +to built-in types like \tcode{int}, except that they need not be comparable with \tcode{==}. \end{note} From cf6f4467eeeae4e07bb5ef947e3a7edd0ce5e8b0 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Tue, 10 Nov 2020 22:09:33 +0100 Subject: [PATCH 238/250] [utilities] Replace 'could' and 'might' as directed by ISO/CS. --- source/utilities.tex | 48 +++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/source/utilities.tex b/source/utilities.tex index d35fae2354..ec0cd64fb3 100644 --- a/source/utilities.tex +++ b/source/utilities.tex @@ -2288,9 +2288,9 @@ \pnum \begin{note} The above definition does not require \tcode{t$_{\mathrm{tail}}$} -(or \tcode{u$_{\mathrm{tail}}$}) to be constructed. It might not -even be possible, as \tcode{t} and \tcode{u} are not required to be copy -constructible. Also, all comparison operator functions are short circuited; +(or \tcode{u$_{\mathrm{tail}}$}) to be constructed; +this is impossible if \tcode{t} or \tcode{u} is not copy-constructible. +Also, all comparison operator functions are short circuited; they do not perform element accesses beyond what is required to determine the result of the comparison. \end{note} @@ -4724,7 +4724,8 @@ \pnum \begin{note} -A \tcode{variant} might not hold a value if an exception is thrown during a +It is possible for a \tcode{variant} to hold no value +if an exception is thrown during a type-changing assignment or emplacement. The latter means that even a \tcode{variant} can become \tcode{valueless_by_exception()}, for instance by @@ -5400,7 +5401,7 @@ However, any such small-object optimization shall only be applied to types \tcode{T} for which \tcode{is_nothrow_move_constructible_v} is \tcode{true}. \begin{example} -A contained value of type \tcode{int} could be stored in an internal buffer, +A contained value of type \tcode{int} can be stored in an internal buffer, not in separately-allocated memory. \end{example} @@ -7529,7 +7530,7 @@ whether \tcode{get_pointer_safety} returns \tcode{pointer_safety::relaxed} or \tcode{point\-er_safety::preferred} if the implementation has relaxed pointer -safety.\footnote{\tcode{pointer_safety::preferred} might be returned to indicate +safety.\footnote{\tcode{pointer_safety::preferred} can be returned to indicate that a leak detector is running so that the program can avoid spurious leak reports.} \end{itemdescr} @@ -7607,10 +7608,10 @@ \begin{note} The alignment assumption on an object \tcode{X} expressed by a call to \tcode{assume_aligned} -might result in generation of more efficient code. +can result in generation of more efficient code. It is up to the program to ensure that the assumption actually holds. The call does not cause the compiler to verify or enforce this. -An implementation might only make the assumption +An implementation can only make the assumption for those operations on \tcode{X} that access \tcode{X} through the pointer returned by \tcode{assume_aligned}. \end{note} @@ -9057,7 +9058,7 @@ \tcode{get_deleter()(old_p)}. \begin{note} The order of these operations is significant -because the call to \tcode{get_deleter()} might destroy \tcode{*this}. +because the call to \tcode{get_deleter()} can destroy \tcode{*this}. \end{note} \pnum @@ -9870,7 +9871,7 @@ \pnum \throws \tcode{bad_alloc}, or an \impldef{exception type when \tcode{shared_ptr} -constructor fails} exception when a resource other than memory could not be obtained. +constructor fails} exception when a resource other than memory cannot be obtained. \end{itemdescr} \indexlibraryctor{shared_ptr}% @@ -9924,7 +9925,7 @@ \throws \tcode{bad_alloc}, or an \impldef{exception type when \tcode{shared_ptr} constructor fails} exception -when a resource other than memory could not be obtained. +when a resource other than memory cannot be obtained. \end{itemdescr} \indexlibraryctor{shared_ptr}% @@ -10323,8 +10324,8 @@ \pnum \begin{note} -When multiple threads -might affect the return value of \tcode{use_count()}, +When it is possible that multiple threads +affect the return value of \tcode{use_count()}, the result is approximate. In particular, \tcode{use_count() == 1} does not imply that accesses through a previously destroyed \tcode{shared_ptr} have in any sense completed. @@ -11615,9 +11616,9 @@ A derived class shall implement this function to return \tcode{true} if memory allocated from \tcode{this} can be deallocated from \tcode{other} and vice-versa, otherwise \tcode{false}. \begin{note} -The most-derived type of \tcode{other} might not match the type of \tcode{this}. +It is possible that the most-derived type of \tcode{other} does not match the type of \tcode{this}. For a derived class \tcode{D}, an implementation of this function -could immediately return \tcode{false} +can immediately return \tcode{false} if \tcode{dynamic_cast(\&other) == nullptr}. \end{note} \end{itemdescr} @@ -15122,7 +15123,8 @@ \pnum \begin{note} The types deduced by the deduction guides for \tcode{function} -might change in future revisions of \Cpp{}. +have been identified as candidates +for being changed in a future revision of \Cpp{}. \end{note} \rSec4[func.wrap.func.con]{Constructors and destructor} @@ -15896,8 +15898,8 @@ directly or indirectly depends on an incompletely-defined object type \tcode{T}, and \item - that instantiation could yield a different result - were \tcode{T} hypothetically completed. + that instantiation would yield a different result + if performed in a context where \tcode{T} were a complete type. \end{itemize} \rSec2[meta.type.synop]{Header \tcode{} synopsis} @@ -18562,10 +18564,10 @@ \end{codeblock} \end{example} \begin{note} -Because different parallel architectures might require idiosyncratic -parameters for efficient execution, implementations -can provide additional execution policies to those described in this -standard as extensions. +Implementations can provide additional execution policies +to those described in this standard as extensions +to address parallel architectures that require idiosyncratic +parameters for efficient execution. \end{note} \rSec2[execution.syn]{Header \tcode{} synopsis} @@ -19723,7 +19725,7 @@ string s0 = format("{}", 42); // value of \tcode{s0} is \tcode{"42"} string s1 = format("{0:b} {0:d} {0:o} {0:x}", 42); // value of \tcode{s1} is \tcode{"101010 42 52 2a"} string s2 = format("{0:#x} {0:#X}", 42); // value of \tcode{s2} is \tcode{"0x2a 0X2A"} -string s3 = format("{:L}", 1234); // value of \tcode{s3} might be \tcode{"1,234"} +string s3 = format("{:L}", 1234); // value of \tcode{s3} can be \tcode{"1,234"} // (depending on the locale) \end{codeblock} \end{example} From e0c456ed82b8995530abafb40829b8053d90f6da Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 09:57:42 +0100 Subject: [PATCH 239/250] [atomics] Replace 'could' and 'might' as directed by ISO/CS. --- source/atomics.tex | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/source/atomics.tex b/source/atomics.tex index d27751b89e..a3ef35fa2a 100644 --- a/source/atomics.tex +++ b/source/atomics.tex @@ -769,7 +769,7 @@ atomic operations applied through any other \tcode{atomic_ref} referencing the same object. \begin{note} -Atomic operations or the \tcode{atomic_ref} constructor could acquire +Atomic operations or the \tcode{atomic_ref} constructor can acquire a shared resource, such as a lock associated with the referenced object, to enable atomic operations to be applied to the referenced object. \end{note} @@ -791,14 +791,15 @@ \pnum \begin{note} -Hardware could require an object +Hardware can require an object referenced by an \tcode{atomic_ref} to have stricter alignment\iref{basic.align} than other objects of type \tcode{T}. Further, whether operations on an \tcode{atomic_ref} -are lock-free could depend on the alignment of the referenced object. -For example, lock-free operations on \tcode{std::complex} -could be supported only if aligned to \tcode{2*alignof(double)}. +are lock-free can depend on the alignment of the referenced object. +For example, it is possible that the hardware supports +lock-free atomic operations on a \tcode{std::complex} object +only if the object is aligned to \tcode{2*alignof(double)}. \end{note} \end{itemdescr} @@ -1607,7 +1608,7 @@ is \tcode{false}. \begin{note} Type arguments that are -not also statically initializable might be difficult to use. +not also statically initializable can be difficult to use. \end{note} \pnum @@ -1970,7 +1971,7 @@ \pnum \begin{note} Under cases where the \tcode{memcpy} and \tcode{memcmp} semantics of the compare-and-exchange -operations apply, the outcome might be failed comparisons for values that compare equal with +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} @@ -1999,7 +2000,7 @@ \end{note} \begin{note} For a union with bits that participate in the value representation -of some members but not others, compare-and-exchange might always fail. +of some members but not others, it is possible for compare-and-exchange to always fail. This is because such padding bits have an indeterminate value when they do not participate in the value representation of the active member. As a consequence, the following code is not guaranteed to ever succeed: From 8d205a18c41cfe338727601dfaae2460c18d388a Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 20:33:10 +0100 Subject: [PATCH 240/250] [depr] Replace 'could' and 'might' as directed by ISO/CS. --- source/future.tex | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/source/future.tex b/source/future.tex index 9ef3187f9a..2aaa52acf6 100644 --- a/source/future.tex +++ b/source/future.tex @@ -209,8 +209,6 @@ as defaulted is deprecated if the class has a user-declared copy constructor or a user-declared destructor. -In a future revision of \Cpp{}, these implicit definitions -could become deleted\iref{dcl.fct.def.delete}. \rSec1[depr.c.headers]{C headers} @@ -2758,7 +2756,7 @@ an atomic variable of static storage duration of a type that is initialization-compatible with \tcode{value}. \begin{note} -This operation might need to initialize locks. +This operation possibly needs to initialize locks. \end{note} Concurrent access to the variable being initialized, even via an atomic operation, From f0daf18840bf3b70c3c766e55e4ba7d914d8e7a4 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 22:36:58 +0100 Subject: [PATCH 241/250] [support] Replace 'could' and 'might' as directed by ISO/CS. --- source/support.tex | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/source/support.tex b/source/support.tex index a234614710..b702ab131b 100644 --- a/source/support.tex +++ b/source/support.tex @@ -542,8 +542,9 @@ 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 -the values of these macros with greater values. +Future revisions of \Cpp{} will replace +the values of these macros with greater values +when the corresponding feature is modified. \end{note} \begin{codeblock} @@ -1948,13 +1949,13 @@ data race\iref{res.on.data.races}. \end{note} \begin{note} -The order of registration could be indeterminate if \tcode{at_quick_exit} was called from more -than one thread. +The order of registration can be indeterminate +if \tcode{at_quick_exit} is called from more than one thread. \end{note} \begin{note} The \tcode{at_quick_exit} registrations are distinct from the \tcode{atexit} registrations, -and applications might need to call both registration functions with the same argument. +and applications possibly need to call both registration functions with the same argument. \end{note} \pnum @@ -2236,7 +2237,7 @@ the program shall also define the corresponding version without the \tcode{size} parameter. \begin{note} -The default behavior below might change in the future, which will require +It is anticipated that the default behavior will change in the future and will instead require replacing both deallocation functions when replacing the allocation function. \end{note} @@ -2491,7 +2492,7 @@ the program shall also define the corresponding version without the \tcode{size} parameter. \begin{note} -The default behavior below might change in the future, which will require +It is anticipated that the default behavior will change in the future and will instead require replacing both deallocation functions when replacing the allocation function. \end{note} @@ -3675,7 +3676,7 @@ \pnum \begin{note} -An implementation might use a reference-counted smart +An implementation can use a reference-counted smart pointer as \tcode{exception_ptr}. \end{note} @@ -4126,7 +4127,7 @@ that (a) admits all of the six two-way comparison operators (\ref{expr.rel}, \ref{expr.eq}), (b) does not imply substitutability, and (c) permits two values to be incomparable.% -\footnote{That is, \tcode{a < b}, \tcode{a == b}, and \tcode{a > b} might all be \tcode{false}.} +\footnote{That is, \tcode{a < b}, \tcode{a == b}, and \tcode{a > b} can all be \tcode{false}.} \indexlibraryglobal{partial_ordering}% \indexlibrarymember{less}{partial_ordering}% @@ -5625,7 +5626,7 @@ \item initialization of a variable with static storage duration requiring dynamic initialization~(\ref{basic.start.dynamic}, \ref{stmt.dcl})% -\footnote{Such initialization might occur because it is the first odr-use\iref{basic.def.odr} of that variable.}; or +\footnote{Such initialization can occur because it is the first odr-use\iref{basic.def.odr} of that variable.}; or \item waiting for the completion of the initialization of a variable with static storage duration\iref{stmt.dcl}. From 835c13720bcbf543d4ef7f96ac768245f7ff03d4 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 12 Nov 2020 17:57:41 +0100 Subject: [PATCH 242/250] [temp] Replace 'could' and 'might' as directed by ISO/CS. --- source/templates.tex | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/source/templates.tex b/source/templates.tex index 748095e706..528868e3e0 100644 --- a/source/templates.tex +++ b/source/templates.tex @@ -732,8 +732,8 @@ the \grammarterm{template-id}. \begin{note} The second \tcode{>} -token produced by this replacement rule could terminate an enclosing -\grammarterm{template-id} construct or it could be part of a different +token produced by this replacement rule can terminate an enclosing +\grammarterm{template-id} construct or it can be part of a different construct (e.g., a cast). \end{note} \begin{example} @@ -2142,7 +2142,7 @@ refer to the same type only if their \grammarterm{expression}{s} are equivalent\iref{temp.over.link}. \begin{note} -However, such a type might be aliased, +However, such a type can be aliased, e.g., by a \grammarterm{typedef-name}. \end{note} @@ -2214,13 +2214,13 @@ \pnum \begin{example} -A single class template +It is possible for a single class template \tcode{List} -might provide an unbounded set of class definitions: +to provide an unbounded set of class definitions: one class \tcode{List} for every type \tcode{T}, each describing a linked list of elements of type \tcode{T}. Similarly, a class template \tcode{Array} describing a contiguous, -dynamic array might be defined like this: +dynamic array can be defined like this: \begin{codeblock} template class Array { T* v; @@ -2233,9 +2233,8 @@ \end{codeblock} The prefix \tcode{\keyword{template}} specifies that a template is being declared and that a -\grammarterm{type-name} -\tcode{T} -may be used in the declaration. +\grammarterm{type-name} \tcode{T} +can be used in the declaration. In other words, \tcode{Array} is a parameterized type with @@ -2330,7 +2329,7 @@ \end{codeblock} declares three member functions of a class template. -The subscript function might be defined like this: +The subscript function can be defined like this: \begin{codeblock} template T& Array::operator[](int i) { @@ -2557,7 +2556,7 @@ A destructor shall not be a member template. A non-template member function\iref{dcl.fct} with a given name -and type and a member function template of the same name, which could be +and type and a member function template of the same name, which can be used to generate a specialization of the same type, can both be declared in a class. When both exist, a use of that name and type refers to the @@ -3344,7 +3343,7 @@ \item The template parameter list of a specialization shall not contain default -template argument values.\footnote{There is no way in which they could be used.} +template argument values.\footnote{There is no context in which they would be used.} \item An argument shall not contain an unexpanded pack. If an argument is a pack expansion\iref{temp.variadic}, it shall be @@ -3617,7 +3616,7 @@ \pnum A function template defines an unbounded set of related functions. \begin{example} -A family of sort functions might be declared like this: +A family of sort functions can be declared like this: \begin{codeblock} template class Array { }; @@ -3780,7 +3779,7 @@ the expressions perform the same operations in the same order with the same entities. \begin{note} -For instance, one could have redundant parentheses. +For instance, one can have redundant parentheses. \end{note} \pnum @@ -5628,7 +5627,7 @@ public: void f() { g(1); // calls \tcode{g(double)} - h++; // ill-formed: cannot increment function; this could be diagnosed + h++; // ill-formed: cannot increment function; this can be diagnosed // either here or at the point of instantiation } }; @@ -6479,7 +6478,7 @@ \pnum There is an \impldef{maximum depth of recursive template instantiations} quantity that specifies the limit on the total depth of recursive instantiations\iref{implimits}, -which could involve more than one template. +which can involve more than one template. The result of an infinite recursion in instantiation is undefined. \begin{example} \begin{codeblock} @@ -8678,8 +8677,8 @@ struct A { @\commentellip@ }; struct B : A { @\commentellip@ }; void g(A a, B b) { - f(a,b); // error: \tcode{T} could be \tcode{A} or \tcode{B} - f(b,a); // error: \tcode{T} could be \tcode{A} or \tcode{B} + f(a,b); // error: \tcode{T} deduced as both \tcode{A} and \tcode{B} + f(b,a); // error: \tcode{T} deduced as both \tcode{A} and \tcode{B} f(a,a); // OK: \tcode{T} is \tcode{A} f(b,b); // OK: \tcode{T} is \tcode{B} } @@ -8699,8 +8698,8 @@ void r() { f(g1); // OK: \tcode{T} is \tcode{int} and \tcode{U} is \tcode{float} - f(g2); // error: \tcode{T} could be \tcode{char} or \tcode{int} - f(g3); // error: \tcode{U} could be \tcode{char} or \tcode{float} + f(g2); // error: \tcode{T} deduced as both \tcode{char} and \tcode{int} + f(g3); // error: \tcode{U} deduced as both \tcode{char} and \tcode{float} } \end{codeblock} @@ -9225,7 +9224,7 @@ int max(int,int); \end{codeblock} to the example above would resolve the third call, by providing a function that -could be called for +can be called for \tcode{max(a,c)} after using the standard conversion of \tcode{char} From 62ac4378978690ef1c4b86d0a809bb248c9435e6 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 12 Nov 2020 19:18:45 +0100 Subject: [PATCH 243/250] [over] Replace 'could' and 'might' as directed by ISO/CS. --- source/overloading.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/overloading.tex b/source/overloading.tex index 977ed2806b..ff924dded9 100644 --- a/source/overloading.tex +++ b/source/overloading.tex @@ -2156,12 +2156,12 @@ that is not worse than any opponent it faced. -Although another function +Although it is possible that another function \tcode{F} that \tcode{W} did not face -might be at least as good as +is at least as good as \tcode{W}, \tcode{F} cannot be the best function because at some point in the @@ -2257,7 +2257,7 @@ and whether a function is deleted\iref{dcl.fct.def.delete}, are ignored. So, although an implicit conversion sequence can be defined for a given argument-parameter -pair, the conversion from the argument to the parameter might still +pair, the conversion from the argument to the parameter can still be ill-formed in the final analysis. \end{note} @@ -4199,7 +4199,7 @@ \pnum A declaration whose \grammarterm{declarator-id} is a \grammarterm{literal-operator-id} shall be a declaration of a namespace-scope -function or function template (it could be a friend +function or function template (for example, it can be a friend function\iref{class.friend}), an explicit instantiation or specialization of a function template, or a \grammarterm{using-declaration}\iref{namespace.udecl}. A function declared with a \grammarterm{literal-operator-id} is a \defnx{literal From 120688ccc8989d180dfb6e7da17ddaabf859e065 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 12 Nov 2020 19:34:52 +0100 Subject: [PATCH 244/250] [class] Replace 'could' and 'might' as directed by ISO/CS. --- source/classes.tex | 50 ++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/source/classes.tex b/source/classes.tex index f6f16d771b..b15779540b 100644 --- a/source/classes.tex +++ b/source/classes.tex @@ -614,7 +614,7 @@ In a \grammarterm{member-declarator} for a bit-field, the \grammarterm{constant-expression} is parsed as the longest sequence of tokens -that could syntactically form a \grammarterm{constant-expression}. +that matches the syntax of a \grammarterm{constant-expression}. \begin{example} \begin{codeblock} int a; @@ -733,8 +733,8 @@ The order of allocation of non-static data members with different access control is unspecified. -Implementation alignment requirements might cause two adjacent members -not to be allocated immediately after each other; so might requirements +Implementation alignment requirements can cause two adjacent members +not to be allocated immediately after each other; so can requirements for space for managing virtual functions\iref{class.virtual} and virtual base classes\iref{class.mi}. \end{note} @@ -832,7 +832,7 @@ if that member is not a bit-field. Its address is also the same as the address of each of its base class subobjects. \begin{note} -There might therefore be unnamed padding within a standard-layout struct object +There can therefore be unnamed padding within a standard-layout struct object inserted by an implementation, but not at its beginning, as necessary to achieve appropriate alignment. \end{note} @@ -1441,7 +1441,7 @@ \begin{note} An implicitly-declared default constructor has an exception specification\iref{except.spec}. -An explicitly-defaulted definition might have an +An explicitly-defaulted definition can have an implicit exception specification, see~\ref{dcl.fct.def}. \end{note} @@ -1649,7 +1649,7 @@ \begin{note} When the move constructor is not implicitly declared or explicitly supplied, -expressions that otherwise would have invoked the move constructor might instead invoke +expressions that otherwise would have invoked the move constructor can instead invoke a copy constructor. \end{note} @@ -1982,7 +1982,7 @@ by the corresponding assignment operator of a derived class\iref{over.ass}. A \grammarterm{using-declaration}\iref{namespace.udecl} that brings in from a base class an assignment operator -with a parameter type that could be that of a +with a parameter type that can be that of a copy/move assignment operator for the derived class is not considered an explicit declaration of such an operator and does not suppress the implicit declaration of the derived class @@ -2301,11 +2301,9 @@ Bases and members are destroyed in the reverse order of the completion of their constructor (see~\ref{class.base.init}). \begin{note} -A -\tcode{return} -statement\iref{stmt.return} in a destructor might not directly return to the -caller; before transferring control to the caller, the destructors for the -members and bases are called. +A \tcode{return} statement\iref{stmt.return} in a destructor +calls the destructors for the members and bases (if any) +before transferring control to the caller. \end{note} \indextext{order of execution!destructor and array}% Destructors for elements of an array are called in reverse order of their @@ -2692,7 +2690,7 @@ in a \grammarterm{conversion-function-id} is the longest sequence of -tokens that could possibly form a \grammarterm{conversion-type-id}. +tokens that matches the syntax of a \grammarterm{conversion-type-id}. \begin{note} This prevents ambiguities between the declarator operator \tcode{*} and its expression counterparts. @@ -3600,9 +3598,9 @@ \pnum \begin{note} -A base class subobject might have a layout different +A base class subobject can have a layout different from the layout of a most derived object of the same type. A base class -subobject might have a polymorphic behavior\iref{class.cdtor} +subobject can have a polymorphic behavior\iref{class.cdtor} different from the polymorphic behavior of a most derived object of the same type. A base class subobject can be of zero size; however, two subobjects that have the same class type and that belong to @@ -3692,7 +3690,7 @@ \end{importgraphic} In such lattices, explicit qualification can be used to specify which -subobject is meant. The body of function \tcode{C::f} could refer to the +subobject is meant. The body of function \tcode{C::f} can refer to the member \tcode{next} of each \tcode{L} subobject: \begin{codeblock} void C::f() { A::next = B::next; } // well-formed @@ -3774,8 +3772,8 @@ A class that declares or inherits a virtual function is called a \defnadj{polymorphic}{class}.\footnote{If all virtual functions are immediate functions, -the class is still polymorphic even though -its internal representation might not otherwise require +the class is still polymorphic even if +its internal representation does not otherwise require any additions for that polymorphic behavior.} \pnum @@ -4134,7 +4132,7 @@ \grammarterm{pure-specifier}\iref{class.mem} in the function declaration in the class definition. \begin{note} -Such a function might be inherited: see below. +Such a function can be inherited: see below. \end{note} A class is an \defnadj{abstract}{class} if it has at least one pure virtual function. @@ -4464,7 +4462,7 @@ \pnum \begin{note} Even if the result of name lookup is unambiguous, use of a name found in -multiple subobjects might still be +multiple subobjects can still be ambiguous~(\ref{conv.mem}, \ref{expr.ref}, \ref{class.access.base}). \end{note} \begin{example} @@ -4756,7 +4754,7 @@ \begin{note} In a derived class, the lookup of a base class name will find the injected-class-name instead of the name of the base class in the scope -in which it was declared. The injected-class-name might be less accessible +in which it was declared. The injected-class-name can be less accessible than the name of the base class in the scope in which it was declared. \end{note} @@ -4847,12 +4845,12 @@ \pnum \begin{note} -A member of a private base class might be inaccessible as an inherited +A member of a private base class can be inaccessible as an inherited member name, but accessible directly. Because of the rules on pointer conversions\iref{conv.ptr} and explicit casts~(\ref{expr.type.conv}, \ref{expr.static.cast}, \ref{expr.cast}), a conversion from a pointer to a derived class to a pointer -to an inaccessible base class might be ill-formed if an implicit conversion +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, @@ -6331,7 +6329,7 @@ struct X { X(A*); }; struct E : C, D, X { - E() : D(this), // undefined behavior: upcast from \tcode{E*} to \tcode{A*} might use path \tcode{E*} $\rightarrow$ \tcode{D*} $\rightarrow$ \tcode{A*} + E() : D(this), // undefined behavior: upcast from \tcode{E*} to \tcode{A*} can use path \tcode{E*} $\rightarrow$ \tcode{D*} $\rightarrow$ \tcode{A*} // but \tcode{D} is not constructed // ``\tcode{D((C*)this)}\!'' would be defined: \tcode{E*} $\rightarrow$ \tcode{C*} is defined because \tcode{E()} has started, @@ -6546,7 +6544,7 @@ requiring a constant expression\iref{expr.const} and in constant initialization\iref{basic.start.static}. \begin{note} -Copy elision might be performed +It is possible that copy elision is performed if the same expression is evaluated in another context. \end{note} @@ -7212,7 +7210,7 @@ \pnum Access to the deallocation function is checked statically. \begin{note} -Hence, even though a different one might actually be executed, +Hence, even if a different one is actually executed, the statically visible deallocation function is required to be accessible. \end{note} \begin{example} From 389a2308ee8fab9d5116960618d587892a58ab47 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 12 Nov 2020 19:49:02 +0100 Subject: [PATCH 245/250] [dcl.dcl] Replace 'could' and 'might' as directed by ISO/CS. --- source/declarations.tex | 68 ++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 35 deletions(-) diff --git a/source/declarations.tex b/source/declarations.tex index 141298caae..0bde04cd6b 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -924,14 +924,11 @@ \end{itemize} \pnum -For a constexpr function or constexpr constructor -that is neither defaulted nor a template, -if no argument values exist such that -an invocation of the function or constructor could be an evaluated subexpression of a core -constant expression\iref{expr.const}, or, -for a constructor, an evaluated subexpression of -the initialization full-expression of some constant-initialized object\iref{basic.start.static}, -the program is ill-formed, no diagnostic required. +A constexpr function that is neither defaulted nor a template +is ill-formed, no diagnostic required, +if it is not possible for an evaluation of an invocation of the function +to be performed +while evaluating any valid manifestly constant-evaluated expression. \begin{example} \begin{codeblock} constexpr int f(bool b) @@ -1238,7 +1235,7 @@ Redundant cv-qualifications are ignored. \begin{note} For example, -these could be introduced by typedefs. +these can be introduced by typedefs. \end{note} \pnum @@ -1317,9 +1314,9 @@ \indextext{\idxcode{volatile}!implementation-defined}% \begin{note} \tcode{volatile} is a hint to the implementation to avoid aggressive -optimization involving the object because the value of the object might -be changed by means undetectable by an implementation. -Furthermore, for some implementations, \tcode{volatile} might indicate that +optimization involving the object because it is possible for the value of the object +to change by means undetectable by an implementation. +Furthermore, for some implementations, \tcode{volatile} can indicate that special hardware instructions are required to access the object. See~\ref{intro.execution} for detailed semantics. In general, the semantics of \tcode{volatile} are intended to be the same in \Cpp{} as @@ -2400,8 +2397,9 @@ a redundant set of parentheses around a parameter name and an object declaration with a function-style cast as the initializer. Just as for the ambiguities mentioned in~\ref{stmt.ambig}, -the resolution is to consider any construct that could possibly -be a declaration a declaration. +the resolution is to consider any construct +that matches the syntax of a declaration +to be a declaration. \begin{note} A declaration can be explicitly disambiguated by adding parentheses around the argument. @@ -2428,10 +2426,9 @@ An ambiguity can arise from the similarity between a function-style cast and a \grammarterm{type-id}. -The resolution is that any construct that could possibly be a -\grammarterm{type-id} -in its syntactic context shall be considered a -\grammarterm{type-id}. +The resolution is that any construct +that matches the syntax of a \grammarterm{type-id} +is interpreted as a \grammarterm{type-id}. \begin{example} \begin{codeblock} template struct X {}; @@ -3604,7 +3601,7 @@ For example, the function \tcode{fpif} -above could have been declared +above can be declared \begin{codeblock} typedef int IFUNC(int); IFUNC* fpif(int); @@ -4602,9 +4599,9 @@ no constructor of the object's class is invoked for the initialization. \begin{note} -Such an object might have been value-initialized -or initialized by aggregate initialization\iref{dcl.init.aggr} -or by an inherited constructor\iref{class.inhctor.init}. +Such an object can use value-initializion, +aggregate initialization\iref{dcl.init.aggr}, +or initialization by an inherited constructor\iref{class.inhctor.init}. \end{note} Destroying an object of class type invokes the destructor of the class. Destroying a scalar type has no effect other than @@ -4620,7 +4617,7 @@ this is the defining declaration\iref{basic.def} of the variable, but the initializing declaration of a non-inline static data member\iref{class.static.data} -might be the declaration within the class definition +can be the declaration within the class definition and not the definition at namespace scope. \end{note} @@ -5833,7 +5830,7 @@ ill-formed\iref{class.base.init}. \end{example} \begin{note} -The implementation is free to allocate the array in read-only memory if an explicit array with the same initializer could be so allocated. +The implementation is free to allocate the array in read-only memory if an explicit array with the same initializer can be so allocated. \end{note} \pnum @@ -5868,8 +5865,8 @@ int x = 999; // \tcode{x} is not a constant expression const int y = 999; const int z = 99; -char c1 = x; // OK, though it might narrow (in this case, it does narrow) -char c2{x}; // error: might narrow +char c1 = x; // OK, though it potentially narrows (in this case, it does narrow) +char c2{x}; // error: potentially narrows char c3{y}; // error: narrows (assuming \tcode{char} is 8 bits) char c4{z}; // OK: no narrowing needed unsigned char uc1 = {5}; // OK: no narrowing needed @@ -5878,7 +5875,7 @@ signed int si1 = { (unsigned int)-1 }; // error: narrows int ii = {2.0}; // error: narrows -float f1 { x }; // error: might narrow +float f1 { x }; // error: potentially narrows float f2 { 7 }; // OK: 7 can be exactly represented as a \tcode{float} bool b = {"meow"}; // error: narrows int f(int); @@ -8197,7 +8194,7 @@ \begin{note} Some of the properties associated with an entity with language linkage are specific to each implementation and are not described here. For -example, a particular language linkage might be associated with a +example, a particular language linkage can be associated with a particular form of representing names of objects and functions with external linkage, or with a particular calling convention, etc. \end{note} @@ -8749,7 +8746,7 @@ \pnum \begin{note} The \tcode{carries_dependency} attribute does not change the meaning of the -program, but might result in generation of more efficient code. +program, but can result in generation of more efficient code. \end{note} \pnum @@ -8792,9 +8789,10 @@ hardware memory ordering instructions (a.k.a.\ fences). Function \tcode{g}'s second parameter has a \tcode{carries_dependency} attribute, but its first parameter does not. Therefore, function \tcode{h}'s first call to -\tcode{g} carries a dependency into \tcode{g}, but its second call does not. The -implementation might need to insert a fence prior to the second call to -\tcode{g}. +\tcode{g} carries a dependency into \tcode{g}, but its second call does not. +It is possible +that the implementation needs to insert a fence +prior to the second call to \tcode{g}. \end{example} \indextext{attribute|)}% \indextext{declaration|)} @@ -8876,7 +8874,7 @@ \pnum \recommended The use of a fallthrough statement should suppress -a warning that an implementation might otherwise issue +any warning that an implementation would otherwise issue for a case or default label that is reachable from another case or default label along some path of execution. Implementations should issue a warning @@ -9139,7 +9137,7 @@ \pnum \recommended Implementations should issue a -warning if a function marked \tcode{[[noreturn]]} might return. +warning if a function marked \tcode{[[noreturn]]} can return. \pnum \begin{example} @@ -9190,6 +9188,6 @@ }; \end{codeblock} Here, \tcode{hasher}, \tcode{pred}, and \tcode{alloc} -could have the same address as \tcode{buckets} +can have the same address as \tcode{buckets} if their respective types are all empty. \end{example} From 25ddc8638c110d2c52c117984f29566460cd325a Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 12 Nov 2020 21:02:07 +0100 Subject: [PATCH 246/250] [basic] Replace 'could' and 'might' as directed by ISO/CS. --- source/basic.tex | 63 ++++++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 31 deletions(-) diff --git a/source/basic.tex b/source/basic.tex index 604ee092bd..e40ddfab3f 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -695,10 +695,10 @@ The entity is still declared in multiple translation units, and \ref{basic.link} still applies to these declarations. In particular, \grammarterm{lambda-expression}{s}\iref{expr.prim.lambda} -appearing in the type of \tcode{D} might result +appearing in the type of \tcode{D} can result in the different declarations having distinct types, and \grammarterm{lambda-expression}{s} appearing in a default argument of \tcode{D} -might still denote different types in different translation units. +can still denote different types in different translation units. \end{note} \pnum @@ -1534,7 +1534,7 @@ A name used in the definition of a class \tcode{X}% \footnote{This refers to unqualified names following the class name; -such a name might be used in a \grammarterm{base-specifier} or +such a name can be used in a \grammarterm{base-specifier} or in the \grammarterm{member-specification} of the class definition.} outside of a complete-class context\iref{class.mem} of \tcode{X} shall be declared in one of the following ways: @@ -2837,7 +2837,7 @@ \grammarterm{using-directive}{s} do not declare entities. Enumerators do not have linkage, -but might serve as the name of an enumeration with linkage\iref{dcl.enum}. +but can serve as the name of an enumeration with linkage\iref{dcl.enum}. \end{note} \pnum @@ -2934,7 +2934,7 @@ or defines a constexpr variable initialized to a TU-local value (defined below). \begin{note} An inline function template can be an exposure even though -explicit specializations of it might be usable in other translation units. +explicit specializations of it are possibly usable in other translation units. \end{note} \pnum @@ -2965,7 +2965,7 @@ a specialization of a template whose (possibly instantiated) declaration is an exposure. \begin{note} -The specialization might have been implicitly or explicitly instantiated. +A specialization can be produced by implicit or explicit instantiation. \end{note} \end{itemize} @@ -3029,7 +3029,7 @@ } void adl(double); -inline void h(auto x) { adl(x); } // OK, but a specialization might be an exposure +inline void h(auto x) { adl(x); } // OK, but a specialization can be an exposure \end{codeblocktu} \begin{codeblocktu}{Translation unit \#2} module A; @@ -3081,7 +3081,7 @@ sequence of adjacent bit-fields all having nonzero width. \begin{note} Various -features of the language, such as references and virtual functions, might +features of the language, such as references and virtual functions, can involve additional memory locations that are not accessible to programs but are managed by the implementation. \end{note} @@ -3442,7 +3442,7 @@ lifetime ends there are significant restrictions on the use of the object, as described below, in~\ref{class.base.init} and in~\ref{class.cdtor}. Also, the behavior of an object under construction -and destruction might not be the same as the behavior of an object whose +and destruction is possibly not the same as the behavior of an object whose lifetime has started and not ended. \ref{class.base.init} and~\ref{class.cdtor} describe the behavior of an object during its periods of construction and destruction. @@ -3778,7 +3778,7 @@ have undefined behavior. Any other use of an invalid pointer value has \impldef{any use of an invalid pointer other than to perform indirection or deallocate} -behavior.\footnote{Some implementations might define that +behavior.\footnote{An implementation can define that copying an invalid pointer value causes a system-generated runtime fault.} @@ -4181,7 +4181,7 @@ \begin{note} The effect of using an invalid pointer value (including passing it to a deallocation function) is undefined, see~\ref{basic.stc}. -This is true even if the unsafely-derived pointer value might compare equal to +This is true even if the unsafely-derived pointer value compares equal to some safely-derived pointer value. \end{note} It is @@ -4224,9 +4224,10 @@ When \tcode{D} is the type of a complete object, it will have a subobject of type \tcode{B}, so it must be aligned appropriately for a \tcode{long double}. -If \tcode{D} appears as a subobject of another object that also has \tcode{B} -as a virtual base class, the \tcode{B} subobject might be part of a different -subobject, reducing the alignment requirements on the \tcode{D} subobject. +If \tcode{D} appears as a base class subobject, +it is possible that the alignment requirement of \tcode{B} +influences the alignment of only the most-derived object, +reducing the alignment requirements on the \tcode{D} subobject. \end{example} The result of the \tcode{alignof} operator reflects the alignment requirement of the type in the complete-object case. @@ -4543,7 +4544,7 @@ \item A temporary bound to a reference in a \grammarterm{new-initializer}\iref{expr.new} persists until the completion of the full-expression containing the \grammarterm{new-initializer}. \begin{note} -This might introduce a dangling reference. +This can introduce a dangling reference. \end{note} \begin{example} \begin{codeblock} @@ -4697,7 +4698,7 @@ constexpr std::size_t N = sizeof(T); char buf[N]; T obj; // \tcode{obj} initialized to its original value -std::memcpy(buf, &obj, N); // between these two calls to \tcode{std::memcpy}, \tcode{obj} might be modified +std::memcpy(buf, &obj, N); // between these two calls to \tcode{std::memcpy}, \tcode{obj} can be modified std::memcpy(&obj, buf, N); // at this point, each subobject of \tcode{obj} of scalar type holds its original value \end{codeblock} \end{example} @@ -4856,7 +4857,7 @@ \end{itemize} \begin{note} A literal type is one for which -it might be possible to create an object +it is superficially possible for an object to be created within a constant expression. It is not a guarantee that it is possible to create such an object, nor is it a guarantee that any object of that type @@ -5262,8 +5263,8 @@ \begin{note} A pointer past the end of an object\iref{expr.add} is not considered to point to an unrelated object -of the object's type -that might be located at that address. +of the object's type, +even if the unrelated object is located at that address. A pointer value becomes invalid when the storage it denotes reaches the end of its storage duration; @@ -5661,7 +5662,7 @@ \placeholder{B} or \placeholder{B} is sequenced before \placeholder{A}, but it is unspecified which. \begin{note} Indeterminately sequenced evaluations cannot overlap, but either -could be executed first. +can be executed first. \end{note} An expression \placeholder{X} is said to be sequenced before @@ -5816,7 +5817,7 @@ initial value of the object, a value assigned to the object by $T$, or a value assigned to the object by another thread, according to the rules below. \begin{note} -In some cases, there might instead be undefined behavior. Much of this +In some cases, there can instead be undefined behavior. Much of this subclause is motivated by the desire to support atomic operations with explicit and detailed visibility constraints. However, it also implicitly supports a simpler view for more restricted programs. @@ -5859,7 +5860,7 @@ There is a separate order for each atomic object. There is no requirement that these can be combined into a single total order for all objects. In general this will be impossible since different -threads might observe modifications to different objects in inconsistent orders. +threads can observe modifications to different objects in inconsistent orders. \end{note} \pnum @@ -6183,19 +6184,19 @@ \begin{note} Compiler transformations that introduce assignments to a potentially shared memory location that would not be modified by the abstract machine are -generally precluded by this document, since such an assignment might overwrite +generally precluded by this document, since such an assignment can overwrite another assignment by a different thread in cases in which an abstract machine execution would not have encountered a data race. This includes implementations of data member assignment that overwrite adjacent members in separate memory locations. Reordering of atomic loads in cases in which the atomics in question -might alias is also generally precluded, since this could violate the coherence +can alias is also generally precluded, since this can violate the coherence rules. \end{note} \pnum \begin{note} Transformations that introduce a speculative read of a potentially -shared memory location might not preserve the semantics of the \Cpp{} program as +shared memory location do not, in general, preserve the semantics of the \Cpp{} program as defined in this document, since they potentially introduce a data race. However, they are typically valid in the context of an optimizing compiler that targets a specific machine with well-defined semantics for data races. They would be @@ -6231,7 +6232,7 @@ a lock-free execution in that thread shall complete. \begin{note} Concurrently executing threads - might prevent progress of a lock-free execution. + can prevent progress of a lock-free execution. For example, this situation can occur with load-locked store-conditional implementations. @@ -6245,7 +6246,7 @@ to provide absolute guarantees to this effect, since repeated and particularly inopportune interference from other threads - could prevent forward progress, + can prevent forward progress, e.g., by repeatedly stealing a cache line for unrelated purposes @@ -6277,7 +6278,7 @@ \begin{example} A library I/O function that blocks until the I/O operation is complete can be considered to continuously check whether the operation is complete. Each -such check might consist of one or more execution steps, for example using +such check consists of one or more execution steps, for example using observable behavior of the abstract machine. \end{example} @@ -6351,9 +6352,9 @@ guarantees, which in turn are stronger than weakly parallel forward progress guarantees. \begin{note} -For example, some kinds of synchronization between threads of execution might only +For example, some kinds of synchronization between threads of execution are only guaranteed to make progress if the respective threads of execution provide parallel forward progress -guarantees, but will fail to make progress under weakly parallel guarantees. +guarantees, but will not necessarily make progress under weakly parallel guarantees. \end{note} \pnum @@ -6382,7 +6383,7 @@ stronger forward progress guarantee for a certain amount of time, due to a second thread of execution $A$ being blocked on it with forward progress guarantee delegation. In turn, if $B$ then blocks with -forward progress guarantee delegation on $C$, this could also temporarily +forward progress guarantee delegation on $C$, this can also temporarily provide a stronger forward progress guarantee to $C$. \end{note} From fbed293f12074b1310b29669da3b707fd9d10e46 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Fri, 13 Nov 2020 19:56:29 +0100 Subject: [PATCH 247/250] [expr] Replace 'could' and 'might' as directed by ISO/CS. --- source/expressions.tex | 50 +++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/source/expressions.tex b/source/expressions.tex index 0cf6429060..7cfcb10cdd 100644 --- a/source/expressions.tex +++ b/source/expressions.tex @@ -109,7 +109,7 @@ \begin{codeblock} a = (a + (b + 32765)); \end{codeblock} -since the values for \tcode{a} and \tcode{b} might have been, +since the values for \tcode{a} and \tcode{b} can be, respectively, 4 and -8 or -17 and 12. However on a machine in which overflows do not produce an exception and in which the results of overflows are reversible, the above expression statement can be @@ -165,7 +165,7 @@ \pnum \begin{note} Historically, lvalues and rvalues were so-called -because they could appear on the left- and right-hand side of an assignment +because they appeared on the left- and right-hand side of an assignment (although this is no longer generally true); glvalues are ``generalized'' lvalues, prvalues are ``pure'' rvalues, @@ -252,7 +252,7 @@ \begin{note} There are no prvalue bit-fields; if a bit-field is converted to a prvalue\iref{conv.lval}, a prvalue of the type of the bit-field is -created, which might then be promoted\iref{conv.prom}. +created, which can then be promoted\iref{conv.prom}. \end{note} \pnum @@ -767,10 +767,10 @@ can be converted to type \tcode{T2} if the cv-combined type of \tcode{T1} and \tcode{T2} is \tcode{T2}. \begin{note} -If a program could assign a pointer of type \tcode{T**} to a pointer of +If a program were able to assign a pointer of type \tcode{T**} to a pointer of type \tcode{const} \tcode{T**} (that is, if line \#1 below were -allowed), a program could inadvertently modify a const object -(as it is done on line \#2). For example, +allowed), it would be possible for a const object to be inadvertently modified +(as is done on line \#2). For example, \begin{codeblock} int main() { const char c = 'c'; @@ -1661,7 +1661,7 @@ or operator template is the \grammarterm{requires-clause} of the \grammarterm{lambda-declarator}, if any. \begin{note} -The function call operator template for a generic lambda might be +The function call operator template for a generic lambda can be an abbreviated function template\iref{dcl.fct}. \end{note} \begin{example} @@ -1927,7 +1927,7 @@ operators otherwise\iref{class.copy.assign}. \begin{note} These special member functions are implicitly defined as -usual, and might therefore be defined as deleted. +usual, which can result in them being defined as deleted. \end{note} \pnum @@ -2135,7 +2135,7 @@ auto g2 = [=](auto a) { int selector[sizeof(a) == 1 ? 1 : 2]{}; - f(x, selector); // OK: captures \tcode{x}, might call \#1 or \#2 + f(x, selector); // OK: captures \tcode{x}, can call \#1 or \#2 }; auto g3 = [=](auto a) { @@ -2143,12 +2143,12 @@ }; } \end{codeblock} -Within \tcode{g1}, an implementation might optimize away +Within \tcode{g1}, an implementation can optimize away the capture of \tcode{x} as it is not odr-used. \end{example} \begin{note} The set of captured entities is determined syntactically, -and entities might be implicitly captured +and entities are implicitly captured even if the expression denoting a local entity is within a discarded statement\iref{stmt.if}. \begin{example} @@ -2853,7 +2853,7 @@ The \tcode{>} token following the \grammarterm{type-id} in a \tcode{dynamic_cast}, \tcode{static_cast}, \tcode{reinterpret_cast}, or -\tcode{const_cast} might be the product of replacing a +\tcode{const_cast} can be the product of replacing a \tcode{>{>}} token by two consecutive \tcode{>} tokens\iref{temp.names}. \end{note} @@ -3026,7 +3026,7 @@ or destructor for a function parameter throws an exception, the search for a handler starts in the scope of the calling function; in particular, if the function called has a \grammarterm{function-try-block}\iref{except.pre} -with a handler that could handle the exception, +with a handler that can handle the exception, this handler is not considered. \end{example} @@ -3877,7 +3877,7 @@ \pnum \begin{note} -The mapping performed by \tcode{reinterpret_cast} might, or might not, produce a +The mapping performed by \tcode{reinterpret_cast} can produce a representation different from the original value. \end{note} @@ -4090,7 +4090,7 @@ \tcode{const_cast} that casts away a const-qualifier\footnote{\tcode{const_cast} is not limited to conversions that cast away a const-qualifier.} -might produce undefined behavior\iref{dcl.type.cv}. +can produce undefined behavior\iref{dcl.type.cv}. \end{note} \pnum @@ -4266,7 +4266,7 @@ The address of an overloaded function\iref{over} can be taken only in a context that uniquely determines which version of the overloaded function is referred to (see~\ref{over.over}). -Since the context might determine whether the operand is a static or +Since the context can determine whether the operand is a static or non-static member function, the context can also affect whether the expression has type ``pointer to function'' or ``pointer to member function''. @@ -4929,7 +4929,7 @@ versions\iref{class.free}. The set of allocation and deallocation functions that can be called by a \grammarterm{new-expression} -could include functions that do not perform allocation or deallocation; +can include functions that do not perform allocation or deallocation; for example, see \ref{new.delete.placement}. \end{note} @@ -5183,7 +5183,7 @@ \pnum \indextext{\idxcode{new}!exception and}% -If any part of the object initialization described above\footnote{This might +If any part of the object initialization described above\footnote{This can include evaluating a \grammarterm{new-initializer} and/or calling a constructor.} terminates by throwing an exception and a suitable deallocation function @@ -6486,8 +6486,8 @@ and the converted operand is used in place of the original operand for the remainder of this subclause. \begin{note} -The conversion might be ill-formed even if an implicit conversion -sequence could be formed. +It is possible for the conversion to be ill-formed even if an implicit conversion +sequence can be formed. \end{note} \pnum @@ -6745,7 +6745,7 @@ \begin{note} This restriction applies to the relationship between the left and right sides of the assignment operation; it is not a -statement about how the target of the assignment might be aliased in general. +statement about how the target of the assignment can be aliased in general. See~\ref{basic.lval}. \end{note} @@ -7321,7 +7321,7 @@ that is usable in constant expressions or has constant initialization\iref{basic.start.static}.% \footnote{Testing this condition -might involve a trial evaluation of its initializer as described above.} +can involve a trial evaluation of its initializer as described above.} \begin{example} \begin{codeblock} template struct X {}; @@ -7335,7 +7335,7 @@ constexpr int f() { const int n = std::is_constant_evaluated() ? 13 : 17; // \tcode{n} is 13 - int m = std::is_constant_evaluated() ? 13 : 17; // \tcode{m} might be 13 or 17 (see below) + int m = std::is_constant_evaluated() ? 13 : 17; // \tcode{m} can be 13 or 17 (see below) char arr[n] = {}; // char[13] return m + sizeof(arr); } @@ -7362,12 +7362,12 @@ \item an immediate subexpression of a \grammarterm{braced-init-list},% -\footnote{Constant evaluation might be necessary to determine whether a narrowing conversion is performed\iref{dcl.init.list}.} +\footnote{In some cases, constant evaluation is needed to determine whether a narrowing conversion is performed\iref{dcl.init.list}.} \item an expression of the form \tcode{\&} \grammarterm{cast-expression} that occurs within a templated entity,% -\footnote{Constant evaluation might be necessary to determine whether such an expression is value-dependent\iref{temp.dep.constexpr}.} +\footnote{In some cases, constant evaluation is needed to determine whether such an expression is value-dependent\iref{temp.dep.constexpr}.} or \item From a54c0da3bdee2f11e017320805480ddc45d72c41 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Thu, 12 Nov 2020 21:28:38 +0100 Subject: [PATCH 248/250] [lex] Replace 'could' and 'might' as directed by ISO/CS. --- source/lex.tex | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/source/lex.tex b/source/lex.tex index 3fba7f2bcd..b4dabcdc77 100644 --- a/source/lex.tex +++ b/source/lex.tex @@ -344,7 +344,7 @@ \begin{itemize} \item \indextext{literal!string!raw}% -If the next character begins a sequence of characters that could be the prefix +If the next character begins a sequence of characters that can be the prefix and initial double quote of a raw string literal, such as \tcode{R"}, the next preprocessing token shall be a raw string literal. Between the initial and final double quote characters of the raw string, any transformations performed in phases @@ -362,7 +362,7 @@ \item Otherwise, the next preprocessing token is the longest sequence of -characters that could constitute a preprocessing token, even if that +characters that matches the syntax of a preprocessing token, even if that would cause further lexical analysis to fail, except that a \grammarterm{header-name}\iref{lex.header} is only formed \begin{itemize} @@ -401,8 +401,8 @@ preprocessing number token (one that is not a valid \grammarterm{integer-literal} or \grammarterm{floating-point-literal} token), even though a parse as three preprocessing tokens -\tcode{0xe}, \tcode{+}, and \tcode{foo} might produce a valid expression (for example, -if \tcode{foo} were a macro defined as \tcode{1}). Similarly, the +\tcode{0xe}, \tcode{+}, and \tcode{foo} can produce a valid expression (for example, +if \tcode{foo} is a macro defined as \tcode{1}). Similarly, the program fragment \tcode{1E1} is parsed as a preprocessing number (one that is a valid \grammarterm{floating-point-literal} token), whether or not \tcode{E} is a macro name. @@ -413,7 +413,7 @@ The program fragment \tcode{x+++++y} is parsed as \tcode{x ++ ++ + y}, which, if \tcode{x} and \tcode{y} have integral types, violates a constraint on increment operators, even though the parse -\tcode{x ++ + ++ y} might yield a correct expression. +\tcode{x ++ + ++ y} can yield a correct expression. \end{example} \indextext{token!preprocessing|)} @@ -561,7 +561,7 @@ \tcode{/*}, or \tcode{//} in a \grammarterm{q-char-sequence} or an \grammarterm{h-char-sequence}} semantics, as is the appearance of the character \tcode{"} in an \grammarterm{h-char-sequence}.\footnote{Thus, a sequence of characters -that resembles an escape sequence might result in an error, be interpreted as the +that resembles an escape sequence can result in an error, be interpreted as the character corresponding to the escape sequence, or have a completely different meaning, depending on the implementation.}% \indextext{header!name|)} @@ -1893,7 +1893,7 @@ \end{example} The syntactic non-terminal preceding the \grammarterm{ud-suffix} in a \grammarterm{user-defined-literal} is taken to be the longest sequence of -characters that could match that non-terminal. +characters that matches the syntax of that non-terminal. \pnum A \grammarterm{user-defined-literal} is treated as a call to a literal operator or From 5a6127c12ebff4627b6fd9efc389f9b9a896b655 Mon Sep 17 00:00:00 2001 From: Jens Maurer Date: Wed, 11 Nov 2020 09:50:51 +0100 Subject: [PATCH 249/250] [re] Replace 'could' and 'might' as directed by ISO/CS. Also turn past tense used for error conditions into present tense. --- source/regex.tex | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/source/regex.tex b/source/regex.tex index d46025d846..dde21782d3 100644 --- a/source/regex.tex +++ b/source/regex.tex @@ -815,61 +815,61 @@ {re.err} \tcode{error_collate} & -The expression contained an invalid collating element name. \\ \rowsep +The expression contains an invalid collating element name. \\ \rowsep % \tcode{error_ctype} & -The expression contained an invalid character class name. \\ \rowsep +The expression contains an invalid character class name. \\ \rowsep % \tcode{error_escape} & -The expression contained an invalid escaped character, or a trailing +The expression contains an invalid escaped character, or a trailing escape. \\ \rowsep % \tcode{error_backref} & -The expression contained an invalid back reference. \\ \rowsep +The expression contains an invalid back reference. \\ \rowsep % \tcode{error_brack} & -The expression contained mismatched \verb|[| and \verb|]|. \\ \rowsep +The expression contains mismatched \verb|[| and \verb|]|. \\ \rowsep % \tcode{error_paren} & -The expression contained mismatched \verb|(| and \verb|)|. \\ \rowsep +The expression contains mismatched \verb|(| and \verb|)|. \\ \rowsep % \tcode{error_brace} & -The expression contained mismatched \verb|{| and \verb|}| \\ \rowsep +The expression contains mismatched \verb|{| and \verb|}| \\ \rowsep % \tcode{error_badbrace} & -The expression contained an invalid range in a \verb|{}| expression. \\ +The expression contains an invalid range in a \verb|{}| expression. \\ \rowsep % \tcode{error_range} & -The expression contained an invalid character range, such as +The expression contains an invalid character range, such as \verb|[b-a]| in most encodings. \\ \rowsep % \tcode{error_space} & -There was insufficient memory to convert the expression into a finite +There is insufficient memory to convert the expression into a finite state machine. \\ \rowsep % \tcode{error_badrepeat} & -One of \verb|*?+{| was not preceded by a valid regular expression. \\ \rowsep +One of \verb|*?+{| is not preceded by a valid regular expression. \\ \rowsep % \tcode{error_complexity} & The complexity of an attempted match against a regular expression -exceeded a pre-set level. \\ \rowsep +exceeds a pre-set level. \\ \rowsep % \tcode{error_stack} & -There was insufficient memory to determine whether the regular -expression could match the specified character sequence. \\ +There is insufficient memory to determine whether the regular +expression matches the specified character sequence. \\ % \end{longliberrtab} From e52247e809ff3a8341d79f9461ad7a24fcabee70 Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 13 Nov 2020 12:03:12 -0800 Subject: [PATCH 250/250] [res.on.data.races] Fix one more occurrence of "could". --- 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 546498a61d..1f074d611b 100644 --- a/source/lib-intro.tex +++ b/source/lib-intro.tex @@ -2907,7 +2907,7 @@ \pnum \begin{note} This means, for example, that implementations can't use an object with static storage duration for -internal purposes without synchronization because it could cause a data race even in +internal purposes without synchronization because doing so can cause a data race even in programs that do not explicitly share objects between threads. \end{note}