diff --git a/xml/issue4341.xml b/xml/issue4341.xml new file mode 100644 index 0000000000..555d64ad31 --- /dev/null +++ b/xml/issue4341.xml @@ -0,0 +1,51 @@ + + + + +Missing rvalue reference qualification for <code>task::connect()</code> +
+Dietmar Kühl +31 Aug 2025 +99 + + +

+Coroutines can't be copied. Thus, a task can be +connect() just once. To represent that +task::connect() should be rvalue reference qualified +but currently it isn't. +

+
+ + +

+In the synopsis in add rvalue +reference qualification to task::connect(): +

+namespace std::execution {
+  template<class T, class Environment>
+  class task {
+    ...
+    template<receiver Rcvr>
+        state<Rcvr> connect(Rcvr&& rcvr) &&;
+    ...
+  }
+}
+
+

+

+In the specification in paragraph 3 add rvalue +reference qualification to task::connect(): +

+
+template<receiver Rcvr>
+    state<Rcvr> connect(Rcvr&& rcvr) &&;
+
+

-3- Precondition: bool(handle) is true.

+

-4- Effects: Equivalent to:

+
    return state<Rcvr>(exchange(handle, {}), std::forward<Rcvr>(recv));
+
+

+
+ +