Skip to content

Commit 0d60c16

Browse files
authored
New issue from Dietmar Kühl: task::promise_type::return_value default template parameter
1 parent 6d50e54 commit 0d60c16

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

xml/issue4345.xml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4345" status="New">
5+
<title><code>task::promise_type::return_value</code> default template parameter</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 template parameter <code>V</code> of
14+
<code>task::promise_type::return_value</code> doesn't have a default
15+
template argument specified. Specifying a default template argument of <code>T</code>
16+
would enable use of <code>co_return { ... }</code> which would be
17+
consistent with normal <code>return</code> statements. This feature
18+
was not discussed in the design paper but based on the LEWG discussion
19+
on 2025-08-26 it is considered to be more a bug fix than a new feature.
20+
</p>
21+
</discussion>
22+
23+
<resolution>
24+
<p>
25+
Add a default template argument of <code>T</code> to the template
26+
parameter <code>V</code> of <code>task::promise_type::return_value</code>
27+
in the synopsis of <sref ref="[task.promise]"/>:
28+
<blockquote><pre>
29+
namespace std::execution {
30+
template&lt;class T, class Environment&gt;
31+
class task&lt;T, Environment&gt;::promise_type {
32+
...
33+
template&lt;typename V <ins>= T</ins>&gt;
34+
void return_value(V&amp;&amp; value);
35+
...
36+
};
37+
38+
}
39+
</pre></blockquote>
40+
</p>
41+
</resolution>
42+
43+
</issue>

0 commit comments

Comments
 (0)