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

2.5 KiB

[exec.snd.general]

33 Execution control library [exec]

33.9 Senders [exec.snd]

33.9.1 General [exec.snd.general]

1

#

Subclauses [exec.factories] and [exec.adapt] define customizable algorithms that return senders.

Each algorithm has a default implementation.

Let sndr be the result of an invocation of such an algorithm or an object equal to the result ([concepts.equality]), and let Sndr be decltype((sndr)).

Let rcvr be a receiver of type Rcvr with associated environment env of type Env such that sender_to<Sndr, Rcvr> is true.

For the default implementation of the algorithm that produced sndr, connecting sndr to rcvr and starting the resulting operation state ([exec.async.ops]) necessarily results in the potential evaluation ([basic.def.odr]) of a set of completion operations whose first argument is a subexpression equal to rcvr.

Let Sigs be a pack of completion signatures corresponding to this set of completion operations, and let CS be the type of the expression get_completion_signatures<Sndr, Env>().

Then CS is a specialization of the class template completion_signatures ([exec.cmplsig]), the set of whose template arguments is Sigs.

If none of the types in Sigs are dependent on the type Env, then the expression get_completion_signatures() is well-formed and its type is CS.

If a user-provided implementation of the algorithm that produced sndr is selected instead of the default:

  • (1.1)

    Any completion signature that is in the set of types denoted by completion_signatures_of_t<Sndr, Env> and that is not part of Sigs shall correspond to error or stopped completion operations, unless otherwise specified.

  • (1.2)

    If none of the types in Sigs are dependent on the type Env, thencompletion_signatures_of_t andcompletion_signatures_of_t<Sndr, Env> shall denote the same type.