Skip to content

Commit b4faca5

Browse files
committed
P3388R3 When Do You Know connect Doesn’t Throw?
Fixes NB CA-334, FR-032-330, CA-329 (C++26 CD).
1 parent 5e49eff commit b4faca5

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

source/exec.tex

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1185,7 +1185,8 @@
11851185
{ get_env(rcvr) } -> @\exposconcept{queryable}@;
11861186
} &&
11871187
@\libconcept{move_constructible}@<remove_cvref_t<Rcvr>> && // rvalues are movable, and
1188-
@\libconcept{constructible_from}@<remove_cvref_t<Rcvr>, Rcvr>; // lvalues are copyable
1188+
@\libconcept{constructible_from}@<remove_cvref_t<Rcvr>, Rcvr> && // lvalues are copyable
1189+
is_nothrow_move_constructible_v<remove_cvref_t<Rcvr>>;
11891190

11901191
template<class Signature, class Rcvr>
11911192
concept @\defexposconcept{valid-completion-for}@ = // \expos
@@ -2856,6 +2857,21 @@
28562857
Otherwise, \tcode{\exposid{connect-awaitable}(new_sndr, rcvr)}.
28572858
\end{itemize}
28582859
Except that \tcode{rcvr} is evaluated only once.
2860+
The program is ill-formed, no diagnostic required
2861+
if there exists an rvalue expression \tcode{rcvr2} such that:
2862+
\begin{itemize}
2863+
\item \tcode{decltype(rcvr2)} models \libconcept{receiver},
2864+
\item \tcode{noexcept(rcvr2)} is \tcode{true},
2865+
\item \tcode{is_same_v<decltype(get_env(rcvr2)), decltype(get_env(rcvr))>} is \tcode{true},
2866+
\item \tcode{noexcept(execution::connect(sndr, rcvr))} is \tcode{true}, and
2867+
\item \tcode{noexcept(execution::connect(sndr, rcvr2))}
2868+
is well-formed and evaluates to \tcode{false}.
2869+
\end{itemize}
2870+
\begin{note}
2871+
This allows determination of whether \tcode{connect} throws
2872+
with only the context of the environment,
2873+
such as within \tcode{get_completion_signatures}.
2874+
\end{note}
28592875

28602876
\mandates
28612877
The following are \tcode{true}:

0 commit comments

Comments
 (0)