Skip to content

Commit

Permalink
Publish: Merge pull request #154 from cplusplus/concept-opt-in-defaults
Browse files Browse the repository at this point in the history
rename `is_sender`/`is_receiver` to `sender_concept`/`receiver_concept` 58614d0
  • Loading branch information
ericniebler committed Dec 10, 2023
1 parent d5aeebd commit d0a90ea
Showing 1 changed file with 31 additions and 17 deletions.
48 changes: 31 additions & 17 deletions execution.html
Original file line number Diff line number Diff line change
Expand Up @@ -2246,7 +2246,7 @@
<div class="head">
<p data-fill-with="logo"></p>
<h1 class="p-name no-ref" id="title">D2300R8<br><code class="highlight"><c- n>std</c-><c- o>::</c-><c- n>execution</c-></code></h1>
<h2 class="no-num no-toc no-ref heading settled" id="profile-and-date"><span class="content">Draft Proposal, <time class="dt-updated" datetime="2023-12-08">2023-12-08</time></span></h2>
<h2 class="no-num no-toc no-ref heading settled" id="profile-and-date"><span class="content">Draft Proposal, <time class="dt-updated" datetime="2023-12-09">2023-12-09</time></span></h2>
<div data-fill-with="spec-metadata">
<dl>
<dt class="editor">Authors:
Expand Down Expand Up @@ -2965,7 +2965,7 @@ <h3 class="heading settled" data-level="1.4" id="example-async-windows-socket-re
<c- p>};</c->

<c- k>struct</c-> <c- nc>recv_sender</c-> <c- p>{</c->
<c- n>using</c-> <c- n>is_sender</c-> <c- o>=</c-> <c- b>void</c-><c- p>;</c->
<c- n>using</c-> <c- n>sender_concept</c-> <c- o>=</c-> <c- n>std</c-><c- o>::</c-><c- n>execution</c-><c- o>::</c-><c- n>sender_t</c-><c- p>;</c->
<c- n>SOCKET</c-> <c- n>sock</c-><c- p>;</c->
<c- b>void</c-><c- o>*</c-> <c- n>data</c-><c- p>;</c->
<c- b>size_t</c-> <c- n>len</c-><c- p>;</c->
Expand Down Expand Up @@ -3050,7 +3050,7 @@ <h4 class="heading settled" data-level="1.5.1" id="example-then"><span class="se

<c- n>template</c-><c- o>&lt;</c-><c- n>exec</c-><c- o>::</c-><c- n>sender</c-> <c- n>S</c-><c- p>,</c-> <c- n>class</c-> <c- n>F</c-><c- o>></c->
<c- k>struct</c-> <c- nc>_then_sender</c-> <c- p>{</c->
<c- n>using</c-> <c- n>is_sender</c-> <c- o>=</c-> <c- b>void</c-><c- p>;</c->
<c- n>using</c-> <c- n>sender_concept</c-> <c- o>=</c-> <c- n>exec</c-><c- o>::</c-><c- n>sender_t</c-><c- p>;</c->
<c- n>S</c-> <c- n>s_</c-><c- p>;</c->
<c- n>F</c-> <c- n>f_</c-><c- p>;</c->

Expand Down Expand Up @@ -3173,7 +3173,7 @@ <h4 class="heading settled" data-level="1.5.2" id="example-retry"><span class="s

<c- n>template</c-><c- o>&lt;</c-><c- n>class</c-> <c- n>S</c-><c- o>></c->
<c- k>struct</c-> <c- nc>_retry_sender</c-> <c- p>{</c->
<c- n>using</c-> <c- n>is_sender</c-> <c- o>=</c-> <c- b>void</c-><c- p>;</c->
<c- n>using</c-> <c- n>sender_concept</c-> <c- o>=</c-> <c- n>exec</c-><c- o>::</c-><c- n>sender_t</c-><c- p>;</c->
<c- n>S</c-> <c- n>s_</c-><c- p>;</c->
<c- n>explicit</c-> <c- nf>_retry_sender</c-><c- p>(</c-><c- n>S</c-> <c- n>s</c-><c- p>)</c-> <c- o>:</c-> <c- n>s_</c-><c- p>((</c-><c- n>S</c-><c- o>&amp;&amp;</c-><c- p>)</c-> <c- n>s</c-><c- p>)</c-> <c- p>{}</c->

Expand Down Expand Up @@ -3258,7 +3258,7 @@ <h4 class="heading settled" data-level="1.6.1" id="example-schedulers-inline"><s
<c- p>};</c->

<c- k>struct</c-> <c- nc>_sender</c-> <c- p>{</c->
<c- n>using</c-> <c- n>is_sender</c-> <c- o>=</c-> <c- b>void</c-><c- p>;</c->
<c- n>using</c-> <c- n>sender_concept</c-> <c- o>=</c-> <c- n>std</c-><c- o>::</c-><c- n>execution</c-><c- o>::</c-><c- n>sender_t</c-><c- p>;</c->
<c- n>using</c-> <c- n>completion_signatures</c-> <c- o>=</c->
<c- n>std</c-><c- o>::</c-><c- n>execution</c-><c- o>::</c-><c- n>completion_signatures</c-><c- o>&lt;</c-><c- n>std</c-><c- o>::</c-><c- n>execution</c-><c- o>::</c-><c- n>set_value_t</c-><c- p>()</c-><c- o>></c-><c- p>;</c->

Expand Down Expand Up @@ -3657,9 +3657,15 @@ <h3 class="heading settled" data-level="2.1" id="r8"><span class="secno">2.1. </
join two environments in the presence of queries that have defaults.</p>
<li data-md>
<p>The <code class="highlight"><c- n>sender_in</c-><c- o>&lt;</c-><c- n>Sndr</c-><c- p>,</c-> <c- n>Env</c-><c- o>></c-></code> concept requires that <code class="highlight"><c- n>E</c-></code> satisfies <code class="highlight"><c- n>queryable</c-></code>.</p>
</ul>
<p><b>Enhancements:</b></p>
<ul>
<li data-md>
<p>The exposition-only class template <code class="highlight"><i><c- n>basic</c-><c- o>-</c-><c- n>sender</c-></i></code> is greatly
enhanced, and the sender algorithms are respecified in term of it.</p>
<li data-md>
<p><code class="highlight"><c- n>enable_sender</c-></code> and <code class="highlight"><c- n>enable_receiver</c-></code> traits now have default
implementations that look for nested <code class="highlight"><c- n>sender_concept</c-></code> and <code class="highlight"><c- n>receiver_concept</c-></code> types, respectively.</p>
</ul>
<h3 class="heading settled" data-level="2.2" id="r7"><span class="secno">2.2. </span><span class="content">R7</span><a class="self-link" href="#r7"></a></h3>
<p>The changes since R6 are as follows:</p>
Expand Down Expand Up @@ -6236,6 +6242,8 @@ <h3 class="heading settled" data-level="11.4" id="spec-execution.syn"><span clas
<c- k>concept</c-> <c- nc>scheduler</c-> <c- o>=</c-> <i><c- n>see</c-><c- o>-</c-><c- n>below</c-></i><c- p>;</c->

<c- c1>// [exec.recv], receivers</c->
<c- k>struct</c-> <c- nc>receiver_t</c-> <c- p>{};</c->

<c- k>template</c-><c- o>&lt;</c-><c- k>class</c-> <c- nc>R</c-><c- o>></c->
<c- kr>inline</c-> <c- k>constexpr</c-> <c- b>bool</c-> <c- n>enable_receiver</c-> <c- o>=</c-> <i><c- n>see</c-><c- o>-</c-><c- n>below</c-></i><c- p>;</c->

Expand Down Expand Up @@ -6268,6 +6276,8 @@ <h3 class="heading settled" data-level="11.4" id="spec-execution.syn"><span clas
<c- kr>inline</c-> <c- k>constexpr</c-> <c- n>start_t</c-> <c- n>start</c-><c- p>{};</c->

<c- c1>// [exec.snd], senders</c->
<c- k>struct</c-> <c- nc>sender_t</c-> <c- p>{};</c->

<c- k>template</c-><c- o>&lt;</c-><c- k>class</c-> <c- nc>S</c-><c- o>></c->
<c- kr>inline</c-> <c- k>constexpr</c-> <c- b>bool</c-> <c- n>enable_sender</c-> <c- o>=</c-> <i><c- n>see</c-> <c- n>below</c-></i><c- p>;</c->

Expand Down Expand Up @@ -6808,10 +6818,11 @@ <h4 class="heading settled" data-level="11.7.1" id="spec-execution.receiver_conc
receiver type that is usable as the first argument of a set of completion
operations corresponding to a set of completion signatures. The <code class="highlight"><c- n>get_env</c-></code> customization point is used to access a receiver’s associated environment.</p>
<pre class="highlight"><c- k>template</c-><c- o>&lt;</c-><c- k>class</c-> <c- nc>R</c-><c- o>></c->
<c- kr>inline</c-> <c- k>constexpr</c-> <c- b>bool</c-> <c- n>enable_receiver</c-> <c- o>=</c->
<c- k>requires</c-> <c- p>{</c->
<c- k>typename</c-> <c- nc>R</c-><c- o>::</c-><c- n>is_receiver</c-><c- p>;</c->
<c- p>};</c->
<c- k>concept</c-> <i><c- nc>is</c-><c- o>-</c-><c- n>receiver</c-></i> <c- o>=</c-> <c- c1>// exposition only</c->
<c- n>derived_from</c-><c- o>&lt;</c-><c- k>typename</c-> <c- nc>R</c-><c- o>::</c-><c- n>receiver_concept</c-><c- p>,</c-> <c- n>receiver_t</c-><c- o>></c-><c- p>;</c->

<c- k>template</c-><c- o>&lt;</c-><c- k>class</c-> <c- nc>R</c-><c- o>></c->
<c- kr>inline</c-> <c- k>constexpr</c-> <c- b>bool</c-> <c- n>enable_receiver</c-> <c- o>=</c-> <i><c- n>is</c-><c- o>-</c-><c- n>receiver</c-></i><c- o>&lt;</c-><c- n>R</c-><c- o>></c-><c- p>;</c->

<c- k>template</c-><c- o>&lt;</c-><c- k>class</c-> <c- nc>R</c-><c- o>></c->
<c- k>concept</c-> <c- nc>receiver</c-> <c- o>=</c->
Expand Down Expand Up @@ -7258,11 +7269,14 @@ <h4 class="heading settled" data-level="11.9.2" id="spec-execution.snd.concepts"
point object is used to access a sender’s associated attributes. The <code class="highlight"><c- n>connect</c-></code> customization point object is used to connect ([async.ops]) a
sender and a receiver to produce an operation state.</p>
<pre class="highlight"><c- k>template</c-><c- o>&lt;</c-><c- k>class</c-> <c- nc>Sigs</c-><c- o>></c->
<c- k>concept</c-> <i><c- nc>valid</c-><c- o>-</c-><c- n>completion</c-><c- o>-</c-><c- n>signatures</c-></i> <c- o>=</c-> <i><c- n>see</c-> <c- n>below</c-></i><c- p>;</c->
<c- k>concept</c-> <i><c- nc>valid</c-><c- o>-</c-><c- n>completion</c-><c- o>-</c-><c- n>signatures</c-></i> <c- o>=</c-> <i><c- n>see</c-> <c- n>below</c-></i><c- p>;</c-> <c- c1>// exposition only</c->

<c- k>template</c-><c- o>&lt;</c-><c- k>class</c-> <c- nc>S</c-><c- o>></c->
<c- k>concept</c-> <i><c- nc>is</c-><c- o>-</c-><c- n>sender</c-></i> <c- o>=</c-> <c- c1>// exposition only</c->
<c- n>derived_from</c-><c- o>&lt;</c-><c- k>typename</c-> <c- nc>S</c-><c- o>::</c-><c- n>sender_concept</c-><c- p>,</c-> <c- n>sender_t</c-><c- o>></c-><c- p>;</c->

<c- k>template</c-><c- o>&lt;</c-><c- k>class</c-> <c- nc>S</c-><c- o>></c->
<c- kr>inline</c-> <c- k>constexpr</c-> <c- b>bool</c-> <c- n>enable_sender</c-> <c- o>=</c->
<c- k>requires</c-> <c- p>{</c-> <c- k>typename</c-> <c- nc>S</c-><c- o>::</c-><c- n>is_sender</c-><c- p>;</c-> <c- p>};</c->
<c- kr>inline</c-> <c- k>constexpr</c-> <c- b>bool</c-> <c- n>enable_sender</c-> <c- o>=</c-> <i><c- n>is</c-><c- o>-</c-><c- n>sender</c-></i><c- o>&lt;</c-><c- n>S</c-><c- o>></c-><c- p>;</c->

<c- k>template</c-><c- o>&lt;</c-><i><c- n>is</c-><c- o>-</c-><c- n>awaitable</c-></i><c- o>&lt;</c-><i><c- n>env</c-><c- o>-</c-><c- n>promise</c-></i><c- o>&lt;</c-><c- n>empty_env</c-><c- o>>></c-> <c- n>S</c-><c- o>></c-> <i><c- c1>// [exec.awaitables]</c-></i>
<c- kr>inline</c-> <c- k>constexpr</c-> <c- b>bool</c-> <c- n>enable_sender</c-><c- o>&lt;</c-><c- n>S</c-><c- o>></c-> <c- o>=</c-> true<c- p>;</c->
Expand Down Expand Up @@ -7718,7 +7732,7 @@ <h5 class="heading settled" data-level="11.9.9.2" id="spec-execution.senders.jus
<p>Let <code class="highlight"><c- n>just</c-><c- o>-</c-><c- n>sender</c-></code> be the class template:</p>
<pre class="highlight"><c- k>template</c-><c- o>&lt;</c-><c- k>class</c-> <c- nc>Tag</c-><c- p>,</c-> <i><c- n>movable</c-><c- o>-</c-><c- n>value</c-></i><c- p>...</c-> <c- n>Ts</c-><c- o>></c-> <c- c1>// arguments are not associated entities ([lib.tmpl-heads])</c->
<c- k>struct</c-> <i><c- nc>just</c-><c- o>-</c-><c- n>sender</c-></i> <c- p>{</c-> <c- c1>// exposition only</c->
<c- k>using</c-> <c- n>is_sender</c-> <c- o>=</c-> <i><c- n>unspecified</c-></i><c- p>;</c->
<c- k>using</c-> <c- n>sender_concept</c-> <c- o>=</c-> <c- n>sender_t</c-><c- p>;</c->
<c- k>using</c-> <c- n>completion_signatures</c-> <c- o>=</c->
<c- n>execution</c-><c- o>::</c-><c- n>completion_signatures</c-><c- o>&lt;</c-><c- n>Tag</c-><c- p>(</c-><c- n>Ts</c-><c- p>...)</c-><c- o>></c-><c- p>;</c->

Expand Down Expand Up @@ -7783,7 +7797,7 @@ <h5 class="heading settled" data-level="11.9.9.3" id="spec-execution.senders.rea
<p><code class="highlight"><i><c- n>read</c-><c- o>-</c-><c- n>sender</c-></i></code> is the exposition-only class template:</p>
<pre class="highlight"><c- k>template</c-><c- o>&lt;</c-><c- k>class</c-> <c- nc>Tag</c-><c- o>></c->
<c- k>struct</c-> <i><c- nc>read</c-><c- o>-</c-><c- n>sender</c-></i> <c- p>{</c-> <c- c1>// exposition only</c->
<c- k>using</c-> <c- n>is_sender</c-> <c- o>=</c-> <i><c- n>unspecified</c-></i><c- p>;</c->
<c- k>using</c-> <c- n>sender_concept</c-> <c- o>=</c-> <c- n>sender_t</c-><c- p>;</c->
<c- k>template</c-><c- o>&lt;</c-><c- k>class</c-> <c- nc>R</c-><c- o>></c->
<c- k>struct</c-> <i><c- nc>operation</c-><c- o>-</c-><c- n>state</c-></i> <c- p>{</c-> <c- c1>// exposition only</c->
<c- n>R</c-> <c- n>r_</c-><c- p>;</c-> <c- c1>// exposition only</c->
Expand Down Expand Up @@ -8744,7 +8758,7 @@ <h5 class="heading settled" data-level="11.9.11.1" id="spec-execution.senders.co
<p>Let <code class="highlight"><c- n>s</c-></code> be a subexpression such that <code class="highlight"><c- n>S</c-></code> is <code class="highlight"><c- k>decltype</c-><c- p>((</c-><c- n>s</c-><c- p>))</c-></code>, and let <code class="highlight"><i><c- n>detached</c-><c- o>-</c-><c- n>receiver</c-></i></code> and <code class="highlight"><i><c- n>detached</c-><c- o>-</c-><c- n>operation</c-></i></code> be the following exposition-only
class types:</p>
<pre class="highlight"><c- k>struct</c-> <i><c- nc>detached</c-><c- o>-</c-><c- n>receiver</c-></i> <c- p>{</c->
<c- k>using</c-> <c- n>is_receiver</c-> <c- o>=</c-> <i><c- n>unspecified</c-></i><c- p>;</c->
<c- k>using</c-> <c- n>receiver_concept</c-> <c- o>=</c-> <c- n>receiver_t</c-><c- p>;</c->
<i><c- n>detached</c-><c- o>-</c-><c- n>operation</c-></i><c- o>*</c-> <i><c- n>op</c-></i><c- p>;</c-> <c- c1>// </c-><i><c- c1>exposition only</c-></i>

<c- k>friend</c-> <c- b>void</c-> <c- nf>tag_invoke</c-><c- p>(</c-><c- n>set_value_t</c-><c- p>,</c-> <i><c- n>detached</c-><c- o>-</c-><c- n>receiver</c-></i><c- o>&amp;&amp;</c-> <c- n>self</c-><c- p>)</c-> <c- k>noexcept</c-> <c- p>{</c-> <c- k>delete</c-> <c- n>self</c-><c- p>.</c-><c- n>op</c-><c- p>;</c-> <c- p>}</c->
Expand Down Expand Up @@ -8903,7 +8917,7 @@ <h4 class="heading settled" data-level="11.11.1" id="spec-execution.snd_rec_util
<c- k>class</c-> <c- nc>receiver_adaptor</c-> <c- p>{</c->
<c- k>friend</c-> <c- n>Derived</c-><c- p>;</c->
<c- k>public</c-><c- o>:</c->
<c- k>using</c-> <c- n>is_receiver</c-> <c- o>=</c-> <i><c- n>unspecified</c-></i><c- p>;</c->
<c- k>using</c-> <c- n>receiver_concept</c-> <c- o>=</c-> <c- n>receiver_t</c-><c- p>;</c->

<c- c1>// Constructors</c->
<c- n>receiver_adaptor</c-><c- p>()</c-> <c- o>=</c-> <c- k>default</c-><c- p>;</c->
Expand Down Expand Up @@ -9442,7 +9456,7 @@ <h4 class="heading settled" data-level="11.13.1" id="spec-execution.coro_utils.a
<li data-md>
<p><code class="highlight"><i><c- n>awaitable</c-><c- o>-</c-><c- n>receiver</c-></i></code> is equivalent to the following:</p>
<pre class="highlight"><c- k>struct</c-> <i><c- nc>awaitable</c-><c- o>-</c-><c- n>receiver</c-></i> <c- p>{</c->
<c- k>using</c-> <c- n>is_receiver</c-> <c- o>=</c-> <i><c- n>unspecified</c-></i><c- p>;</c->
<c- k>using</c-> <c- n>receiver_concept</c-> <c- o>=</c-> <c- n>receiver_t</c-><c- p>;</c->
<c- n>variant</c-><c- o>&lt;</c-><c- n>monostate</c-><c- p>,</c-> <c- n>result_t</c-><c- p>,</c-> <c- n>exception_ptr</c-><c- o>>*</c-> <i><c- n>result_ptr_</c-></i><c- p>;</c->
<c- n>coroutine_handle</c-><c- o>&lt;</c-><c- n>P</c-><c- o>></c-> <i><c- n>continuation_</c-></i><c- p>;</c->
<c- c1>// ... </c-><i><c- c1>see below</c-></i>
Expand Down

0 comments on commit d0a90ea

Please sign in to comment.