Skip to content

Commit 225cc43

Browse files
Quuxplusonezygoloid
authored andcommitted
[lib] Replace "shall not X" with "does not X" when it describes library behavior.
In these places we aren't saying "it's UB if X happens"; we're literally specifying the behavior of a library function as "X does not happen, we promise." Jonathan Wakely points out that there is still room for the user to cause UB by specializing `pair`, `duration`, `function`, etc. such that their specializations do X. In that case, the UB happens due to [namespace.std] p2, which requires that "the [program-defined] specialization meets the standard library requirements for the original template."
1 parent 02e4183 commit 225cc43

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

source/time.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,7 @@
12541254
If \tcode{Period::num} is not positive, the program is ill-formed.
12551255

12561256
\pnum
1257-
Members of \tcode{duration} shall not throw exceptions other than
1257+
Members of \tcode{duration} do not throw exceptions other than
12581258
those thrown by the indicated operations on their representations.
12591259

12601260
\pnum

source/utilities.tex

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -512,13 +512,13 @@
512512
\end{codeblock}
513513

514514
\pnum
515-
Constructors and member functions of \tcode{pair} shall not throw exceptions unless one of
515+
Constructors and member functions of \tcode{pair} do not throw exceptions unless one of
516516
the element-wise operations specified to be called for that operation
517517
throws an exception.
518518

519519
\pnum
520-
The defaulted move and copy constructor, respectively, of \tcode{pair} shall
521-
be a constexpr function if and only if all required element-wise
520+
The defaulted move and copy constructor, respectively, of \tcode{pair}
521+
is a constexpr function if and only if all required element-wise
522522
initializations for copy and move, respectively, would satisfy the
523523
requirements for a constexpr function.
524524

@@ -1156,10 +1156,10 @@
11561156

11571157
\pnum
11581158
The defaulted move and copy constructor, respectively, of
1159-
\tcode{tuple} shall be a constexpr function if and only if all
1159+
\tcode{tuple} is a constexpr function if and only if all
11601160
required element-wise initializations for copy and move, respectively,
11611161
would satisfy the requirements for a constexpr function. The
1162-
defaulted move and copy constructor of \tcode{tuple<>} shall be
1162+
defaulted move and copy constructor of \tcode{tuple<>} are
11631163
constexpr functions.
11641164

11651165
\pnum
@@ -15511,7 +15511,7 @@
1551115511

1551215512
\pnum
1551315513
\throws
15514-
Shall not throw exceptions if \tcode{f}'s target is
15514+
Nothing if \tcode{f}'s target is
1551515515
a specialization of \tcode{reference_wrapper} or
1551615516
a function pointer. Otherwise, may throw \tcode{bad_alloc}
1551715517
or any exception thrown by the copy constructor of the stored callable object.
@@ -15582,10 +15582,10 @@
1558215582

1558315583
\pnum
1558415584
\throws
15585-
Shall not throw exceptions when \tcode{f} is a function pointer
15586-
or a \tcode{reference_wrapper<T>} for some \tcode{T}. Otherwise,
15587-
may throw \tcode{bad_alloc} or any exception thrown by \tcode{F}'s copy
15588-
or move constructor.
15585+
Nothing if \tcode{f} is
15586+
a specialization of \tcode{reference_wrapper} or
15587+
a function pointer. Otherwise, may throw \tcode{bad_alloc}
15588+
or any exception thrown by \tcode{F}'s copy or move constructor.
1558915589
\end{itemdescr}
1559015590

1559115591

0 commit comments

Comments
 (0)