From 515efa9a5c94dc0dd249e77842e2877cf5c715d7 Mon Sep 17 00:00:00 2001 From: ericniebler Date: Fri, 10 Nov 2023 23:13:22 +0000 Subject: [PATCH] Publish: reword `then`, fix spelling errors 44e5a4fb2e54628d206beba49b728525a33235f7 --- execution.html | 114 ++++++++++++++++++++++------------------- receiver_redesign.html | 2 +- 2 files changed, 61 insertions(+), 55 deletions(-) diff --git a/execution.html b/execution.html index d68a4c4..dd4382d 100644 --- a/execution.html +++ b/execution.html @@ -2246,7 +2246,7 @@

D2300R8
std::execution

-

Draft Proposal,

+

Draft Proposal,

Authors: @@ -7004,7 +7004,7 @@

For a subexpression c, let GET-AWAITER(c, p) be expression-equivalent to the series of transformations and conversions applied to c as the operand of an await-expression in a coroutine, -resulting in lvalue e as described by [expr.await]/3.2-4, where p is an lvalue refering to the coroutine’s promise type, P. This includes the invocation of the promise type’s await_transform member if any, the invocation of the operator co_await picked by overload resolution if any, and any necessary implicit +resulting in lvalue e as described by [expr.await]/3.2-4, where p is an lvalue referring to the coroutine’s promise type, P. This includes the invocation of the promise type’s await_transform member if any, the invocation of the operator co_await picked by overload resolution if any, and any necessary implicit conversions and materializations.

I have opened cwg#250 to give these transformations a term-of-art so we can more easily refer to it here.
@@ -7306,7 +7306,7 @@
tag_invoke(transfer_just, s, vs...), if that expression is valid. Let as be a pack of rvalue subexpressions of types decay_t<Vs>... refering to objects direct-initilized from vs. If the function +

tag_invoke(transfer_just, s, vs...), if that expression is valid. Let as be a pack of rvalue subexpressions of types decay_t<Vs>... referring to objects direct-initilized from vs. If the function selected by tag_invoke does not return a sender whose asynchronous operations execute value completion operations on an execution agent belonging to the execution resource associated with s, with value result @@ -7492,7 +7492,7 @@

on adapts an input sender into a sender that will start on an execution agent belonging to a particular scheduler’s associated execution resource.

  • -

    Let replace-scheduler(e, sch) be an expression denoting an object e' such that get_scheduler(e) returns a copy of sch, and tag_invoke(tag, e', args...) is expression-equivalent to tag(e, args...) for all arguments args... and for all tag whose type satisfies forwarding-query and is not get_scheduler_t.

    +

    Let replace-scheduler(e, sch) be an expression denoting an object e2 such that get_scheduler(e2) returns a copy of sch, and tag_invoke(tag, e2, args...) is expression-equivalent to tag(e, args...) for all arguments args... and for all tag whose type satisfies forwarding-query and is not get_scheduler_t.

  • The name on denotes a customization point object. For some subexpressions sch and s, let Sch be decltype((sch)) and S be decltype((s)). If Sch does not satisfy scheduler, or S does not satisfy sender, on is ill-formed. Otherwise, the expression on(sch, s) is expression-equivalent to:

      @@ -7532,11 +7532,11 @@
      s1 and e, where s1 is a sender returned from on or a copy of such, let S1 be decltype((s1)). -Let E' be decltype((replace-scheduler(e, sch))). +Let E2 be decltype((replace-scheduler(e, sch))). Then the type of tag_invoke(get_completion_signatures, s1, e) shall be:

      make_completion_signatures<
         copy_cvref_t<S1, S>,
      -  E',
      +  E2,
         make_completion_signatures<
           schedule_result_t<Sch>,
           E,
      @@ -7600,10 +7600,10 @@ 
      s2. When s2 is connected with some receiver out_r, it:

      1. -

        Constructs a receiver r such that when a receiver completion operation Tag(r, args...) is called, it decay-copies args... into op_state (see below) as args'... and constructs a receiver r2 such that:

        +

        Constructs a receiver r such that when a receiver completion operation Tag(r, args...) is called, it decay-copies args... into op_state (see below) as args2... and constructs a receiver r2 such that:

        1. -

          When set_value(r2) is called, it calls Tag(out_r, std::move(args')...).

          +

          When set_value(r2) is called, it calls Tag(out_r, std::move(args2)...).

        2. set_error(r2, e) is expression-equivalent to set_error(out_r, e).

        3. @@ -7668,68 +7668,74 @@
          then attaches an invocable as a continuation for an input sender’s value completion operation.

        4. -

          The name then denotes a customization point object. For some -subexpressions s and f, let S be decltype((s)), let F be the -decayed type of f, and let f' be an xvalue refering to an object -decay-copied from f. If S does not satisfy sender, or F does not model movable-value, then is -ill-formed. Otherwise, the expression then(s, f) is -expression-equivalent to:

          +

          The name then denotes a customization point object. For some subexpressions s and f, let S be decltype((s)) and let F be the decayed type of f. If S does not satisfy sender, or F does not model movable-value, then(s, f) is ill-formed. Otherwise, +the expression then(s, f) is expression-equivalent to:

          1. -

            tag_invoke(then, get_completion_scheduler<set_value_t>(get_env(s)), s, f), if that expression is valid.

            +

            tag_invoke(then, get_completion_scheduler<set_value_t>(get_env(s)), s, f), +if that expression is valid.

            • -

              Mandates: The type of the tag_invoke expression above satisfies sender.

              +

              Mandates: The type of the tag_invoke expression above + satisfies sender.

          2. Otherwise, tag_invoke(then, s, f), if that expression is valid.

            • -

              Mandates: The type of the tag_invoke expression above satisfies sender.

              +

              Mandates: The type of the tag_invoke expression above + satisfies sender.

          3. -

            Otherwise, constructs a sender s2. When s2 is connected with some receiver out_r, it:

            +

            Otherwise, a sender expression out_s such that when out_s is + connected with some receiver out_r, it returns an operation state o containing copies of f and out_r and the result of calling connect(s2, r), where s2 is a reference to an object decay-copied + from s and that has the same _cv_ qualifiers and value category as out_s; and where r is a receiver as described below.

            1. -

              Constructs a receiver r such that:

              +

              Let f2 and out_r2 be xvalues referring respectively to the copies + of f and out_r in o. The receiver r behaves as follows:

              1. -

                When set_value(r, args...) is called, let v be the -expression invoke(f', args...). If decltype(v) is void, -calls set_value(out_r); otherwise, it calls set_value(out_r, v). If any of these throw an -exception, it catches it and calls set_error(out_r, current_exception()). If any of these expressions would be -ill-formed, the expression set_value(r, args...) is -ill-formed.

                +

                When set_value(r, args...) is called, let v be the expression invoke(f2, args...). If decltype(v) is void, evaluates v and calls set_value(out_r); otherwise, it calls set_value(out_r2, v). If any of these throw an exception, the +exception is caught and set_error(out_r2, current_exception()) is called. If any of these expressions would be ill-formed, the +expression set_value(r, args...) is ill-formed.

              2. -

                set_error(r, e) is expression-equivalent to set_error(out_r, e).

                +

                set_error(r, e) is expression-equivalent to set_error(out_r2, e).

              3. -

                set_stopped(r) is expression-equivalent to set_stopped(out_r).

                +

                set_stopped(r) is expression-equivalent to set_stopped(out_r2).

            2. -

              Returns an expression-equivalent to connect(s, r).

              -
            3. -

              Let compl-sig-t<Tag, Args...> name the type Tag() if Args... is a template paramter pack containing the -single type void; otherwise, Tag(Args...). Given -subexpressions s2 and e where s2 is a sender returned from then or a copy of such, let S2 be decltype((s2)) and let E be decltype((e)). The type of tag_invoke(get_completion_signatures, s2, e) shall be equivalent -to:

              +

              Let inner_op be a non-const lvalue referring to the operation + state in o. start(o) is expression-equivalent to start(inner_op).

              +
            +
          +
        5. +

          Given subexpressions out_s and e where out_s is a sender +returned from then(s, f) or a copy of such, let OutS be decltype((out_s)) and let E be decltype((e)). The type of tag_invoke(get_completion_signatures, out_s, e) shall be:

          make_completion_signatures<
          -  copy_cvref_t<S2, S>, E, set-error-signature,
          +  clone-cvref-t<OutS, S>, E, set-error-signature,
               set-value-completions>;
           
          -

          where set-value-completions is an alias for:

          +

          where set-value-completions is the alias +template:

          template<class... As>
          -  set-value-completions =
          -    completion_signatures<compl-sig-t<set_value_t, invoke_result_t<F, As...>>>
          +  using set-value-completions =
          +    completion_signatures<SET-VALUE-SIG(invoke_result_t<F, As...>)>
           
          -

          and set-error-signature is an alias for completion_signatures<set_error_t(exception_ptr)> if any of the types -in the type-list named by value_types_of_t<copy_cvref_t<S2, S>, E, potentially-throwing, type-list> are true_type; otherwise, completion_signatures<>, where potentially-throwing is the template alias:

          +

          and set-error-signature is an alias for completion_signatures<set_error_t(exception_ptr)> if any of the +types in the type-list named by value_types_of_t<clone-cvref-t<OutS, S>, E, potentially-throwing, type-list> are true_type; otherwise, completion_signatures<>, where potentially-throwing is the template alias:

          template<class... As>
             using potentially-throwing =
          -    bool_constant<!is_nothrow_invocable_v<F, As...>>;
          +    negation<is_nothrow_invocable<F, As...>>;
           
          -
        +
      2. +

        The expression then(s, f) has undefined behavior unless it returns a sender out_s that:

        +
          +
        1. +

          Invokes f or a copy of such with the value result datums of s using the result value of f as out_s’s value completion, and

          +
        2. +

          Forwards the non-value completion operations unchanged.

        -

        If the function selected above does not return a sender that invokes f with the value result datums of s using f’s return value as the sender’s value completion, and forwards the non-value completion operations unchanged, the behavior of calling then(s, f) is undefined.

      11.9.6.7. execution::upon_error [exec.upon.error]
        @@ -7739,7 +7745,7 @@
        upon_error denotes a customization point object. For some subexpressions s and f, let S be decltype((s)), let F be the -decayed type of f, and let f' be an xvalue refering to an object +decayed type of f, and let f2 be an xvalue referring to an object decay-copied from f. If S does not satisfy sender, or F does not model movable-value, upon_error is ill-formed. Otherwise, the expression upon_error(s, f) is expression-equivalent to:

        @@ -7766,7 +7772,7 @@
        set_value(r, args...) is expression-equivalent to set_value(out_r, args...).

      1. When set_error(r, e) is called, let v be the -expression invoke(f', e). If decltype(v) is void, calls set_value(out_r); otherwise, it calls set_value(out_r, v). If any of these throw an +expression invoke(f2, e). If decltype(v) is void, calls set_value(out_r); otherwise, it calls set_value(out_r, v). If any of these throw an exception, it catches it and calls set_error(out_r, current_exception()). If any of these expressions would be ill-formed, the expression set_error(r, e) is ill-formed.

        @@ -7776,7 +7782,7 @@
        connect(s, r).

      2. -

        Let compl-sig-t<Tag, Args...> name the type Tag() if Args... is a template paramter pack containing the +

        Let compl-sig-t<Tag, Args...> name the type Tag() if Args... is a template parameter pack containing the single type void; otherwise, Tag(Args...). Given subexpressions s2 and e where s2 is a sender returned from upon_error or a copy of such, let S2 be decltype((s2)) and let E be decltype((e)). The type of tag_invoke(get_completion_signatures, s2, e) shall be equivalent to:

        @@ -7807,7 +7813,7 @@
        upon_stopped denotes a customization point object. For some subexpressions s and f, let S be decltype((s)), let F be the -decayed type of f, and let f' be an xvalue refering to an object +decayed type of f, and let f2 be an xvalue referring to an object decay-copied from f. If S does not satisfy sender, or F does not model both movable-value and invocable, upon_stopped is ill-formed. Otherwise, the expression upon_stopped(s, f) is expression-equivalent to:

        1. @@ -7834,7 +7840,7 @@
          set_error(r, e) is expression-equivalent to set_error(out_r, e).

        2. When set_stopped(r) is called, let v be the -expression invoke(f'). If v has type void, calls set_value(out_r); otherwise, calls set_value(out_r, v). If any of these throw an +expression invoke(f2). If v has type void, calls set_value(out_r); otherwise, calls set_value(out_r, v). If any of these throw an exception, it catches it and calls set_error(out_r, current_exception()). If any of these expressions would be ill-formed, the expression set_stopped(r) is ill-formed.

          @@ -7842,7 +7848,7 @@
          connect(s, r).

        3. -

          Let compl-sig-t<Tag, Args...> name the type Tag() if Args... is a template paramter pack containing the +

          Let compl-sig-t<Tag, Args...> name the type Tag() if Args... is a template parameter pack containing the single type void; otherwise, Tag(Args...). Given subexpressions s2 and e where s2 is a sender returned from upon_stopped or a copy of such, let S2 be decltype((s2)) and let E be decltype((e)). The type of tag_invoke(get_completion_signatures, s2, e) shall be equivalent to:

          @@ -7868,7 +7874,7 @@
          let_value, let_error, and let_stopped denote customization point objects. Let the expression let-cpo be one of let_value, let_error, or let_stopped. -For subexpressions s and f, let S be decltype((s)), let F be the decayed type of f, and let f' be an xvalue that refers to an object decay-copied from f. +For subexpressions s and f, let S be decltype((s)), let F be the decayed type of f, and let f2 be an xvalue that refers to an object decay-copied from f. If S does not satisfy sender, the expression let-cpo(s, f) is ill-formed. If F does not satisfy invocable, the expression let_stopped(s, f) is ill-formed. Otherwise, the expression let-cpo(s, f) is expression-equivalent to:

          @@ -7886,7 +7892,7 @@
          tag_invoke expression above satisfies sender.

        4. -

          Otherwise, given a receiver out_r and an lvalue out_r' refering to an object decay-copied from out_r.

          +

          Otherwise, given a receiver out_r and an lvalue out_r' referring to an object decay-copied from out_r.

          1. For let_value, let set-cpo be set_value. @@ -7897,7 +7903,7 @@

            r be an rvalue of a receiver type R such that:

            1. -

              When set-cpo(r, args...) is called, the receiver r decay-copies args... into op_state2 as args'..., then calls invoke(f', args'...), resulting in a sender s3. +

              When set-cpo(r, args...) is called, the receiver r decay-copies args... into op_state2 as args2..., then calls invoke(f2, args2...), resulting in a sender s3. It then calls connect(s3, std::move(out_r')), resulting in an operation state op_state3. op_state3 is saved as a part of op_state2. It then calls start(op_state3). If any of these throws an exception, it catches it and calls set_error(std::move(out_r'), current_exception()). @@ -7993,7 +7999,7 @@

              f(i, args...) for each i of type Shape from 0 to shape where args is a pack of subexpressions refering to the value completion +

              If the function selected above does not return a sender that invokes f(i, args...) for each i of type Shape from 0 to shape where args is a pack of subexpressions referring to the value completion result datums of the input sender, or does not execute a value completion operation with said datums, the behavior of calling bulk(s, shape, f) is undefined.

            @@ -9027,8 +9033,8 @@

            completion_signatures.

          2. [Example:

            -
            // Given a sender S and an environment Env, adapt S’s completion
            -// signatures by lvalue-ref qualifying the values, adding an additional
            +
            // Given a sender S and an environment Env, adapt the completion
            +// signatures of S by lvalue-ref qualifying the values, adding an additional
             // exception_ptr error completion if its not already there, and leaving the
             // other completion signatures alone.
             template<class... Args>
            diff --git a/receiver_redesign.html b/receiver_redesign.html
            index a7ef5e4..12ebd00 100644
            --- a/receiver_redesign.html
            +++ b/receiver_redesign.html
            @@ -2162,7 +2162,7 @@
               

            P2532R0
            Removing exception_ptr from the Receiver Concepts

            -

            Published Proposal,

            +

            Published Proposal,

            Author: