Skip to content

Commit 1ab9a29

Browse files
committed
New issue for US 239-367: sch_ must not be in moved-from state
1 parent 0e28572 commit 1ab9a29

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

xml/issue4445.xml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4445" status="New">
5+
<title>`sch_` must not be in moved-from state</title>
6+
<section>
7+
<sref ref="[exec.task.scheduler]"/>
8+
</section>
9+
<submitter>Tomasz Kamiński</submitter>
10+
<date>05 Nov 2025</date>
11+
<priority>99</priority>
12+
13+
<discussion>
14+
<b>Addresses <a href="https://github.com/cplusplus/nbballot/issues/942">US 239-367</a></b>
15+
<p>As specified, there is an implicit precondition that `sch_` is not moved from on all the
16+
member functions. If that is intended, the precondition should be made explicit.</p>
17+
</discussion>
18+
19+
<resolution>
20+
<p>
21+
This wording is relative to <paper num="N5014"/>.
22+
</p>
23+
24+
<ol>
25+
26+
<li><p>Modify <sref ref="[exec.task.scheduler]"/> as indicated:</p>
27+
28+
<pre>
29+
namespace std::execution {
30+
class task_scheduler {
31+
class <i>ts-sender</i>; // exposition only
32+
33+
template&lt;receiver R&gt;
34+
class state; // exposition only
35+
36+
public:
37+
using scheduler_concept = scheduler_t;
38+
39+
template&lt;class Sch, class Allocator = allocator&lt;void&gt;&gt;
40+
requires (!same_as&lt;task_scheduler, remove_cvref_t&lt;Sch&gt;&gt;)
41+
&amp;&amp; scheduler&lt;Sch&gt;
42+
explicit task_scheduler(Sch&amp;&amp; sch, Allocator alloc = {});
43+
44+
<ins>task_scheduler(const task_scheduler&amp;) = default;</ins>
45+
<ins>task_scheduler& operator=(const task_scheduler&amp;) = default;</ins>
46+
47+
<i>ts-sender</i> schedule();
48+
49+
friend bool operator==(const task_scheduler&amp; lhs, const task_scheduler&amp; rhs)
50+
noexcept;
51+
template&lt;class Sch&gt;
52+
requires (!same_as&lt;task_scheduler, Sch&gt;)
53+
&amp;&amp; scheduler&lt;Sch&gt;
54+
friend bool operator==(const task_scheduler&amp; lhs, const Sch&amp; rhs) noexcept;
55+
56+
private:
57+
shared_ptr&lt;void&gt; <i>sch_</i>; // exposition only
58+
};
59+
}
60+
</pre>
61+
</li>
62+
</ol>
63+
64+
</resolution>
65+
66+
</issue>

0 commit comments

Comments
 (0)