Files
cppdraft_translate/cppdraft/exec/getcomplsigs.md
2025-10-25 03:02:53 +03:00

4.3 KiB
Raw Blame History

[exec.getcomplsigs]

33 Execution control library [exec]

33.9 Senders [exec.snd]

33.9.9 execution::get_completion_signatures [exec.getcomplsigs]

🔗

template<class Sndr, class... Env> consteval auto get_completion_signatures() -> [valid-completion-signatures](execution.syn#concept:valid-completion-signatures "33.4Header <execution> synopsis[execution.syn]") auto;

1

#

Let except be an rvalue subexpression of an unspecified class type Except such thatmove_constructible && derived_from<Except, exception> is true.

Let CHECKED-COMPLSIGS(e) be e if e is a core constant expression whose type satisfies valid-completion-signatures; otherwise, it is the following expression:(e, throw except, completion_signatures())

Let get-complsigs<Sndr, Env...>() be expression-equivalent toremove_reference_t::template get_completion_signatures<Sndr, Env...>().

Let NewSndr be Sndr if sizeof...(Env) == 0 is true; otherwise, decltype(s) where s is the following expression:transform_sender(get-domain-late(declval(), declval()...), declval(), declval()...)

2

#

Constraints: sizeof...(Env) <= 1 is true.

3

#

Effects: Equivalent to: return e; where e is expression-equivalent to the following:

  • (3.1)

    CHECKED-COMPLSIGS(get-complsigs<NewSndr, Env...>()) if get-complsigs<NewSndr, Env
    ...>() is a well-formed expression.

  • (3.2)

    Otherwise,CHECKED-COMPLSIGS(get-complsigs()) if get-complsigs() is a well-formed expression.

  • (3.3)

    Otherwise,completion_signatures<SET-VALUE-SIG(await-result-type<NewSndr, env-promise...>), // [exec.snd.concepts] set_error_t(exception_ptr), set_stopped_t()> if is-awaitable<NewSndr, env-promise...> is true.

  • (3.4)

    Otherwise,(throw dependent-sender-error(), completion_signatures()) if sizeof...(
    Env) == 0 is true, where dependent-sender-error isdependent_sender_error or an unspecified type derived publicly and unambiguously fromdependent_sender_error.

  • (3.5)

    Otherwise,(throw except, completion_signatures()).

4

#

Given a type Env, ifcompletion_signatures_of_t andcompletion_signatures_of_t<Sndr, Env> are both well-formed, they shall denote the same type.

5

#

Let rcvr be an rvalue whose type Rcvr models receiver, and let Sndr be the type of a sender such that sender_in<Sndr, env_of_t> is true.

Let Sigs... be the template arguments of the completion_signatures specialization named by completion_signatures_of_t<Sndr, env_of_t>.

Let CSO be a completion function.

If sender Sndr or its operation state cause the expression CSO(rcvr, args...) to be potentially evaluated ([basic.def.odr]) then there shall be a signature Sig in Sigs... such thatMATCHING-SIG(decayed-typeof(decltype(args)...), Sig) is true ([exec.general]).