Skip to content

Commit e5455e3

Browse files
jensmaurerzygoloid
authored andcommitted
[std] Replace 'may' in notes.
Partially addresses ISO/CS 017 (C++20 DIS)
1 parent 64b5913 commit e5455e3

26 files changed

+170
-177
lines changed

source/algorithms.tex

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,8 @@
262262
The number and order of deducible template parameters for algorithm declarations
263263
are unspecified, except where explicitly stated otherwise.
264264
\begin{note}
265-
Consequently, the algorithms may not
266-
be called with explicitly-specified template argument lists.
265+
Consequently, an implementation can reject calls
266+
that specify an explicit template argument list.
267267
\end{note}
268268

269269
\rSec1[algorithms.parallel]{Parallel algorithms}
@@ -389,7 +389,7 @@
389389
where \tcode{is_trivially_copy_constructible_v<T>}
390390
and \tcode{is_trivially_destructible_v<T>} are \tcode{true}.
391391
\begin{note}
392-
This implies that user-supplied function objects should not rely on
392+
This implies that user-supplied function objects cannot rely on
393393
object identity of arguments for such input sequences.
394394
Users for whom the object identity of the arguments to these function objects
395395
is important should consider using a wrapping iterator
@@ -414,7 +414,7 @@
414414
unsequenced with respect to one another in the calling thread of execution.
415415
\begin{note}
416416
This means that multiple function object invocations
417-
may be interleaved on a single thread of execution,
417+
can be interleaved on a single thread of execution,
418418
which overrides the usual guarantee from \ref{intro.execution}
419419
that function executions do not overlap with one another.
420420
\end{note}
@@ -500,7 +500,7 @@
500500
or threads of execution implicitly created by the library;
501501
the latter will provide weakly parallel forward progress guarantees.
502502
\begin{note}
503-
This means that multiple function object invocations may be interleaved
503+
This means that multiple function object invocations can be interleaved
504504
on a single thread of execution,
505505
which overrides the usual guarantee from \ref{intro.execution}
506506
that function executions do not overlap with one another.
@@ -3153,7 +3153,7 @@
31533153
starting from \tcode{first} and proceeding to \tcode{last - 1}.
31543154
\begin{note}
31553155
If the type of \tcode{first} meets the requirements of a mutable iterator,
3156-
\tcode{f} may apply non-constant functions through the dereferenced iterator.
3156+
\tcode{f} can apply non-constant functions through the dereferenced iterator.
31573157
\end{note}
31583158

31593159
\pnum
@@ -3188,7 +3188,7 @@
31883188
every iterator in the range \range{first}{last}.
31893189
\begin{note}
31903190
If the type of \tcode{first} meets the requirements of a mutable iterator,
3191-
\tcode{f} may apply non-constant functions through the dereferenced iterator.
3191+
\tcode{f} can apply non-constant functions through the dereferenced iterator.
31923192
\end{note}
31933193

31943194
\pnum
@@ -3205,7 +3205,7 @@
32053205
\pnum
32063206
\begin{note}
32073207
Does not return a copy of its \tcode{Function} parameter,
3208-
since parallelization may not permit efficient state accumulation.
3208+
since parallelization often does not permit efficient state accumulation.
32093209
\end{note}
32103210
\end{itemdescr}
32113211

@@ -3229,7 +3229,7 @@
32293229
starting from \tcode{first} and proceeding to \tcode{last - 1}.
32303230
\begin{note}
32313231
If the result of \tcode{invoke(proj, *i)} is a mutable reference,
3232-
\tcode{f} may apply non-constant functions.
3232+
\tcode{f} can apply non-constant functions.
32333233
\end{note}
32343234

32353235
\pnum
@@ -3278,7 +3278,7 @@
32783278
every iterator in the range \range{first}{first + n} in order.
32793279
\begin{note}
32803280
If the type of \tcode{first} meets the requirements of a mutable iterator,
3281-
\tcode{f} may apply non-constant functions through the dereferenced iterator.
3281+
\tcode{f} can apply non-constant functions through the dereferenced iterator.
32823282
\end{note}
32833283

32843284
\pnum
@@ -3314,7 +3314,7 @@
33143314
every iterator in the range \range{first}{first + n}.
33153315
\begin{note}
33163316
If the type of \tcode{first} meets the requirements of a mutable iterator,
3317-
\tcode{f} may apply non-constant functions through the dereferenced iterator.
3317+
\tcode{f} can apply non-constant functions through the dereferenced iterator.
33183318
\end{note}
33193319

33203320
\pnum
@@ -3349,7 +3349,7 @@
33493349
\range{first}{first + n} in order.
33503350
\begin{note}
33513351
If the result of \tcode{invoke(proj, *i)} is a mutable reference,
3352-
\tcode{f} may apply non-constant functions.
3352+
\tcode{f} can apply non-constant functions.
33533353
\end{note}
33543354

33553355
\pnum
@@ -4389,7 +4389,7 @@
43894389
do not overlap.
43904390
\begin{note}
43914391
For the overload with an \tcode{ExecutionPolicy},
4392-
there may be a performance cost
4392+
there might be a performance cost
43934393
if \tcode{iterator_traits<For\-ward\-It\-er\-ator1>::value_type}
43944394
is not \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}).
43954395
\end{note}
@@ -5287,7 +5287,7 @@
52875287
do not overlap.
52885288
\begin{note}
52895289
For the overloads with an \tcode{ExecutionPolicy},
5290-
there may be a performance cost
5290+
there might be a performance cost
52915291
if \tcode{iterator_traits<ForwardIterator1>::value_type} does not meet
52925292
the \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}) requirements.
52935293
\end{note}
@@ -5474,7 +5474,7 @@
54745474
\oldconcept{CopyAssignable} requirements.
54755475
\begin{note}
54765476
For the overloads with an \tcode{ExecutionPolicy},
5477-
there may be a performance cost
5477+
there might be a performance cost
54785478
if the value type of \tcode{ForwardIterator1} does not meet both the
54795479
\oldconcept{CopyConstructible} and \oldconcept{CopyAssignable} requirements.
54805480
\end{note}
@@ -7009,7 +7009,7 @@
70097009

70107010
\begin{note}
70117011
For the overload with an \tcode{ExecutionPolicy},
7012-
there may be a performance cost if \tcode{first}'s value type
7012+
there might be a performance cost if \tcode{first}'s value type
70137013
does not meet the \oldconcept{CopyConstructible} requirements.
70147014
\end{note}
70157015

@@ -9527,7 +9527,7 @@
95279527
that \tcode{exclusive_scan} excludes the $i^\text{th}$ input element
95289528
from the $i^\text{th}$ sum.
95299529
If \tcode{binary_op} is not mathematically associative,
9530-
the behavior of \tcode{exclusive_scan} may be nondeterministic.
9530+
the behavior of \tcode{exclusive_scan} might be nondeterministic.
95319531
\end{note}
95329532
\end{itemdescr}
95339533

@@ -9654,7 +9654,7 @@
96549654
that \tcode{inclusive_scan} includes the $i^\text{th}$ input element
96559655
in the $i^\text{th}$ sum.
96569656
If \tcode{binary_op} is not mathematically associative,
9657-
the behavior of \tcode{inclusive_scan} may be nondeterministic.
9657+
the behavior of \tcode{inclusive_scan} might be nondeterministic.
96589658
\end{note}
96599659
\end{itemdescr}
96609660

@@ -9729,7 +9729,7 @@
97299729
\tcode{transform_inclusive_scan} is that \tcode{trans\-form\-_\-exclusive_scan}
97309730
excludes the $i^\text{th}$ input element from the $i^\text{th}$ sum.
97319731
If \tcode{binary_op} is not mathematically associative,
9732-
the behavior of \tcode{transform_exclusive_scan} may be nondeterministic.
9732+
the behavior of \tcode{transform_exclusive_scan} might be nondeterministic.
97339733
\tcode{transform_exclusive_scan}
97349734
does not apply \tcode{unary_op} to \tcode{init}.
97359735
\end{note}
@@ -9833,7 +9833,7 @@
98339833
\tcode{transform_inclusive_scan} is that \tcode{trans\-form\-_\-inclusive_scan}
98349834
includes the $i^\text{th}$ input element in the $i^\text{th}$ sum.
98359835
If \tcode{binary_op} is not mathematically associative,
9836-
the behavior of \tcode{transform_inclusive_scan} may be nondeterministic.
9836+
the behavior of \tcode{transform_inclusive_scan} might be nondeterministic.
98379837
\tcode{transform_inclusive_scan} does not
98389838
apply \tcode{unary_op} to \tcode{init}.
98399839
\end{note}

source/atomics.tex

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@
528528
r2 = x.load(memory_order::relaxed);
529529
y.store(r2, memory_order::relaxed);
530530
\end{codeblock}
531-
should not produce \tcode{r1 == r2 == 42}, since the store of 42 to \tcode{y} is only
531+
this recommendation discourages producing \tcode{r1 == r2 == 42}, since the store of 42 to \tcode{y} is only
532532
possible if the store to \tcode{x} stores \tcode{42}, which circularly depends on the
533533
store to \tcode{y} storing \tcode{42}. Note that without this restriction, such an
534534
execution is possible.
@@ -636,8 +636,9 @@
636636
block\iref{intro.progress}.
637637

638638
\pnum
639+
Operations that are lock-free should also be address-free.
639640
\begin{note}
640-
Operations that are lock-free should also be address-free. That is,
641+
That is,
641642
atomic operations on the same memory location via two different addresses will
642643
communicate atomically. The implementation should not depend on any
643644
per-process state. This restriction enables communication by memory that is
@@ -1603,7 +1604,7 @@
16031604
is \tcode{false}.
16041605
\begin{note}
16051606
Type arguments that are
1606-
not also statically initializable may be difficult to use.
1607+
not also statically initializable might be difficult to use.
16071608
\end{note}
16081609

16091610
\pnum
@@ -3443,10 +3444,7 @@
34433444

34443445
\pnum
34453446
Operations on an object of type \tcode{atomic_flag} shall be lock-free.
3446-
\begin{note}
3447-
Hence
3448-
the operations should also be address-free.
3449-
\end{note}
3447+
The operations should also be address-free.
34503448

34513449
\pnum
34523450
The \tcode{atomic_flag} type is a standard-layout struct.

source/basic.tex

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -692,10 +692,10 @@
692692
The entity is still declared in multiple translation units, and \ref{basic.link}
693693
still applies to these declarations. In particular,
694694
\grammarterm{lambda-expression}{s}\iref{expr.prim.lambda}
695-
appearing in the type of \tcode{D} may result
695+
appearing in the type of \tcode{D} might result
696696
in the different declarations having distinct types, and
697697
\grammarterm{lambda-expression}{s} appearing in a default argument of \tcode{D}
698-
may still denote different types in different translation units.
698+
might still denote different types in different translation units.
699699
\end{note}
700700

701701
\pnum
@@ -822,9 +822,9 @@
822822
a name is introduced, which is not necessarily the same as the region in
823823
which the declaration occurs. In particular,
824824
\grammarterm{elaborated-type-specifier}{s}\iref{dcl.type.elab} and
825-
friend declarations\iref{class.friend} may introduce a (possibly not
825+
friend declarations\iref{class.friend} can introduce a (possibly not
826826
visible) name into an enclosing namespace; these restrictions apply to
827-
that region. Local extern declarations\iref{basic.link} may introduce
827+
that region. Local extern declarations\iref{basic.link} can introduce
828828
a name into the declarative region where the declaration appears and
829829
also introduce a (possibly not visible) name into an enclosing
830830
namespace; these restrictions apply to both regions.
@@ -2834,7 +2834,7 @@
28342834
\grammarterm{using-directive}{s}
28352835
do not declare entities.
28362836
Enumerators do not have linkage,
2837-
but may serve as the name of an enumeration with linkage\iref{dcl.enum}.
2837+
but might serve as the name of an enumeration with linkage\iref{dcl.enum}.
28382838
\end{note}
28392839

28402840
\pnum
@@ -4538,7 +4538,7 @@
45384538

45394539
\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}.
45404540
\begin{note}
4541-
This may introduce a dangling reference.
4541+
This might introduce a dangling reference.
45424542
\end{note}
45434543
\begin{example}
45444544
\begin{codeblock}
@@ -5809,7 +5809,7 @@
58095809
initial value of the object, a value assigned to the object by $T$, or a
58105810
value assigned to the object by another thread, according to the rules below.
58115811
\begin{note}
5812-
In some cases, there may instead be undefined behavior. Much of this
5812+
In some cases, there might instead be undefined behavior. Much of this
58135813
subclause is motivated by the desire to support atomic operations with explicit
58145814
and detailed visibility constraints. However, it also implicitly supports a
58155815
simpler view for more restricted programs.
@@ -5852,7 +5852,7 @@
58525852
There is a separate order for each
58535853
atomic object. There is no requirement that these can be combined into a single
58545854
total order for all objects. In general this will be impossible since different
5855-
threads may observe modifications to different objects in inconsistent orders.
5855+
threads might observe modifications to different objects in inconsistent orders.
58565856
\end{note}
58575857

58585858
\pnum
@@ -6181,14 +6181,14 @@
61816181
execution would not have encountered a data race. This includes implementations
61826182
of data member assignment that overwrite adjacent members in separate memory
61836183
locations. Reordering of atomic loads in cases in which the atomics in question
6184-
may alias is also generally precluded, since this may violate the coherence
6184+
might alias is also generally precluded, since this could violate the coherence
61856185
rules.
61866186
\end{note}
61876187

61886188
\pnum
61896189
\begin{note}
61906190
Transformations that introduce a speculative read of a potentially
6191-
shared memory location may not preserve the semantics of the \Cpp{} program as
6191+
shared memory location might not preserve the semantics of the \Cpp{} program as
61926192
defined in this document, since they potentially introduce a data race. However,
61936193
they are typically valid in the context of an optimizing compiler that targets a
61946194
specific machine with well-defined semantics for data races. They would be
@@ -6224,7 +6224,7 @@
62246224
a lock-free execution in that thread shall complete.
62256225
\begin{note}
62266226
Concurrently executing threads
6227-
may prevent progress of a lock-free execution.
6227+
might prevent progress of a lock-free execution.
62286228
For example,
62296229
this situation can occur
62306230
with load-locked store-conditional implementations.
@@ -6238,7 +6238,7 @@
62386238
to provide absolute guarantees to this effect,
62396239
since repeated and particularly inopportune interference
62406240
from other threads
6241-
may prevent forward progress,
6241+
could prevent forward progress,
62426242
e.g.,
62436243
by repeatedly stealing a cache line
62446244
for unrelated purposes
@@ -6306,9 +6306,7 @@
63066306
\tcode{std::thread}\iref{thread.thread.class}
63076307
or \tcode{std::jthread}\iref{thread.jthread.class}
63086308
provide concurrent forward progress guarantees.
6309-
\begin{note}
63106309
General-purpose implementations should provide these guarantees.
6311-
\end{note}
63126310

63136311
\pnum
63146312
\indextext{forward progress guarantees!parallel}%
@@ -6346,7 +6344,7 @@
63466344
guarantees, which in turn are stronger than weakly parallel forward progress
63476345
guarantees.
63486346
\begin{note}
6349-
For example, some kinds of synchronization between threads of execution may only
6347+
For example, some kinds of synchronization between threads of execution might only
63506348
make progress if the respective threads of execution provide parallel forward progress
63516349
guarantees, but will fail to make progress under weakly parallel guarantees.
63526350
\end{note}
@@ -6377,7 +6375,7 @@
63776375
stronger forward progress guarantee for a certain amount of time, due to a
63786376
second thread of execution $A$ being blocked on it with forward
63796377
progress guarantee delegation. In turn, if $B$ then blocks with
6380-
forward progress guarantee delegation on $C$, this may also temporarily
6378+
forward progress guarantee delegation on $C$, this could also temporarily
63816379
provide a stronger forward progress guarantee to $C$.
63826380
\end{note}
63836381

@@ -6565,10 +6563,10 @@
65656563
inline double fd() { return 1.0; }
65666564
extern double d1;
65676565
double d2 = d1; // unspecified:
6568-
// may be statically initialized to \tcode{0.0} or
6566+
// either statically initialized to \tcode{0.0} or
65696567
// dynamically initialized to \tcode{0.0} if \tcode{d1} is
65706568
// dynamically initialized, or \tcode{1.0} otherwise
6571-
double d1 = fd(); // may be initialized statically or dynamically to \tcode{1.0}
6569+
double d1 = fd(); // either initialized statically or dynamically to \tcode{1.0}
65726570
\end{codeblock}
65736571
\end{note}
65746572

0 commit comments

Comments
 (0)