Skip to content

Commit 2e70d07

Browse files
jensmaurertkoeppe
authored andcommitted
[std] Replace 'might' with 'can' in notes and examples
Fixes ISO/CS comment (C++23 proof)
1 parent 2b0ff8d commit 2e70d07

21 files changed

+93
-92
lines changed

source/algorithms.tex

+4-4
Original file line numberDiff line numberDiff line change
@@ -5020,7 +5020,7 @@
50205020
do not overlap.
50215021
\begin{note}
50225022
For the overload with an \tcode{ExecutionPolicy},
5023-
there might be a performance cost
5023+
there can be a performance cost
50245024
if \tcode{iterator_traits<For\-ward\-It\-er\-ator1>::value_type}
50255025
is not \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}).
50265026
\end{note}
@@ -5943,7 +5943,7 @@
59435943
do not overlap.
59445944
\begin{note}
59455945
For the overloads with an \tcode{ExecutionPolicy},
5946-
there might be a performance cost
5946+
there can be a performance cost
59475947
if \tcode{iterator_traits<ForwardIterator1>::value_type} does not meet
59485948
the \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}) requirements.
59495949
\end{note}
@@ -6130,7 +6130,7 @@
61306130
\oldconcept{CopyAssignable} requirements.
61316131
\begin{note}
61326132
For the overloads with an \tcode{ExecutionPolicy},
6133-
there might be a performance cost
6133+
there can be a performance cost
61346134
if the value type of \tcode{ForwardIterator1} does not meet both the
61356135
\oldconcept{CopyConstructible} and \oldconcept{CopyAssignable} requirements.
61366136
\end{note}
@@ -7717,7 +7717,7 @@
77177717

77187718
\begin{note}
77197719
For the overload with an \tcode{ExecutionPolicy},
7720-
there might be a performance cost if \tcode{first}'s value type
7720+
there can be a performance cost if \tcode{first}'s value type
77217721
does not meet the \oldconcept{CopyConstructible} requirements.
77227722
\end{note}
77237723

source/basic.tex

+15-15
Original file line numberDiff line numberDiff line change
@@ -790,7 +790,7 @@
790790
appearing in the type of \tcode{D} can result
791791
in the different declarations having distinct types, and
792792
\grammarterm{lambda-expression}{s} appearing in a default argument of \tcode{D}
793-
might still denote different types in different translation units.
793+
can still denote different types in different translation units.
794794
\end{note}
795795

796796
\pnum
@@ -1512,7 +1512,7 @@
15121512
any declaration in the same translation unit
15131513
whose locus\iref{basic.scope.pdecl} is before $P$.
15141514
\begin{note}
1515-
The declaration might appear in a scope that does not contain $P$.
1515+
The declaration can appear in a scope that does not contain $P$.
15161516
\end{note}
15171517
\indextext{precede|see{declaration, precede}}%
15181518
A declaration $X$ \defnx{precedes}{declaration!precede}
@@ -1795,7 +1795,7 @@
17951795
\pnum
17961796
\begin{note}
17971797
Even if the result of name lookup is unambiguous, use of a name found in
1798-
multiple subobjects might still be
1798+
multiple subobjects can still be
17991799
ambiguous\iref{conv.mem,expr.ref,class.access.base}.
18001800
\end{note}
18011801
\begin{example}
@@ -3111,7 +3111,7 @@
31113111
or a maximal sequence of adjacent bit-fields all having nonzero width.
31123112
\begin{note}
31133113
Various
3114-
features of the language, such as references and virtual functions, might
3114+
features of the language, such as references and virtual functions, can
31153115
involve additional memory locations that are not accessible to programs but are
31163116
managed by the implementation.
31173117
\end{note}
@@ -4270,7 +4270,7 @@
42704270
When \tcode{D} is the type of a complete object, it will have a subobject of
42714271
type \tcode{B}, so it must be aligned appropriately for a \tcode{\keyword{long} \keyword{double}}.
42724272
If \tcode{D} appears as a subobject of another object that also has \tcode{B}
4273-
as a virtual base class, the \tcode{B} subobject might be part of a different
4273+
as a virtual base class, the \tcode{B} subobject can be part of a different
42744274
subobject, reducing the alignment requirements on the \tcode{D} subobject.
42754275
\end{example}
42764276
The result of the \keyword{alignof} operator reflects the alignment
@@ -4583,7 +4583,7 @@
45834583

45844584
\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}.
45854585
\begin{note}
4586-
This might introduce a dangling reference.
4586+
This can introduce a dangling reference.
45874587
\end{note}
45884588
\begin{example}
45894589
\begin{codeblock}
@@ -4752,7 +4752,7 @@
47524752
constexpr std::size_t N = sizeof(T);
47534753
char buf[N];
47544754
T obj; // \tcode{obj} initialized to its original value
4755-
std::memcpy(buf, &obj, N); // between these two calls to \tcode{std::memcpy}, \tcode{obj} might be modified
4755+
std::memcpy(buf, &obj, N); // between these two calls to \tcode{std::memcpy}, \tcode{obj} can be modified
47564756
std::memcpy(&obj, buf, N); // at this point, each subobject of \tcode{obj} of scalar type holds its original value
47574757
\end{codeblock}
47584758
\end{example}
@@ -4953,7 +4953,7 @@
49534953
\end{itemize}
49544954
\begin{note}
49554955
A literal type is one for which
4956-
it might be possible to create an object
4956+
it is possible to create an object
49574957
within a constant expression.
49584958
It is not a guarantee that it is possible to create such an object,
49594959
nor is it a guarantee that any object of that type
@@ -5508,7 +5508,7 @@
55085508
an invocation of a deallocation function\iref{basic.stc.dynamic.deallocation},
55095509
and \impldef{invalid pointer value in the context of an evaluation} otherwise.
55105510
\begin{footnote}
5511-
Some implementations might define that
5511+
Some implementations can define that
55125512
copying such a pointer value causes a system-generated runtime fault.
55135513
\end{footnote}
55145514
\begin{note}
@@ -6133,7 +6133,7 @@
61336133
initial value of the object, a value assigned to the object by $T$, or a
61346134
value assigned to the object by another thread, according to the rules below.
61356135
\begin{note}
6136-
In some cases, there might instead be undefined behavior. Much of this
6136+
In some cases, there can instead be undefined behavior. Much of this
61376137
subclause is motivated by the desire to support atomic operations with explicit
61386138
and detailed visibility constraints. However, it also implicitly supports a
61396139
simpler view for more restricted programs.
@@ -6500,19 +6500,19 @@
65006500
\begin{note}
65016501
Compiler transformations that introduce assignments to a potentially
65026502
shared memory location that would not be modified by the abstract machine are
6503-
generally precluded by this document, since such an assignment might overwrite
6503+
generally precluded by this document, since such an assignment can overwrite
65046504
another assignment by a different thread in cases in which an abstract machine
65056505
execution would not have encountered a data race. This includes implementations
65066506
of data member assignment that overwrite adjacent members in separate memory
65076507
locations. Reordering of atomic loads in cases in which the atomics in question
6508-
might alias is also generally precluded, since this could violate the coherence
6508+
can alias is also generally precluded, since this could violate the coherence
65096509
rules.
65106510
\end{note}
65116511

65126512
\pnum
65136513
\begin{note}
65146514
Transformations that introduce a speculative read of a potentially
6515-
shared memory location might not preserve the semantics of the \Cpp{} program as
6515+
shared memory location can not preserve the semantics of the \Cpp{} program as
65166516
defined in this document, since they potentially introduce a data race. However,
65176517
they are typically valid in the context of an optimizing compiler that targets a
65186518
specific machine with well-defined semantics for data races. They would be
@@ -6553,7 +6553,7 @@
65536553
a lock-free execution in that thread shall complete.
65546554
\begin{note}
65556555
Concurrently executing threads
6556-
might prevent progress of a lock-free execution.
6556+
can prevent progress of a lock-free execution.
65576557
For example,
65586558
this situation can occur
65596559
with load-locked store-conditional implementations.
@@ -6673,7 +6673,7 @@
66736673
guarantees, which in turn are stronger than weakly parallel forward progress
66746674
guarantees.
66756675
\begin{note}
6676-
For example, some kinds of synchronization between threads of execution might only
6676+
For example, some kinds of synchronization between threads of execution can only
66776677
make progress if the respective threads of execution provide parallel forward progress
66786678
guarantees, but will fail to make progress under weakly parallel guarantees.
66796679
\end{note}

source/classes.tex

+7-7
Original file line numberDiff line numberDiff line change
@@ -1299,7 +1299,7 @@
12991299
\begin{note}
13001300
An implicitly-declared default constructor has an
13011301
exception specification\iref{except.spec}.
1302-
An explicitly-defaulted definition might have an
1302+
An explicitly-defaulted definition can have an
13031303
implicit exception specification, see~\ref{dcl.fct.def}.
13041304
\end{note}
13051305

@@ -1502,7 +1502,7 @@
15021502

15031503
\begin{note}
15041504
When the move constructor is not implicitly declared or explicitly supplied,
1505-
expressions that otherwise would have invoked the move constructor might instead invoke
1505+
expressions that otherwise would have invoked the move constructor can instead invoke
15061506
a copy constructor.
15071507
\end{note}
15081508

@@ -2111,7 +2111,7 @@
21112111
\begin{note}
21122112
A
21132113
\tcode{return}
2114-
statement\iref{stmt.return} in a destructor might not directly return to the
2114+
statement\iref{stmt.return} in a destructor can not directly return to the
21152115
caller; before transferring control to the caller, the destructors for the
21162116
members and bases are called.
21172117
\end{note}
@@ -4053,7 +4053,7 @@
40534053
\grammarterm{pure-specifier}\iref{class.mem} in the function declaration
40544054
in the class definition.
40554055
\begin{note}
4056-
Such a function might be inherited: see below.
4056+
Such a function can be inherited: see below.
40574057
\end{note}
40584058
A class is an \defnadj{abstract}{class}
40594059
if it has at least one pure virtual function.
@@ -4423,7 +4423,7 @@
44234423
\begin{note}
44244424
In a derived class, the lookup of a base class name will find the
44254425
injected-class-name instead of the name of the base class in the scope
4426-
in which it was declared. The injected-class-name might be less accessible
4426+
in which it was declared. The injected-class-name can be less accessible
44274427
than the name of the base class in the scope in which it was declared.
44284428
\end{note}
44294429

@@ -6033,7 +6033,7 @@
60336033
struct X { X(A*); };
60346034

60356035
struct E : C, D, X {
6036-
E() : D(this), // undefined behavior: upcast from \tcode{E*} to \tcode{A*} might use path \tcode{E*} $\rightarrow$ \tcode{D*} $\rightarrow$ \tcode{A*}
6036+
E() : D(this), // undefined behavior: upcast from \tcode{E*} to \tcode{A*} can use path \tcode{E*} $\rightarrow$ \tcode{D*} $\rightarrow$ \tcode{A*}
60376037
// but \tcode{D} is not constructed
60386038

60396039
// ``\tcode{D((C*)this)}\!'' would be defined: \tcode{E*} $\rightarrow$ \tcode{C*} is defined because \tcode{E()} has started,
@@ -6705,7 +6705,7 @@
67056705
the expression resulting from the interpretation of \tcode{x @ y}
67066706
using the selected rewritten candidate\iref{over.match.oper}
67076707
does not result in a usable candidate
6708-
(for example, that expression might be \tcode{(x <=> y) @ 0}), or
6708+
(for example, that expression can be \tcode{(x <=> y) @ 0}), or
67096709

67106710
\item
67116711
\tcode{x @ y} cannot be implicitly converted to \tcode{bool}.

source/compatibility.tex

+5-5
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@
591591
Correct contradictory wording and
592592
improve implementation flexibility for performance.
593593
\effect
594-
Valid \CppXX{} code using a barrier might have
594+
Valid \CppXX{} code using a barrier can have
595595
different semantics in this revision of \Cpp{}
596596
if it depends on a completion function's side effects occurring exactly once,
597597
on a specific thread running the phase completion step, or
@@ -1175,7 +1175,7 @@
11751175
\rationale
11761176
Improve efficiency and convenience of finding number of removed elements.
11771177
\effect
1178-
Code that depends on the return types might have different semantics in this revision of \Cpp{}.
1178+
Code that depends on the return types can have different semantics in this revision of \Cpp{}.
11791179
Translation units compiled against this version of \Cpp{} may be incompatible with
11801180
translation units compiled against \CppXVII{}, either failing to link or having undefined behavior.
11811181

@@ -1615,7 +1615,7 @@
16151615
New reserved namespaces.
16161616
\rationale
16171617
Reserve namespaces for future revisions of the standard library
1618-
that might otherwise be incompatible with existing programs.
1618+
that can otherwise be incompatible with existing programs.
16191619
\effect
16201620
The global namespaces \tcode{std}
16211621
followed by an arbitrary sequence of \grammarterm{digit}{s}\iref{lex.name}
@@ -1788,7 +1788,7 @@
17881788
void operator delete(void*, std::size_t) noexcept;
17891789
\end{codeblock}
17901790
In this revision of \Cpp{}, however, the declaration of \tcode{operator delete}
1791-
might match a predefined usual (non-placement)
1791+
can match a predefined usual (non-placement)
17921792
\tcode{operator delete}\iref{basic.stc.dynamic}. If so, the
17931793
program is ill-formed, as it was for class member allocation functions and
17941794
deallocation functions\iref{expr.new}.
@@ -2567,7 +2567,7 @@
25672567
to ``array of \tcode{const wchar_t}''.
25682568
\rationale
25692569
This avoids calling an inappropriate overloaded function,
2570-
which might expect to be able to modify its argument.
2570+
such as one that expects to be able to modify its argument.
25712571
\effect
25722572
Change to semantics of well-defined feature.
25732573
\difficulty

source/containers.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -22314,7 +22314,7 @@
2231422314
\pnum
2231522315
\begin{note}
2231622316
Concrete accessor policies can impose preconditions for their \tcode{access} function.
22317-
However, they might not.
22317+
However, they can not.
2231822318
For example, an accessor where
2231922319
\tcode{p} is \tcode{span<A::element_type, dynamic_extent>} and
2232022320
\tcode{access(p, i)} returns \tcode{p[i \% p.size()]}

source/declarations.tex

+9-8
Original file line numberDiff line numberDiff line change
@@ -4370,7 +4370,7 @@
43704370
any default argument associated with any reachable declaration that inhabits $S$
43714371
is available to the call.
43724372
\begin{note}
4373-
The candidate might have been found through a \grammarterm{using-declarator}
4373+
The candidate can be found through a \grammarterm{using-declarator}
43744374
from which the declaration that provides the default argument is not reachable.
43754375
\end{note}
43764376

@@ -4944,7 +4944,7 @@
49444944
no constructor of the object's class
49454945
is invoked for the initialization.
49464946
\begin{note}
4947-
Such an object might have been value-initialized
4947+
Such an object can be value-initialized
49484948
or initialized by aggregate initialization\iref{dcl.init.aggr}
49494949
or by an inherited constructor\iref{class.inhctor.init}.
49504950
\end{note}
@@ -8454,7 +8454,7 @@
84548454
\begin{note}
84558455
Some of the properties associated with an entity with language linkage
84568456
are specific to each implementation and are not described here. For
8457-
example, a particular language linkage might be associated with a
8457+
example, a particular language linkage can be associated with a
84588458
particular form of representing names of objects and functions with
84598459
external linkage, or with a particular calling convention, etc.
84608460
\end{note}
@@ -9039,7 +9039,7 @@
90399039
\pnum
90409040
\begin{note}
90419041
The \tcode{carries_dependency} attribute does not change the meaning of the
9042-
program, but might result in generation of more efficient code.
9042+
program, but can result in generation of more efficient code.
90439043
\end{note}
90449044

90459045
\pnum
@@ -9082,8 +9082,9 @@
90829082
hardware memory ordering instructions (a.k.a.\ fences).
90839083
Function \tcode{g}'s second parameter has a \tcode{carries_dependency} attribute,
90849084
but its first parameter does not. Therefore, function \tcode{h}'s first call to
9085-
\tcode{g} carries a dependency into \tcode{g}, but its second call does not. The
9086-
implementation might need to insert a fence prior to the second call to
9085+
\tcode{g} carries a dependency into \tcode{g}, but its second call does not.
9086+
It is possible that the
9087+
implementation needs to insert a fence prior to the second call to
90879088
\tcode{g}.
90889089
\end{example}
90899090
\indextext{attribute|)}%
@@ -9169,7 +9170,7 @@
91699170
\pnum
91709171
\recommended
91719172
The use of a fallthrough statement should suppress
9172-
a warning that an implementation might otherwise issue
9173+
a warning that an implementation can otherwise issue
91739174
for a case or default label that is reachable
91749175
from another case or default label along some path of execution.
91759176
The value of
@@ -9498,7 +9499,7 @@
94989499
\pnum
94999500
\recommended
95009501
Implementations should issue a
9501-
warning if a function marked \tcode{[[noreturn]]} might return.
9502+
warning if a function marked \tcode{[[noreturn]]} can return.
95029503
The value of
95039504
a \grammarterm{has-attribute-expression} for the \tcode{noreturn} attribute
95049505
should be \tcode{0} unless the implementation can issue such warnings.

source/diagnostics.tex

+2-2
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@
10771077
What constitutes correspondence for any given operating system is unspecified.
10781078
\begin{note}
10791079
The number of potential system error codes is large
1080-
and unbounded, and some might not correspond to any POSIX \tcode{errno} value. Thus
1080+
and unbounded, and some can not correspond to any POSIX \tcode{errno} value. Thus
10811081
implementations are given latitude in determining correspondence.
10821082
\end{note}
10831083
\end{itemdescr}
@@ -1719,7 +1719,7 @@
17191719
An \ntbs{} incorporating the arguments supplied in the constructor.
17201720

17211721
\begin{note}
1722-
The returned \ntbs{} might be the contents of \tcode{what_arg + ": " +
1722+
The returned \ntbs{} can be the contents of \tcode{what_arg + ": " +
17231723
code.message()}.
17241724
\end{note}
17251725
\end{itemdescr}

source/exceptions.tex

+1-1
Original file line numberDiff line numberDiff line change
@@ -817,7 +817,7 @@
817817
the function \tcode{std::terminate} is invoked\iref{except.terminate}.
818818
\begin{note}
819819
An implementation is not permitted to reject an expression merely because, when
820-
executed, it throws or might
820+
executed, it throws or can
821821
throw an exception from a function with a non-throwing exception specification.
822822
\end{note}
823823
\begin{example}

0 commit comments

Comments
 (0)