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

6.6 KiB

[exec.general]

33 Execution control library [exec]

33.1 General [exec.general]

1

#

This Clause describes components supporting execution of function objects ([function.objects]).

2

#

The following subclauses describe the requirements, concepts, and components for execution control primitives as summarized in Table 157.

Table 157 — Execution control library summary [tab:exec.summary]

🔗 Subclause Header
🔗
[exec.sched]
Schedulers
🔗
[exec.recv]
Receivers
🔗
[exec.opstate]
Operation states
🔗
[exec.snd]
Senders

3

#

Table 158 shows the types of customization point objects ([customization.point.object]) used in the execution control library.

Table 158 — Types of customization point objects in the execution control library [tab:exec.pos]

🔗
Customization point
Purpose Examples
🔗
object type
🔗
core
provide core execution functionality, and connection between core components e.g., connect, start
🔗
completion functions
called by senders to announce the completion of the work (success, error, or cancellation) set_value, set_error, set_stopped
🔗
senders
allow the specialization of the provided sender algorithms sender factories (e.g., schedule, just, read_env)sender adaptors (e.g., continues_on, then, let_value)sender consumers (e.g., sync_wait)
🔗
queries
allow querying different properties of objects general queries (e.g., get_allocator, get_stop_token)environment queries (e.g., get_scheduler, get_delegation_scheduler)scheduler queries (e.g., get_forward_progress_guarantee)sender attribute queries (e.g., get_completion_scheduler)

4

#

This clause makes use of the following exposition-only entities.

5

#

For a subexpression expr, let MANDATE-NOTHROW(expr) be expression-equivalent to expr.

Mandates: noexcept(expr) is true.

6

#

namespace std {templateconcept movable-value = // exposition onlymove_constructible<decay_t> &&constructible_from<decay_t, T> &&(!is_array_v<remove_reference_t>);}

7

#

For function types F1 and F2 denotingR1(Args1...) and R2(Args2...), respectively,MATCHING-SIG(F1, F2) is true if and only ifsame_as<R1(Args1&&...), R2(Args2&&...)> is true.

8

#

For a subexpression err, let Err be decltype((err)) and let AS-EXCEPT-PTR(err) be:

  • (8.1)

    err if decay_t denotes the type exception_ptr. Preconditions: !err is false.

  • (8.2)

    Otherwise,make_exception_ptr(system_error(err)) if decay_t denotes the type error_code.

  • (8.3)

    Otherwise, make_exception_ptr(err).

9

#

For a subexpression expr, let AS-CONST(expr) be expression-equivalent to[](const auto& x) noexcept -> const auto& { return x; }(expr)