From 67309a0e2007db3701e3bc95ff8f42d3806ab9a0 Mon Sep 17 00:00:00 2001 From: Eisenwave Date: Fri, 14 Nov 2025 19:53:10 +0100 Subject: [PATCH] =?UTF-8?q?P3388R3=20When=20Do=20You=20Know=20connect=20Do?= =?UTF-8?q?esn=E2=80=99t=20Throw=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes NB CA 329, CA 334, FR 032-330 (C++26 CD). Editorial note: * Explanatory comments on constraint were updated. The paper omitted even the existing comments. --- source/exec.tex | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/source/exec.tex b/source/exec.tex index dd491148a0..d601ed177c 100644 --- a/source/exec.tex +++ b/source/exec.tex @@ -1179,8 +1179,9 @@ requires(const remove_cvref_t& rcvr) { { get_env(rcvr) } -> @\exposconcept{queryable}@; } && - @\libconcept{move_constructible}@> && // rvalues are movable, and - @\libconcept{constructible_from}@, Rcvr>; // lvalues are copyable + @\libconcept{move_constructible}@> && // rvalues are movable, and + @\libconcept{constructible_from}@, Rcvr> && // lvalues are copyable, and + is_nothrow_move_constructible_v>; // no-throw-movable template concept @\defexposconcept{valid-completion-for}@ = // \expos @@ -2860,6 +2861,21 @@ Otherwise, \tcode{\exposid{connect-awaitable}(new_sndr, rcvr)}. \end{itemize} Except that \tcode{rcvr} is evaluated only once. +The program is ill-formed, no diagnostic required, +if there exists an rvalue expression \tcode{rcvr2} such that: +\begin{itemize} +\item \tcode{decltype(rcvr2)} models \libconcept{receiver}, +\item \tcode{noexcept(rcvr2)} is \tcode{true}, +\item \tcode{is_same_v} is \tcode{true}, +\item \tcode{noexcept(execution::connect(sndr, rcvr))} is \tcode{true}, and +\item \tcode{noexcept(execution::connect(sndr, rcvr2))} +is well-formed and evaluates to \tcode{false}. +\end{itemize} +\begin{note} +This allows determination of whether \tcode{connect} throws +with only the context of the environment, +such as within \tcode{get_completion_signatures}. +\end{note} \mandates The following are \tcode{true}: