Skip to content

Commit 8cba240

Browse files
authored
Merge pull request #453 from timsong-cpp/pr-4198
Add PR for 4198
2 parents 209076d + 6094e82 commit 8cba240

File tree

1 file changed

+65
-0
lines changed

1 file changed

+65
-0
lines changed

xml/issue4198.xml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,76 @@ Set priority to 1 after reflector poll.
101101
Direction seems right. Decay-copyable is not a defined term.
102102
</p>
103103

104+
<note>2025-02-12 Tim adds PR</note>
105+
<p>This also corrects the issue that `nothrow` is currently relying
106+
on the unspecified exception specification of `tuple`'s constructor.</p>
104107
</discussion>
105108

106109
<resolution>
107110
<p>
111+
This wording is relative to <paper num="N5001"/>.
108112
</p>
113+
114+
<ol>
115+
<li>
116+
Modify <sref ref="[exec.schedule.from]"/> p8 as indicated:
117+
<blockquote>
118+
<p>
119+
-8- Let `Sigs` be a pack of the arguments to the `completion_signatures`
120+
specialization named by
121+
<code>completion_signatures_of_t&lt;<i>child-type</i>&lt;Sndr&gt;, env_of_t&lt;Rcvr&gt;&gt;</code>.
122+
Let <i><code>as-tuple</code></i> be an alias template
123+
<del>
124+
that transforms a completion signature `Tag(Args...)` into
125+
the tuple specialization <code><i>decayed-tuple</i>&lt;Tag, Args...&gt;</code>.
126+
</del>
127+
<ins>
128+
such that <code><i>as-tuple</i>&lt;Tag(Args...)&gt;</code> denotes
129+
the type <code><i>decayed-tuple</i>&lt;Tag, Args...&gt;</code>,
130+
and let <code><i>is-nothrow-decay-copy-sig</i></code>
131+
be a variable template such that
132+
<code>auto(<i>is-nothrow-decay-copy-sig</i>&lt;Tag(Args...)&gt;)</code>
133+
is a constant expression of type `bool` and equal to
134+
<code>(is_nothrow_constructible_v&lt;decay_t&lt;Args&gt;, Args&gt; &amp;&amp; ...)</code>.
135+
Let <i><code>error-completion</code></i> be a pack consisting of the type
136+
`set_error_t(exception_ptr)` if
137+
<code>(<i>is-nothrow-decay-copy-sig</i>&lt;Sigs&gt; &amp;&amp;...)</code>
138+
is `false`, and an empty pack otherwise.
139+
</ins>
140+
Then `variant_t` denotes the type
141+
<code>variant&lt;monostate, <i>as-tuple</i>&lt;Sigs&gt;...<ins>, <i>error-completion</i>...</ins>&gt;</code>,
142+
except with duplicate types removed.
143+
</p>
144+
</blockquote>
145+
</li>
146+
<li>
147+
<p>Modify <sref ref="[exec.schedule.from]"/> p11 as indicated:</p>
148+
<blockquote><p>
149+
-11- The member <code><i>impls-for</i>&lt;schedule_from_t&gt;::<i>complete</i></code>
150+
is initialized with a callable object equivalent to the following lambda:
151+
</p>
152+
<blockquote><pre><code>
153+
[]&lt;class Tag, class... Args&gt;(auto, auto&amp; state, auto&amp; rcvr, Tag, Args&amp;&amp;... args) noexcept
154+
-&gt; void {
155+
using result_t = <i>decayed-tuple</i>&lt;Tag, Args...&gt;;
156+
constexpr bool nothrow = <del>is_nothrow_constructible_v&lt;result_t, Tag, Args...&gt;</del>
157+
<ins>(is_nothrow_constructible_v&lt;decay_t&lt;Args&gt;, Args&gt; &amp;&amp; ...)</ins>;
158+
159+
try {
160+
state.<i>async-result</i>.template emplace&lt;result_t&gt;(Tag(), std::forward&lt;Args&gt;(args)...);
161+
} catch (...) {
162+
if constexpr (!nothrow) <del>{</del>
163+
<ins>state.<i>async-result</i>.template emplace&lt;tuple&lt;set_error_t, exception_ptr&gt;&gt;(set_error, current_exception());</ins>
164+
<del>set_error(std::move(rcvr), current_exception());</del>
165+
<del>return;</del>
166+
<del>}</del>
167+
}
168+
start(state.<i>op-state</i>);
169+
};
170+
</code></pre></blockquote>
171+
</blockquote>
172+
</li>
173+
</ol>
109174
</resolution>
110175

111176
</issue>

0 commit comments

Comments
 (0)