4.3 KiB
[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.4 Header <execution> synopsis [execution.syn]") auto;
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()...)
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()) if get-complsigs() is a well-formed expression.
-
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.
-
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. -
Otherwise,(throw except, completion_signatures()).
Given a type Env, ifcompletion_signatures_of_t andcompletion_signatures_of_t<Sndr, Env> are both well-formed, they shall denote the same type.
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]).