Skip to content

Commit 0fcfc36

Browse files
committed
New issue for US 249-379: Move specification for task::stop_token
1 parent 07872ce commit 0fcfc36

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

xml/issue4485.xml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4485" status="New">
5+
<title>Move specification for `task::stop_token_type`</title>
6+
<section><sref ref="[task.state]"/></section>
7+
<submitter>Tomasz Kamiński</submitter>
8+
<date>08 Dec 2025</date>
9+
<priority>99</priority>
10+
11+
<discussion>
12+
<b>Addresses <a href="https://github.com/cplusplus/nbballot/issues/954">US 249-379</a></b>
13+
<p>
14+
It is not clear what bullet <sref ref="task.state"/> p4.6 is – it reads like a requirement on `stop_token_type`,
15+
but if so, this paragraph is a poor place for it.
16+
</p>
17+
18+
</discussion>
19+
20+
<resolution>
21+
<p>
22+
This wording is relative to <paper num="N5014"/>.
23+
</p>
24+
25+
<ol>
26+
<li><p>Modify <sref ref="[exec.task]"/> as indicated:</p>
27+
28+
<blockquote>
29+
<p>-5-
30+
`allocator_type` shall meet the <i>Cpp17Allocator</i> requirements.
31+
<ins>
32+
For types `Fn` nad `Init` such that both <tt>invocable&lt;Fn&gt;</tt> and <tt>constructible_from&lt;Fn, Init&gt;</tt> are modeled,
33+
<tt>stop_token_type::callback_type&lt;Fn&gt;</tt> shall model <tt>stoppable-callback-for&lt;Fn, stop_token_type, Init&gt;</tt>.
34+
</ins></p>
35+
</blockquote>
36+
</li>
37+
38+
<li><p>Modify <sref ref="[task.state]"/> as indicated:</p>
39+
40+
<pre>
41+
void start() &amp; noexcept;
42+
</pre>
43+
<blockquote>
44+
<p>-4- <i>Effects</i>: Effects: Let <tt><i>prom</i></tt> be the object `handle.<i>prom</i>ise()`.
45+
Associates <tt><i>STATE</i>(<i>prom</i>)</tt>, <tt><i>RCVR</i>(<i>prom</i>)</tt>, and <tt><i>SCHED</i>(<i>prom</i>)</tt> with `*this` as follows:
46+
<ul>
47+
<li>-4.1- [&hellip;]</li>
48+
<li>-4.2- [&hellip;]</li>
49+
<li>-4.3- [&hellip;]</li>
50+
</ul>
51+
Let `st` be `get_stop_token(get_env(rcvr))`. Initializes <tt><i>prom</i>.token</tt> and <tt><i>prom</i>.source</tt> such that
52+
<ul>
53+
<li>-4.4- <tt><i>prom</i>.token.stop_requested()</tt> returns <tt>st.stop_requested()</tt>;</li>
54+
<li>-4.5- <tt><i>prom</i>.token.stop_requested()</tt> returns <tt>st.stop_requested()</tt><del>;</del><ins>.</ins></li>
55+
<li><del>-4.6- for types `Fn` nad `Init` such that both <tt>invocable&lt;Fn&gt;</tt> and <tt>constructible_from&lt;Fn, Init&gt;</tt> are modeled,
56+
<tt>stop_token_type::callback_type&lt;Fn&gt;</tt> modes l<tt>stoppable-callback-for&lt;Fn, stop_token_type, Init&gt;</tt>.</del></li>
57+
</ul></p>
58+
</blockquote>
59+
</li>
60+
61+
</ol>
62+
</resolution>
63+
64+
</issue>

0 commit comments

Comments
 (0)