Skip to content

Commit e323d3a

Browse files
committed
New issue from Ian Petersen: "Missing noexcept operator in [exec.when.all]"
1 parent b4dbd45 commit e323d3a

File tree

1 file changed

+72
-0
lines changed

1 file changed

+72
-0
lines changed

xml/issue4227.xml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4227" status="New">
5+
<title>Missing `noexcept` operator in [exec.when.all]</title>
6+
<section>
7+
<sref ref="[exec.when.all]"/>
8+
</section>
9+
<submitter>Ian Petersen</submitter>
10+
<date>17 Mar 2025</date>
11+
<priority>99</priority>
12+
13+
<discussion>
14+
<p>
15+
In <sref ref="[exec.when.all]"/> p7, the <tt><i>impls-for</i>&lt;when_all_t&gt;::<i>get-state</i></tt>
16+
member is defined to be equivalent to the following lambda:
17+
</p>
18+
<blockquote><pre>
19+
[]&lt;class Sndr, class Rcvr&gt;(Sndr&amp;&amp; sndr, Rcvr&amp; rcvr) noexcept(<i>e</i>) -> decltype(<i>e</i>) {
20+
return <i>e</i>;
21+
}
22+
</pre></blockquote>
23+
<p>
24+
and <tt><i>e</i></tt> is later defined to be:
25+
</p>
26+
<blockquote><pre>
27+
std::forward&lt;Sndr&gt;(sndr).apply(<i>make-state</i>&lt;Rcvr&gt;())
28+
</pre></blockquote>
29+
<p>
30+
Together, the two definitions imply that the `noexcept` clause on the provided lambda is:
31+
</p>
32+
<blockquote><pre>
33+
noexcept(std::forward&lt;Sndr&gt;(sndr).apply(<i>make-state</i>&lt;Rcvr&gt;()))
34+
</pre></blockquote>
35+
<p>
36+
which is invalid.
37+
<p/>
38+
Presumably, the lambda should be defined like so (with an extra `noexcept` operator in the `noexcept` clause):
39+
</p>
40+
<blockquote><pre>
41+
[]&lt;class Sndr, class Rcvr&gt;(Sndr&amp;&amp; sndr, Rcvr&amp; rcvr) noexcept(<ins>noexcept(</ins><i>e</i><ins>)</ins>) -&gt; decltype(<i>e</i>) {
42+
return <i>e</i>;
43+
}
44+
</pre></blockquote>
45+
</discussion>
46+
47+
<resolution>
48+
<p>
49+
This wording is relative to <paper num="N5008"/>.
50+
</p>
51+
52+
<ol>
53+
54+
<li><p>Modify <sref ref="[exec.when.all]"/> as indicated:</p>
55+
56+
<blockquote>
57+
<p>
58+
-7- The member <tt><i>impls-for</i>&lt;when_all_t&gt;::<i>get-state</i></tt> is initialized with a callable object
59+
equivalent to the following lambda expression:
60+
</p>
61+
<blockquote><pre>
62+
[]&lt;class Sndr, class Rcvr&gt;(Sndr&amp;&amp; sndr, Rcvr&amp; rcvr) noexcept(<ins>noexcept(</ins><i>e</i><ins>)</ins>) -&gt; decltype(<i>e</i>) {
63+
return <i>e</i>;
64+
}
65+
</pre></blockquote>
66+
</blockquote>
67+
</li>
68+
69+
</ol>
70+
</resolution>
71+
72+
</issue>

0 commit comments

Comments
 (0)