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 auto;
Let except be an rvalue subexpression of an unspecified class type Except such that move_constructible<Except> && 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 to remove_reference_t<Sndr>​::​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( declval<Sndr>(), declval<Env>()...)
Constraints: sizeof...(Env) <= 1 is true.
Effects: Equivalent to: return e; where e is expression-equivalent to the following:
  • CHECKED-COMPLSIGS(get-complsigs<NewSndr, Env...>()) if get-complsigs<NewSndr, Env
    ...>()
    is a well-formed expression.
  • Otherwise, CHECKED-COMPLSIGS(get-complsigs<NewSndr>()) if get-complsigs<NewSndr>() is a well-formed expression.
  • Otherwise, completion_signatures< SET-VALUE-SIG(await-result-type<NewSndr, env-promise<Env>...>), // [exec.snd.concepts] set_error_t(exception_ptr), set_stopped_t()> if is-awaitable<NewSndr, env-promise<Env>...> is true.
  • Otherwise, (throw dependent-sender-error(), completion_signatures()) if sizeof...(
    Env) == 0
    is true, where dependent-sender-error is dependent_sender_error or an unspecified type derived publicly and unambiguously from dependent_sender_error.
  • Otherwise, (throw except, completion_signatures()).
Given a type Env, if completion_signatures_of_t<Sndr> and completion_signatures_of_t<Sndr, Env> are both well-formed, the former shall be a superset of the latter, with the difference corresponding to error or stopped completion operations.
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<Rcvr>> is true.
Let Sigs... be the template arguments of the completion_signatures specialization named by completion_signatures_of_t<Sndr, env_of_t<Rcvr>>.
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 that MATCHING-SIG(decayed-typeof<CSO>(decltype(args)...), Sig) is true ([exec.general]).