Skip to content

Commit 03f3764

Browse files
CaseyCarterzygoloid
authored andcommitted
[definitions] Redefine expression-equivalent per ISO directives
To be replaceable in context, and add a clarifying example.
1 parent d119277 commit 03f3764

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

source/lib-intro.tex

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -227,16 +227,25 @@
227227

228228
\definition{expression-equivalent}{defns.expression-equivalent}
229229
\indexdefn{expression-equivalent}%
230-
relationship that exists between two expressions \tcode{E1} and \tcode{E2} such
231-
that
232-
\begin{itemize}
233-
\item \tcode{E1} and \tcode{E2} have the same effects,
234-
235-
\item \tcode{noexcept(E1) == noexcept(E2)}, and
230+
expressions that all have the same effects,
231+
either
232+
are all potentially-throwing\iref{except.spec} or
233+
are all not potentially-throwing,
234+
and
235+
either
236+
are all constant subexpressions or
237+
are all not constant subexpressions
236238

237-
\item \tcode{E1} is a constant subexpression if and only if \tcode{E2} is a
238-
constant subexpression
239-
\end{itemize}
239+
\begin{example}
240+
For a value \tcode{x} of type \tcode{int}
241+
and a function \tcode{f} that accepts integer arguments,
242+
the expressions
243+
\tcode{f(x + 2)},
244+
\tcode{f(2 + x)},
245+
and
246+
\tcode{f(1 + x + 1)}
247+
are expression-equivalent.
248+
\end{example}
240249

241250
\definition{handler function}{defns.handler}
242251
\indexdefn{function!handler}%

0 commit comments

Comments
 (0)