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

44 lines
2.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[exec.opstate.general]
# 33 Execution control library [[exec]](./#exec)
## 33.8 Operation states [[exec.opstate]](exec.opstate#general)
### 33.8.1 General [exec.opstate.general]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L1273)
The [operation_state](#concept:operation_state "33.8.1General[exec.opstate.general]") concept defines
the requirements of an operation state type ([[exec.async.ops]](exec.async.ops "33.3Asynchronous operations"))[.](#1.sentence-1)
namespace std::execution {template<class O>concept [operation_state](#concept:operation_state "33.8.1General[exec.opstate.general]") =[derived_from](concept.derived#concept:derived_from "18.4.3Concept derived_­from[concept.derived]")<typename O::operation_state_concept, operation_state_t> &&requires (O& o) { start(o); };}
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L1287)
If an [operation_state](#concept:operation_state "33.8.1General[exec.opstate.general]") object is destroyed
during the lifetime of its asynchronous operation ([[exec.async.ops]](exec.async.ops "33.3Asynchronous operations")),
the behavior is undefined[.](#2.sentence-1)
[*Note [1](#note-1)*:
The [operation_state](#concept:operation_state "33.8.1General[exec.opstate.general]") concept does not impose requirements
on any operations other than destruction and start,
including copy and move operations[.](#2.sentence-2)
Invoking any such operation on an object
whose type models [operation_state](#concept:operation_state "33.8.1General[exec.opstate.general]") can lead to undefined behavior[.](#2.sentence-3)
— *end note*]
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L1299)
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[.](#3.sentence-1)