Skip to content

Commit 6c06efb

Browse files
authored
New issue from Dietmar Kühl: Missing rvalue reference qualification for task_scheduler::ts-sender::connect()
1 parent ad05ba2 commit 6c06efb

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

xml/issue4342.xml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4342" status="New">
5+
<title>Missing rvalue reference qualification for <code>task_scheduler::ts-sender::connect()</code></title>
6+
<section><sref ref="[exec.task.scheduler]"/></section>
7+
<submitter>Dietmar Kühl</submitter>
8+
<date>01 Sep 2025</date>
9+
<priority>99</priority>
10+
11+
<discussion>
12+
<p>
13+
The result of <code>schedule(sched)</code> for a scheduler
14+
<code>sched</code> is only required to be movable. An object of
15+
this type may need to be forwarded to an operation state constructor
16+
by <code>task_scheduler::<i>ts-sender</i>::connect</code>. Thus,
17+
this function should be qualified with an rvalue reference.
18+
</p>
19+
</discussion>
20+
21+
<resolution>
22+
<p>
23+
Add an rvalue qualifier to the declaration of <code>connect</code> in <sref ref="[exec.task.scheduler]"/> paragraph 8:
24+
<blockquote>
25+
<pre>
26+
namespace std::execution {
27+
class task_scheduler::ts-sender { // exposition only
28+
public:
29+
using sender_concept = sender_t;
30+
31+
template&lt;receiver Rcvr&gt;
32+
<i>state</i>&lt;Rcvr&gt; connect(Rcvr&amp;&amp; rcvr)<ins> &amp;&amp;</ins>;
33+
};
34+
}
35+
</pre>
36+
</blockquote>
37+
</p>
38+
<p>
39+
In the specification in <sref ref="[exec.task.scheduler]"/> paragraph 10 add an rvalue qualifier to <code>connect</code>:
40+
<blockquote>
41+
<pre>
42+
template&lt;receiver Rcvr&gt;
43+
<i>state</i>&lt;Rcvr&gt; connect(Rcvr&amp;&amp; rcvr)<ins> &amp;&amp;</ins>;
44+
</pre>
45+
<p>-10- <i>Effects</i>: Let <i>r</i> be an object of a type that
46+
models receiver and whose completion handlers result in invoking
47+
the corresponding completion handlers of <code>rcvr</code> or copy thereof.
48+
Returns an object of type <code><i>state</i>&lt;Rcvr&gt;</code> containing an operation state
49+
object initialized with <code>connect(<i>SENDER</i>(*this), std::move(<i>r</i>))</code>.
50+
</p>
51+
</blockquote>
52+
</p>
53+
</resolution>
54+
55+
</issue>

0 commit comments

Comments
 (0)