Files
2025-10-25 03:02:53 +03:00

3.5 KiB
Raw Permalink Blame History

[exec.continues.on]

33 Execution control library [exec]

33.9 Senders [exec.snd]

33.9.12 Sender adaptors [exec.adapt]

33.9.12.6 execution::continues_on [exec.continues.on]

1

#

continues_on adapts a sender into one that completes on the specified scheduler.

2

#

The name continues_on denotes a pipeable sender adaptor object.

For subexpressions sch and sndr, if decltype((sch)) does not satisfy scheduler, ordecltype((sndr)) does not satisfy sender,continues_on(sndr, sch) is ill-formed.

3

#

Otherwise, the expression continues_on(sndr, sch) is expression-equivalent to:transform_sender(get-domain-early(sndr), make-sender(continues_on, sch, sndr)) except that sndr is evaluated only once.

4

#

The exposition-only class template impls-for ([exec.snd.expos]) is specialized for continues_on_t as follows:namespace std::execution {template<>struct impls-for<continues_on_t> : default-impls {static constexpr auto get-attrs =[](const auto& data, const auto& child) noexcept -> decltype(auto) {return JOIN-ENV(SCHED-ATTRS(data), FWD-ENV(get_env(child))); }; };}

5

#

Let sndr and env be subexpressions such that Sndr is decltype((sndr)).

If sender-for<Sndr, continues_on_t> is false, then the expression continues_on.transform_sender(sndr, env) is ill-formed; otherwise, it is equal to:auto [_, data, child] = sndr;return schedule_from(std::move(data), std::move(child));

[Note 1:

This causes the continues_on(sndr, sch) sender to becomeschedule_from(sch, sndr) when it is connected with a receiver whose execution domain does not customize continues_on.

— end note]

6

#

Let out_sndr be a subexpression denoting a sender returned from continues_on(sndr, sch) or one equal to such, and let OutSndr be the type decltype((out_sndr)).

Let out_rcvr be a subexpression denoting a receiver that has an environment of type Env such that sender_in<OutSndr, Env> is true.

Let op be an lvalue referring to the operation state that results from connecting out_sndr with out_rcvr.

Calling start(op) shall start sndr on the current execution agent and execute completion operations on out_rcvr on an execution agent of the execution resource associated with sch.

If scheduling onto sch fails, an error completion on out_rcvr shall be executed on an unspecified execution agent.