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

2.9 KiB

[exec.adapt.general]

33 Execution control library [exec]

33.9 Senders [exec.snd]

33.9.12 Sender adaptors [exec.adapt]

33.9.12.1 General [exec.adapt.general]

1

#

Subclause [exec.adapt] specifies a set of sender adaptors.

2

#

The bitwise inclusive or operator is overloaded for the purpose of creating sender chains.

The adaptors also support function call syntax with equivalent semantics.

3

#

Unless otherwise specified:

  • (3.1)

    A sender adaptor is prohibited from causing observable effects, apart from moving and copying its arguments, before the returned sender is connected with a receiver using connect, and start is called on the resulting operation state.

  • (3.2)

    A parent sender ([exec.async.ops]) with a single child sender sndr has an associated attribute object equal toFWD-ENV(get_env(sndr)) ([exec.fwd.env]).

  • (3.3)

    A parent sender with more than one child sender has an associated attributes object equal to env<>{}.

  • (3.4)

    When a parent sender is connected to a receiver rcvr, any receiver used to connect a child sender has an associated environment equal to FWD-ENV(get_env(rcvr)).

  • (3.5)

    An adaptor whose child senders are all non-dependent ([exec.async.ops]) is itself non-dependent.

  • (3.6)

    These requirements apply to any function that is selected by the implementation of the sender adaptor.

  • (3.7)

    Recommended practice: Implementations should use the completion signatures of the adaptors to communicate type errors to users and to propagate any such type errors from child senders.

4

#

If a sender returned from a sender adaptor specified in [exec.adapt] is specified to include set_error_t(Err) among its set of completion signatures where decay_t denotes the type exception_ptr, but the implementation does not potentially evaluate an error completion operation with an exception_ptr argument, the implementation is allowed to omit the exception_ptr error completion signature from the set.