Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions xml/issue4342.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
<?xml version='1.0' encoding='utf-8' standalone='no'?>
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">

<issue num="4342" status="New">
<title>Missing rvalue reference qualification for <code>task_scheduler::ts-sender::connect()</code></title>
<section><sref ref="[exec.task.scheduler]"/></section>
<submitter>Dietmar Kühl</submitter>
<date>01 Sep 2025</date>
<priority>99</priority>

<discussion>
<p>
The result of <code>schedule(sched)</code> for a scheduler
<code>sched</code> is only required to be movable. An object of
this type may need to be forwarded to an operation state constructor
by <code>task_scheduler::<i>ts-sender</i>::connect</code>. Thus,
this function should be qualified with an rvalue reference.
</p>
</discussion>

<resolution>
<p>
Add an rvalue qualifier to the declaration of <code>connect</code> in <a href="https://wg21.link/exec.task.scheduler#8">[exec.task.scheduler] paragraph 8</a>:
<blockquote>
<pre>
namespace std::execution {
class task_scheduler::ts-sender { // exposition only
public:
using sender_concept = sender_t;

template&lt;receiver Rcvr&gt;
<i>state</i>&lt;Rcvr&gt; connect(Rcvr&amp;&amp; rcvr)<ins> &amp;&amp;</ins>;
};
}
</pre>
</blockquote>
</p>
<p>
In the specification in <a href="https://wg21.link/exec.task.scheduler#10">[exec.task.scheduler] paragraph 10</a> add an rvalue qualifier to <code>connect</code>:
<blockquote>
<pre>
template&lt;receiver Rcvr&gt;
<i>state</i>&lt;Rcvr&gt; connect(Rcvr&amp;&amp; rcvr)<ins> &amp;&amp;</ins>;
</pre>
<p>-10- <i>Effects</i>: Let <i>r</i> be an object of a type that
models receiver and whose completion handlers result in invoking
the corresponding completion handlers of <code>rcvr</code> or copy thereof.
Returns an object of type <code><i>state</i>&lt;Rcvr&gt;</code> containing an operation state
object initialized with <code>connect(<i>SENDER</i>(*this), std::move(<i>r</i>))</code>.
</p>
</blockquote>
</p>
</resolution>

</issue>