From d0a90ead0b5870cb7e46b6a358a2c6a64ffca989 Mon Sep 17 00:00:00 2001 From: ericniebler Date: Sun, 10 Dec 2023 03:45:43 +0000 Subject: [PATCH] Publish: Merge pull request #154 from cplusplus/concept-opt-in-defaults rename `is_sender`/`is_receiver` to `sender_concept`/`receiver_concept` 58614d0961c0a8844f47e437b382b7b79e1b1169 --- execution.html | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/execution.html b/execution.html index 880aa51..6a23507 100644 --- a/execution.html +++ b/execution.html @@ -2246,7 +2246,7 @@

D2300R8
std::execution

-

Draft Proposal,

+

Draft Proposal,

Authors: @@ -2965,7 +2965,7 @@

}; struct _sender { - using is_sender = void; + using sender_concept = std::execution::sender_t; using completion_signatures = std::execution::completion_signatures<std::execution::set_value_t()>; @@ -3657,9 +3657,15 @@

2.1.
  • The sender_in<Sndr, Env> concept requires that E satisfies queryable.

    + +

    Enhancements:

    +
    • The exposition-only class template basic-sender is greatly enhanced, and the sender algorithms are respecified in term of it.

      +
    • +

      enable_sender and enable_receiver traits now have default +implementations that look for nested sender_concept and receiver_concept types, respectively.

    2.2. R7

    The changes since R6 are as follows:

    @@ -6236,6 +6242,8 @@

    concept scheduler = see-below; // [exec.recv], receivers + struct receiver_t {}; + template<class R> inline constexpr bool enable_receiver = see-below; @@ -6268,6 +6276,8 @@

    inline constexpr start_t start{}; // [exec.snd], senders + struct sender_t {}; + template<class S> inline constexpr bool enable_sender = see below; @@ -6808,10 +6818,11 @@

    get_env customization point is used to access a receiver’s associated environment.

    template<class R>
    -  inline constexpr bool enable_receiver =
    -    requires {
    -      typename R::is_receiver;
    -    };
    +  concept is-receiver = // exposition only
    +    derived_from<typename R::receiver_concept, receiver_t>;
    +
    +template<class R>
    +  inline constexpr bool enable_receiver = is-receiver<R>;
     
     template<class R>
       concept receiver =
    @@ -7258,11 +7269,14 @@ 

    connect customization point object is used to connect ([async.ops]) a sender and a receiver to produce an operation state.

    template<class Sigs>
    -  concept valid-completion-signatures = see below;
    +  concept valid-completion-signatures = see below; // exposition only
    +
    +template<class S>
    +  concept is-sender = // exposition only
    +    derived_from<typename S::sender_concept, sender_t>;
     
     template<class S>
    -  inline constexpr bool enable_sender =
    -    requires { typename S::is_sender; };
    +  inline constexpr bool enable_sender = is-sender<S>;
     
     template<is-awaitable<env-promise<empty_env>> S> // [exec.awaitables]
       inline constexpr bool enable_sender<S> = true;
    @@ -7718,7 +7732,7 @@ 
    just-sender be the class template:

    template<class Tag, movable-value... Ts> // arguments are not associated entities ([lib.tmpl-heads])
     struct just-sender { // exposition only
    -  using is_sender = unspecified;
    +  using sender_concept = sender_t;
       using completion_signatures =
         execution::completion_signatures<Tag(Ts...)>;
     
    @@ -7783,7 +7797,7 @@ 
    read-sender is the exposition-only class template:

    template<class Tag>
       struct read-sender { // exposition only
    -    using is_sender = unspecified;
    +    using sender_concept = sender_t;
         template<class R>
           struct operation-state { // exposition only
             R r_; // exposition only
    @@ -8744,7 +8758,7 @@ 
    s be a subexpression such that S is decltype((s)), and let detached-receiver and detached-operation be the following exposition-only class types:

    struct detached-receiver {
    -  using is_receiver = unspecified;
    +  using receiver_concept = receiver_t;
       detached-operation* op; // exposition only
     
       friend void tag_invoke(set_value_t, detached-receiver&& self) noexcept { delete self.op; }
    @@ -8903,7 +8917,7 @@ 

    awaitable-receiver is equivalent to the following:

    struct awaitable-receiver {
    -  using is_receiver = unspecified;
    +  using receiver_concept = receiver_t;
       variant<monostate, result_t, exception_ptr>* result_ptr_;
       coroutine_handle<P> continuation_;
       // ... see below