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

95 lines
4.3 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[exec.getcomplsigs]
# 33 Execution control library [[exec]](./#exec)
## 33.9 Senders [[exec.snd]](exec.snd#exec.getcomplsigs)
### 33.9.9 execution::get_completion_signatures [exec.getcomplsigs]
[🔗](#itemdecl:1)
`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](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L2634)
Let except be an rvalue subexpression of
an unspecified class type Except such that[move_constructible](concept.moveconstructible#concept:move_constructible "18.4.13Concept move_­constructible[concept.moveconstructible]")<Except> && [derived_from](concept.derived#concept:derived_from "18.4.3Concept derived_­from[concept.derived]")<Except, exception> is true[.](#1.sentence-1)
Let *CHECKED-COMPLSIGS*(e) be e if e is a core constant expression whose
type satisfies [*valid-completion-signatures*](execution.syn#concept:valid-completion-signatures "33.4Header <execution> synopsis[execution.syn]");
otherwise, it is the following expression:(e, throw except, completion_signatures())
Let *get-complsigs*<Sndr, Env...>() be expression-equivalent toremove_reference_t<Sndr>::template get_completion_signatures<Sndr, Env...>()[.](#1.sentence-3)
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<Sndr>(), declval<Env>()...),
declval<Sndr>(),
declval<Env>()...)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L2660)
*Constraints*: sizeof...(Env) <= 1 is true[.](#2.sentence-1)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L2664)
*Effects*: Equivalent to: return e; where e is expression-equivalent to the following:
- [(3.1)](#3.1)
*CHECKED-COMPLSIGS*(*get-complsigs*<NewSndr, Env...>()) if *get-complsigs*<NewSndr, Env
...>() is a well-formed expression[.](#3.1.sentence-1)
- [(3.2)](#3.2)
Otherwise,*CHECKED-COMPLSIGS*(*get-complsigs*<NewSndr>()) if *get-complsigs*<NewSndr>() is a well-formed expression[.](#3.2.sentence-1)
- [(3.3)](#3.3)
Otherwise,completion_signatures<*SET-VALUE-SIG*(*await-result-type*<NewSndr, *env-promise*<Env>...>), // [[exec.snd.concepts]](exec.snd.concepts "33.9.3Sender concepts") set_error_t(exception_ptr),
set_stopped_t()> if [*is-awaitable*](exec.awaitable#concept:is-awaitable "33.9.4Awaitable helpers[exec.awaitable]")<NewSndr, *env-promise*<Env>...> is true[.](#3.3.sentence-1)
- [(3.4)](#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.4.sentence-1)
- [(3.5)](#3.5)
Otherwise,(throw except, completion_signatures())[.](#3.5.sentence-1)
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L2706)
Given a type Env, ifcompletion_signatures_of_t<Sndr> andcompletion_signatures_of_t<Sndr, Env> are both well-formed,
they shall denote the same type[.](#4.sentence-1)
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L2713)
Let rcvr be an rvalue
whose type Rcvr models [receiver](exec.recv.concepts#concept:receiver "33.7.1Receiver concepts[exec.recv.concepts]"), and
let Sndr be the type of a sender
such that [sender_in](exec.snd.concepts#concept:sender_in "33.9.3Sender concepts[exec.snd.concepts]")<Sndr, env_of_t<Rcvr>> is true[.](#5.sentence-1)
Let Sigs... be the template arguments of
the completion_signatures specialization
named by completion_signatures_of_t<Sndr, env_of_t<Rcvr>>[.](#5.sentence-2)
Let CSO be a completion function[.](#5.sentence-3)
If sender Sndr or its operation state cause
the expression CSO(rcvr, args...) to be potentially evaluated ([[basic.def.odr]](basic.def.odr "6.3One-definition rule"))
then there shall be a signature Sig in Sigs... such that*MATCHING-SIG*(*decayed-typeof*<CSO>(decltype(args)...), Sig) is true ([[exec.general]](exec.general "33.1General"))[.](#5.sentence-4)