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

3.0 KiB
Raw Blame History

[exec.opstate]

33 Execution control library [exec]

33.8 Operation states [exec.opstate]

33.8.1 General [exec.opstate.general]

1

#

The operation_state concept defines the requirements of an operation state type ([exec.async.ops]).

namespace std::execution {templateconcept operation_state =derived_from<typename O::operation_state_concept, operation_state_t> &&requires (O& o) { start(o); };}

2

#

If an operation_state object is destroyed during the lifetime of its asynchronous operation ([exec.async.ops]), the behavior is undefined.

[Note 1:

The operation_state concept does not impose requirements on any operations other than destruction and start, including copy and move operations.

Invoking any such operation on an object whose type models operation_state can lead to undefined behavior.

— end note]

3

#

The program is ill-formed if it performs a copy or move construction or assignment operation on an operation state object created by connecting a library-provided sender.

33.8.2 execution::start [exec.opstate.start]

1

#

The name start denotes a customization point object that starts ([exec.async.ops]) the asynchronous operation associated with the operation state object.

For a subexpression op, the expression start(op) is ill-formed if op is an rvalue.

Otherwise, it is expression-equivalent toMANDATE-NOTHROW(op.start()).

2

#

If op.start() does not start ([exec.async.ops]) the asynchronous operation associated with the operation state op, the behavior of calling start(op) is undefined.