Skip to content

Commit 73f024b

Browse files
committed
[std] Replace 'may' in notes.
Partialy addresses ISO/CS 017 (C++20 DIS)
1 parent d9b832b commit 73f024b

26 files changed

+170
-177
lines changed

source/algorithms.tex

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

268268
\rSec1[algorithms.parallel]{Parallel algorithms}
@@ -388,7 +388,7 @@
388388
where \tcode{is_trivially_copy_constructible_v<T>}
389389
and \tcode{is_trivially_destructible_v<T>} are \tcode{true}.
390390
\begin{note}
391-
This implies that user-supplied function objects should not rely on
391+
This implies that user-supplied function objects cannot rely on
392392
object identity of arguments for such input sequences.
393393
Users for whom the object identity of the arguments to these function objects
394394
is important should consider using a wrapping iterator
@@ -413,7 +413,7 @@
413413
unsequenced with respect to one another in the calling thread of execution.
414414
\begin{note}
415415
This means that multiple function object invocations
416-
may be interleaved on a single thread of execution,
416+
can be interleaved on a single thread of execution,
417417
which overrides the usual guarantee from \ref{intro.execution}
418418
that function executions do not overlap with one another.
419419
\end{note}
@@ -499,7 +499,7 @@
499499
or threads of execution implicitly created by the library;
500500
the latter will provide weakly parallel forward progress guarantees.
501501
\begin{note}
502-
This means that multiple function object invocations may be interleaved
502+
This means that multiple function object invocations can be interleaved
503503
on a single thread of execution,
504504
which overrides the usual guarantee from \ref{intro.execution}
505505
that function executions do not overlap with one another.
@@ -3152,7 +3152,7 @@
31523152
starting from \tcode{first} and proceeding to \tcode{last - 1}.
31533153
\begin{note}
31543154
If the type of \tcode{first} meets the requirements of a mutable iterator,
3155-
\tcode{f} may apply non-constant functions through the dereferenced iterator.
3155+
\tcode{f} can apply non-constant functions through the dereferenced iterator.
31563156
\end{note}
31573157

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

31933193
\pnum
@@ -3204,7 +3204,7 @@
32043204
\pnum
32053205
\begin{note}
32063206
Does not return a copy of its \tcode{Function} parameter,
3207-
since parallelization may not permit efficient state accumulation.
3207+
since parallelization often does not permit efficient state accumulation.
32083208
\end{note}
32093209
\end{itemdescr}
32103210

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

32343234
\pnum
@@ -3280,7 +3280,7 @@
32803280
every iterator in the range \range{first}{first + n} in order.
32813281
\begin{note}
32823282
If the type of \tcode{first} meets the requirements of a mutable iterator,
3283-
\tcode{f} may apply non-constant functions through the dereferenced iterator.
3283+
\tcode{f} can apply non-constant functions through the dereferenced iterator.
32843284
\end{note}
32853285

32863286
\pnum
@@ -3319,7 +3319,7 @@
33193319
every iterator in the range \range{first}{first + n}.
33203320
\begin{note}
33213321
If the type of \tcode{first} meets the requirements of a mutable iterator,
3322-
\tcode{f} may apply non-constant functions through the dereferenced iterator.
3322+
\tcode{f} can apply non-constant functions through the dereferenced iterator.
33233323
\end{note}
33243324

33253325
\pnum
@@ -3354,7 +3354,7 @@
33543354
\range{first}{first + n} in order.
33553355
\begin{note}
33563356
If the result of \tcode{invoke(proj, *i)} is a mutable reference,
3357-
\tcode{f} may apply non-constant functions.
3357+
\tcode{f} can apply non-constant functions.
33583358
\end{note}
33593359

33603360
\pnum
@@ -4398,7 +4398,7 @@
43984398
do not overlap.
43994399
\begin{note}
44004400
For the overload with an \tcode{ExecutionPolicy},
4401-
there may be a performance cost
4401+
there might be a performance cost
44024402
if \tcode{iterator_traits<For\-ward\-It\-er\-ator1>::value_type}
44034403
is not \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}).
44044404
\end{note}
@@ -5296,7 +5296,7 @@
52965296
do not overlap.
52975297
\begin{note}
52985298
For the overloads with an \tcode{ExecutionPolicy},
5299-
there may be a performance cost
5299+
there might be a performance cost
53005300
if \tcode{iterator_traits<ForwardIterator1>::value_type} does not meet
53015301
the \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}) requirements.
53025302
\end{note}
@@ -5483,7 +5483,7 @@
54835483
\oldconcept{CopyAssignable} requirements.
54845484
\begin{note}
54855485
For the overloads with an \tcode{ExecutionPolicy},
5486-
there may be a performance cost
5486+
there might be a performance cost
54875487
if the value type of \tcode{ForwardIterator1} does not meet both the
54885488
\oldconcept{CopyConstructible} and \oldconcept{CopyAssignable} requirements.
54895489
\end{note}
@@ -7019,7 +7019,7 @@
70197019

70207020
\begin{note}
70217021
For the overload with an \tcode{ExecutionPolicy},
7022-
there may be a performance cost if \tcode{first}'s value type
7022+
there might be a performance cost if \tcode{first}'s value type
70237023
does not meet the \oldconcept{CopyConstructible} requirements.
70247024
\end{note}
70257025

@@ -9537,7 +9537,7 @@
95379537
that \tcode{exclusive_scan} excludes the $i^\text{th}$ input element
95389538
from the $i^\text{th}$ sum.
95399539
If \tcode{binary_op} is not mathematically associative,
9540-
the behavior of \tcode{exclusive_scan} may be nondeterministic.
9540+
the behavior of \tcode{exclusive_scan} might be nondeterministic.
95419541
\end{note}
95429542
\end{itemdescr}
95439543

@@ -9664,7 +9664,7 @@
96649664
that \tcode{inclusive_scan} includes the $i^\text{th}$ input element
96659665
in the $i^\text{th}$ sum.
96669666
If \tcode{binary_op} is not mathematically associative,
9667-
the behavior of \tcode{inclusive_scan} may be nondeterministic.
9667+
the behavior of \tcode{inclusive_scan} might be nondeterministic.
96689668
\end{note}
96699669
\end{itemdescr}
96709670

@@ -9739,7 +9739,7 @@
97399739
\tcode{transform_inclusive_scan} is that \tcode{trans\-form\-_\-exclusive_scan}
97409740
excludes the $i^\text{th}$ input element from the $i^\text{th}$ sum.
97419741
If \tcode{binary_op} is not mathematically associative,
9742-
the behavior of \tcode{transform_exclusive_scan} may be nondeterministic.
9742+
the behavior of \tcode{transform_exclusive_scan} might be nondeterministic.
97439743
\tcode{transform_exclusive_scan}
97449744
does not apply \tcode{unary_op} to \tcode{init}.
97459745
\end{note}
@@ -9843,7 +9843,7 @@
98439843
\tcode{transform_inclusive_scan} is that \tcode{trans\-form\-_\-inclusive_scan}
98449844
includes the $i^\text{th}$ input element in the $i^\text{th}$ sum.
98459845
If \tcode{binary_op} is not mathematically associative,
9846-
the behavior of \tcode{transform_inclusive_scan} may be nondeterministic.
9846+
the behavior of \tcode{transform_inclusive_scan} might be nondeterministic.
98479847
\tcode{transform_inclusive_scan} does not
98489848
apply \tcode{unary_op} to \tcode{init}.
98499849
\end{note}

source/atomics.tex

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -527,7 +527,7 @@
527527
r2 = x.load(memory_order::relaxed);
528528
y.store(r2, memory_order::relaxed);
529529
\end{codeblock}
530-
should not produce \tcode{r1 == r2 == 42}, since the store of 42 to \tcode{y} is only
530+
it is not desirable to produce \tcode{r1 == r2 == 42}, since the store of 42 to \tcode{y} is only
531531
possible if the store to \tcode{x} stores \tcode{42}, which circularly depends on the
532532
store to \tcode{y} storing \tcode{42}. Note that without this restriction, such an
533533
execution is possible.
@@ -634,8 +634,9 @@
634634
block\iref{intro.progress}.
635635

636636
\pnum
637+
Operations that are lock-free should also be address-free.
637638
\begin{note}
638-
Operations that are lock-free should also be address-free. That is,
639+
That is,
639640
atomic operations on the same memory location via two different addresses will
640641
communicate atomically. The implementation should not depend on any
641642
per-process state. This restriction enables communication by memory that is
@@ -1600,7 +1601,7 @@
16001601
is \tcode{false}.
16011602
\begin{note}
16021603
Type arguments that are
1603-
not also statically initializable may be difficult to use.
1604+
not also statically initializable might be difficult to use.
16041605
\end{note}
16051606

16061607
\pnum
@@ -3440,10 +3441,7 @@
34403441

34413442
\pnum
34423443
Operations on an object of type \tcode{atomic_flag} shall be lock-free.
3443-
\begin{note}
3444-
Hence
3445-
the operations should also be address-free.
3446-
\end{note}
3444+
The operations should also be address-free.
34473445

34483446
\pnum
34493447
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} might 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}
@@ -5808,7 +5808,7 @@
58085808
initial value of the object, a value assigned to the object by $T$, or a
58095809
value assigned to the object by another thread, according to the rules below.
58105810
\begin{note}
5811-
In some cases, there may instead be undefined behavior. Much of this
5811+
In some cases, there might instead be undefined behavior. Much of this
58125812
subclause is motivated by the desire to support atomic operations with explicit
58135813
and detailed visibility constraints. However, it also implicitly supports a
58145814
simpler view for more restricted programs.
@@ -5851,7 +5851,7 @@
58515851
There is a separate order for each
58525852
atomic object. There is no requirement that these can be combined into a single
58535853
total order for all objects. In general this will be impossible since different
5854-
threads may observe modifications to different objects in inconsistent orders.
5854+
threads might observe modifications to different objects in inconsistent orders.
58555855
\end{note}
58565856

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

61876187
\pnum
61886188
\begin{note}
61896189
Transformations that introduce a speculative read of a potentially
6190-
shared memory location may not preserve the semantics of the \Cpp{} program as
6190+
shared memory location might not preserve the semantics of the \Cpp{} program as
61916191
defined in this document, since they potentially introduce a data race. However,
61926192
they are typically valid in the context of an optimizing compiler that targets a
61936193
specific machine with well-defined semantics for data races. They would be
@@ -6223,7 +6223,7 @@
62236223
a lock-free execution in that thread shall complete.
62246224
\begin{note}
62256225
Concurrently executing threads
6226-
may prevent progress of a lock-free execution.
6226+
might prevent progress of a lock-free execution.
62276227
For example,
62286228
this situation can occur
62296229
with load-locked store-conditional implementations.
@@ -6237,7 +6237,7 @@
62376237
to provide absolute guarantees to this effect,
62386238
since repeated and particularly inopportune interference
62396239
from other threads
6240-
may prevent forward progress,
6240+
could prevent forward progress,
62416241
e.g.,
62426242
by repeatedly stealing a cache line
62436243
for unrelated purposes
@@ -6305,9 +6305,7 @@
63056305
\tcode{std::thread}\iref{thread.thread.class}
63066306
or \tcode{std::jthread}\iref{thread.jthread.class}
63076307
provide concurrent forward progress guarantees.
6308-
\begin{note}
63096308
General-purpose implementations should provide these guarantees.
6310-
\end{note}
63116309

63126310
\pnum
63136311
\indextext{forward progress guarantees!parallel}%
@@ -6345,7 +6343,7 @@
63456343
guarantees, which in turn are stronger than weakly parallel forward progress
63466344
guarantees.
63476345
\begin{note}
6348-
For example, some kinds of synchronization between threads of execution may only
6346+
For example, some kinds of synchronization between threads of execution might only
63496347
make progress if the respective threads of execution provide parallel forward progress
63506348
guarantees, but will fail to make progress under weakly parallel guarantees.
63516349
\end{note}
@@ -6376,7 +6374,7 @@
63766374
stronger forward progress guarantee for a certain amount of time, due to a
63776375
second thread of execution $A$ being blocked on it with forward
63786376
progress guarantee delegation. In turn, if $B$ then blocks with
6379-
forward progress guarantee delegation on $C$, this may also temporarily
6377+
forward progress guarantee delegation on $C$, this could also temporarily
63806378
provide a stronger forward progress guarantee to $C$.
63816379
\end{note}
63826380

@@ -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+
// might be 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)