|
| 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<T, |
| 14 | +E>::promise_type</code> declares <code>return_void()</code> or |
| 15 | +<code>return_value(V&&)</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&& 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<> 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<class V> |
| 37 | + void return_value(V&& v); |
| 38 | +</ins></pre> |
| 39 | +<p><ins>-16- <i>Effects</i>: Equivalent to <code><i>result</i>.emplace(std::forward<V>(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