Skip to content

Commit

Permalink
[std] Replace 'might' with 'can' in notes and examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jensmaurer committed May 23, 2024
1 parent 2e455af commit 270dc04
Show file tree
Hide file tree
Showing 21 changed files with 86 additions and 85 deletions.
8 changes: 4 additions & 4 deletions source/algorithms.tex
Original file line number Diff line number Diff line change
Expand Up @@ -5020,7 +5020,7 @@
do not overlap.
\begin{note}
For the overload with an \tcode{ExecutionPolicy},
there might be a performance cost
there can be a performance cost
if \tcode{iterator_traits<For\-ward\-It\-er\-ator1>::value_type}
is not \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}).
\end{note}
Expand Down Expand Up @@ -5943,7 +5943,7 @@
do not overlap.
\begin{note}
For the overloads with an \tcode{ExecutionPolicy},
there might be a performance cost
there can be a performance cost
if \tcode{iterator_traits<ForwardIterator1>::value_type} does not meet
the \oldconcept{\-Move\-Constructible} (\tref{cpp17.moveconstructible}) requirements.
\end{note}
Expand Down Expand Up @@ -6130,7 +6130,7 @@
\oldconcept{CopyAssignable} requirements.
\begin{note}
For the overloads with an \tcode{ExecutionPolicy},
there might be a performance cost
there can be a performance cost
if the value type of \tcode{ForwardIterator1} does not meet both the
\oldconcept{CopyConstructible} and \oldconcept{CopyAssignable} requirements.
\end{note}
Expand Down Expand Up @@ -7717,7 +7717,7 @@

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

Expand Down
30 changes: 15 additions & 15 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@
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
Expand Down Expand Up @@ -1512,7 +1512,7 @@
any declaration in the same translation unit
whose locus\iref{basic.scope.pdecl} is before $P$.
\begin{note}
The declaration might appear in a scope that does not contain $P$.
The declaration can appear in a scope that does not contain $P$.
\end{note}
\indextext{precede|see{declaration, precede}}%
A declaration $X$ \defnx{precedes}{declaration!precede}
Expand Down Expand Up @@ -1795,7 +1795,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\iref{conv.mem,expr.ref,class.access.base}.
\end{note}
\begin{example}
Expand Down Expand Up @@ -3116,7 +3116,7 @@
or a maximal 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}
Expand Down Expand Up @@ -4277,7 +4277,7 @@
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{\keyword{long} \keyword{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
as a virtual base class, the \tcode{B} subobject can be part of a different
subobject, reducing the alignment requirements on the \tcode{D} subobject.
\end{example}
The result of the \keyword{alignof} operator reflects the alignment
Expand Down Expand Up @@ -4590,7 +4590,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}
Expand Down Expand Up @@ -4759,7 +4759,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}
Expand Down Expand Up @@ -4960,7 +4960,7 @@
\end{itemize}
\begin{note}
A literal type is one for which
it might be possible to create an object
it is possible to create an object
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
Expand Down Expand Up @@ -5515,7 +5515,7 @@
an invocation of a deallocation function\iref{basic.stc.dynamic.deallocation},
and \impldef{invalid pointer value in the context of an evaluation} otherwise.
\begin{footnote}
Some implementations might define that
Some implementations can define that
copying such a pointer value causes a system-generated runtime fault.
\end{footnote}
\begin{note}
Expand Down Expand Up @@ -6140,7 +6140,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.
Expand Down Expand Up @@ -6507,19 +6507,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 could 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 can 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
Expand Down Expand Up @@ -6560,7 +6560,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.
Expand Down Expand Up @@ -6680,7 +6680,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 might only
For example, some kinds of synchronization between threads of execution can 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}
Expand Down
14 changes: 7 additions & 7 deletions source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1298,7 +1298,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}

Expand Down Expand Up @@ -1501,7 +1501,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}

Expand Down Expand Up @@ -2110,7 +2110,7 @@
\begin{note}
A
\tcode{return}
statement\iref{stmt.return} in a destructor might not directly return to the
statement\iref{stmt.return} in a destructor can not directly return to the
caller; before transferring control to the caller, the destructors for the
members and bases are called.
\end{note}
Expand Down Expand Up @@ -4050,7 +4050,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.
Expand Down Expand Up @@ -4420,7 +4420,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}

Expand Down Expand Up @@ -6030,7 +6030,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,
Expand Down Expand Up @@ -6702,7 +6702,7 @@
the expression resulting from the interpretation of \tcode{x @ y}
using the selected rewritten candidate\iref{over.match.oper}
does not result in a usable candidate
(for example, that expression might be \tcode{(x <=> y) @ 0}), or
(for example, that expression can be \tcode{(x <=> y) @ 0}), or

\item
\tcode{x @ y} cannot be implicitly converted to \tcode{bool}.
Expand Down
10 changes: 5 additions & 5 deletions source/compatibility.tex
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,7 @@
Correct contradictory wording and
improve implementation flexibility for performance.
\effect
Valid \CppXX{} code using a barrier might have
Valid \CppXX{} code using a barrier can have
different semantics in this revision of \Cpp{}
if it depends on a completion function's side effects occurring exactly once,
on a specific thread running the phase completion step, or
Expand Down Expand Up @@ -1138,7 +1138,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.

Expand Down Expand Up @@ -1568,7 +1568,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}
Expand Down Expand Up @@ -1737,7 +1737,7 @@
void operator delete(void*, std::size_t) noexcept;
\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}.
Expand Down Expand Up @@ -2503,7 +2503,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 can expect to be able to modify its argument.
\effect
Change to semantics of well-defined feature.
\difficulty
Expand Down
2 changes: 1 addition & 1 deletion source/containers.tex
Original file line number Diff line number Diff line change
Expand Up @@ -22334,7 +22334,7 @@
\pnum
\begin{note}
Concrete accessor policies can impose preconditions for their \tcode{access} function.
However, they might not.
However, they can not.
For example, an accessor where
\tcode{p} is \tcode{span<A::element_type, dynamic_extent>} and
\tcode{access(p, i)} returns \tcode{p[i \% p.size()]}
Expand Down
17 changes: 9 additions & 8 deletions source/declarations.tex
Original file line number Diff line number Diff line change
Expand Up @@ -4370,7 +4370,7 @@
any default argument associated with any reachable declaration that inhabits $S$
is available to the call.
\begin{note}
The candidate might have been found through a \grammarterm{using-declarator}
The candidate can be found through a \grammarterm{using-declarator}
from which the declaration that provides the default argument is not reachable.
\end{note}

Expand Down Expand Up @@ -4944,7 +4944,7 @@
no constructor of the object's class
is invoked for the initialization.
\begin{note}
Such an object might have been value-initialized
Such an object can be value-initialized
or initialized by aggregate initialization\iref{dcl.init.aggr}
or by an inherited constructor\iref{class.inhctor.init}.
\end{note}
Expand Down Expand Up @@ -8454,7 +8454,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}
Expand Down Expand Up @@ -9039,7 +9039,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
Expand Down Expand Up @@ -9082,8 +9082,9 @@
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} 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|)}%
Expand Down Expand Up @@ -9169,7 +9170,7 @@
\pnum
\recommended
The use of a fallthrough statement should suppress
a warning that an implementation might otherwise issue
a warning that an implementation can otherwise issue
for a case or default label that is reachable
from another case or default label along some path of execution.
The value of
Expand Down Expand Up @@ -9498,7 +9499,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.
The value of
a \grammarterm{has-attribute-expression} for the \tcode{noreturn} attribute
should be \tcode{0} unless the implementation can issue such warnings.
Expand Down
4 changes: 2 additions & 2 deletions source/diagnostics.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,7 @@
What constitutes correspondence for any given operating 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 some can not correspond to any POSIX \tcode{errno} value. Thus
implementations are given latitude in determining correspondence.
\end{note}
\end{itemdescr}
Expand Down Expand Up @@ -1719,7 +1719,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}
Expand Down
2 changes: 1 addition & 1 deletion source/exceptions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@
the function \tcode{std::terminate} is invoked\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}
Expand Down
Loading

0 comments on commit 270dc04

Please sign in to comment.