Skip to content

Commit f491b4d

Browse files
authored
New issue from Dietmar Kühl: task::promise_type::return_void/value lack a specification
1 parent c66c356 commit f491b4d

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

xml/issue4346.xml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4346" status="New">
5+
<title><code>task::promise_type::return_void</code>/<code>value</code> lack a specification</title>
6+
<section><sref ref="[task.promise]"/></section>
7+
<submitter>Dietmar Kühl</submitter>
8+
<date>01 Sep 2025</date>
9+
<priority>99</priority>
10+
11+
<discussion>
12+
<p>
13+
The synopsis for <code>std::execution::task&lt;T,
14+
E&gt;::promise_type</code> declares <code>return_void()</code> or
15+
<code>return_value(V&amp;&amp;)</code>. However, there is no
16+
specification of what these functions actually do.
17+
<code>return_void()</code> doesn’t need to do anything at all.
18+
<code>return_value(V&amp;&amp; v)</code> needs to store <code>v</code>
19+
into the <code><i>result</i></code>.
20+
</p>
21+
</discussion>
22+
23+
<resolution>
24+
<p>
25+
Insert the following paragraphs in <sref ref="[task.promise]"/>
26+
after the specification of <code>unhandled_stopped</code>:
27+
</p>
28+
<p>
29+
<blockquote>
30+
<pre>coroutine_handle&lt;&gt; unhandled_stopped();</pre>
31+
<p>-13- <i>Effects</i>: Completes the asynchronous operation associated with <code><i>STATE</i>(*this)</code> by invoking <code>set_stopped(std::move(<i>RCVR</i>(*this)))</code>.</p>
32+
<p>-14- <i>Returns</i>: <code>noop_coroutine()</code>.</p>
33+
<pre><ins>void return_void();</ins></pre>
34+
<p><ins>-15- <i>Effects</i>: does nothing.</ins></p>
35+
<pre><ins>
36+
template&lt;class V&gt;
37+
void return_value(V&amp;&amp; v);
38+
</ins></pre>
39+
<p><ins>-16- <i>Effects</i>: Equivalent to <code><i>result</i>.emplace(std::forward&lt;V&gt;(v))</code>.</ins></p>
40+
<pre>unspecified get_env() const noexcept;</pre>
41+
<p>-1<del>5</del><ins>7</ins>- <i>Returns</i>: An object <code>env</code> such that queries are forwarded as follows:</p>
42+
</blockquote>
43+
</p>
44+
</resolution>
45+
46+
</issue>

0 commit comments

Comments
 (0)