Skip to content

Commit cf1c9e9

Browse files
committed
New issue from Eric Niebler: The operation_state concept can be simplified
1 parent 96185ce commit cf1c9e9

File tree

1 file changed

+58
-0
lines changed

1 file changed

+58
-0
lines changed

xml/issue4200.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<?xml version='1.0' encoding='utf-8' standalone='no'?>
2+
<!DOCTYPE issue SYSTEM "lwg-issue.dtd">
3+
4+
<issue num="4200" status="New">
5+
<title>The `operation_state` concept can be simplified</title>
6+
<section><sref ref="[exec.opstate.general]"/></section>
7+
<submitter>Eric Niebler</submitter>
8+
<date>03 Feb 2025</date>
9+
<priority>99</priority>
10+
11+
<discussion>
12+
<p>
13+
Imported from <a href="https://github.com/cplusplus/sender-receiver/issues/312">cplusplus/sender-receiver #312</a>.
14+
</p>
15+
<p>
16+
The current defn of the `operation_state` concept is:
17+
18+
<pre><code>
19+
template&lt;class O&gt;
20+
concept operation_state =
21+
derived_from&lt;typename O::operation_state_concept, operation_state_t&gt; &amp;&amp;
22+
requires (O&amp; o) {
23+
{ start(o) } noexcept;
24+
};
25+
</code></pre>
26+
27+
I think the <code>is_object_v&lt;O&gt;</code> constraint is not needed
28+
because the <code>derived_from</code> constraint has already established that
29+
<code>O</code> is a class type.
30+
</p>
31+
<p>
32+
And `start(o)` is always `noexcept` now that `start` mandates the
33+
`noexcept`-ness of `op.start()`.
34+
</p>
35+
</discussion>
36+
37+
<resolution>
38+
<p>
39+
This wording is relative to <paper num="N5001"/>.
40+
</p>
41+
<ol>
42+
<li>
43+
Modify <sref ref="[exec.opstate.general]"/> as indicated:
44+
<blockquote><pre><code>
45+
template&lt;class O&gt;
46+
concept operation_state =
47+
derived_from&lt;typename O::operation_state_concept, operation_state_t&gt; &amp;&amp;
48+
<del>is_object_v&lt;O&gt; &amp;&amp;</del>
49+
requires (O&amp; o) {
50+
<del>{</del> start(o) <del>} noexcept;</del>
51+
};
52+
</code></pre></blockquote>
53+
</li>
54+
</ol>
55+
56+
</resolution>
57+
58+
</issue>

0 commit comments

Comments
 (0)