This commit is contained in:
2025-10-25 03:02:53 +03:00
commit 043225d523
3416 changed files with 681196 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
[exec.simple.counting.ctor]
# 33 Execution control library [[exec]](./#exec)
## 33.14 Execution scope utilities [[exec.scope]](exec.scope#exec.simple.counting.ctor)
### 33.14.2 Counting Scopes [[exec.counting.scopes]](exec.counting.scopes#exec.simple.counting.ctor)
#### 33.14.2.2 Simple Counting Scope [[exec.scope.simple.counting]](exec.scope.simple.counting#exec.simple.counting.ctor)
#### 33.14.2.2.2 Constructor and Destructor [exec.simple.counting.ctor]
[🔗](#lib:execution::simple_counting_scope,constructor)
`simple_counting_scope() noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L7991)
*Postconditions*: *count* is 0 and *state* is *unused*[.](#1.sentence-1)
[🔗](#lib:execution::simple_counting_scope,destructor)
`~simple_counting_scope();
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8002)
*Effects*: If *state* is not one of*joined*, *unused*, or *unused-and-closed*,
invokes terminate ([[except.terminate]](except.terminate "14.6.2The std::terminate function"))[.](#2.sentence-1)
Otherwise, has no effects[.](#2.sentence-2)

View File

@@ -0,0 +1,157 @@
[exec.simple.counting.mem]
# 33 Execution control library [[exec]](./#exec)
## 33.14 Execution scope utilities [[exec.scope]](exec.scope#exec.simple.counting.mem)
### 33.14.2 Counting Scopes [[exec.counting.scopes]](exec.counting.scopes#exec.simple.counting.mem)
#### 33.14.2.2 Simple Counting Scope [[exec.scope.simple.counting]](exec.scope.simple.counting#exec.simple.counting.mem)
#### 33.14.2.2.3 Members [exec.simple.counting.mem]
[🔗](#lib:get_token,execution::simple_counting_scope)
`token get_token() noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8018)
*Returns*: An object t of type simple_counting_scope::token such thatt.*scope* == this is true[.](#1.sentence-1)
[🔗](#lib:close,execution::simple_counting_scope)
`void close() noexcept;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8030)
*Effects*: If *state* is
- [(2.1)](#2.1)
*unused*, then changes *state* to *unused-and-closed*;
- [(2.2)](#2.2)
*open*, then changes *state* to *closed*;
- [(2.3)](#2.3)
*open-and-joining*,
then changes *state* to *closed-and-joining*;
- [(2.4)](#2.4)
otherwise, no effects[.](#2.sentence-1)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8045)
*Postconditions*: Any subsequent call to *try-associate*() on *this returns false[.](#3.sentence-1)
[🔗](#lib:join,execution::simple_counting_scope)
`[sender](exec.snd.concepts#concept:sender "33.9.3Sender concepts[exec.snd.concepts]") auto join() noexcept;
`
[4](#4)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8057)
*Returns*: *make-sender*(*scope-join-t*(), this)[.](#4.sentence-1)
[🔗](#lib:try-associate,execution::simple_counting_scope)
`bool try-associate() noexcept;
`
[5](#5)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8068)
*Effects*: If *count* is equal to max_associations, then no effects[.](#5.sentence-1)
Otherwise, if *state* is
- [(5.1)](#5.1)
*unused*,
then increments *count* and changes *state* to *open*;
- [(5.2)](#5.2)
*open* or *open-and-joining*,
then increments *count*;
- [(5.3)](#5.3)
otherwise, no effects[.](#5.sentence-2)
[6](#6)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8083)
*Returns*: true if *count* was incremented, false otherwise[.](#6.sentence-1)
[🔗](#lib:disassociate,execution::simple_counting_scope)
`void disassociate() noexcept;
`
[7](#7)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8094)
*Preconditions*: *count* is greater than zero[.](#7.sentence-1)
[8](#8)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8098)
*Effects*: Decrements *count*[.](#8.sentence-1)
If *count* is zero after decrementing and*state* is *open-and-joining* or *closed-and-joining*,
changes *state* to *joined* and
calls *complete*() on all objects registered with *this[.](#8.sentence-2)
[*Note [1](#note-1)*:
Calling *complete*() on any registered object
can cause *this to be destroyed[.](#8.sentence-3)
— *end note*]
[🔗](#lib:start-join-sender,execution::simple_counting_scope)
`template<class State>
bool start-join-sender(State& st) noexcept;
`
[9](#9)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8118)
*Effects*: If *state* is
- [(9.1)](#9.1)
*unused*, *unused-and-closed*, or *joined*, then
changes *state* to *joined* and returns true;
- [(9.2)](#9.2)
*open* or *open-and-joining*, then
changes *state* to *open-and-joining*,
registers st with *this and returns false;
- [(9.3)](#9.3)
*closed* or *closed-and-joining*, then
changes *state* to *closed-and-joining*,
registers st with *this and returns false[.](#9.sentence-1)

View File

@@ -0,0 +1,49 @@
[exec.simple.counting.token]
# 33 Execution control library [[exec]](./#exec)
## 33.14 Execution scope utilities [[exec.scope]](exec.scope#exec.simple.counting.token)
### 33.14.2 Counting Scopes [[exec.counting.scopes]](exec.counting.scopes#exec.simple.counting.token)
#### 33.14.2.2 Simple Counting Scope [[exec.scope.simple.counting]](exec.scope.simple.counting#exec.simple.counting.token)
#### 33.14.2.2.4 Token [exec.simple.counting.token]
[🔗](#lib:execution::simple_counting_scope::token)
namespace std::execution {struct simple_counting_scope::token {template<[sender](exec.snd.concepts#concept:sender "33.9.3Sender concepts[exec.snd.concepts]") Sender> Sender&& wrap(Sender&& snd) const noexcept; bool try_associate() const noexcept; void disassociate() const noexcept; private: simple_counting_scope* *scope*; // *exposition only*};}
[🔗](#lib:wrap,execution::simple_counting_scope::token)
`template<[sender](exec.snd.concepts#concept:sender "33.9.3Sender concepts[exec.snd.concepts]") Sender>
Sender&& wrap(Sender&& snd) const noexcept;
`
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8160)
*Returns*: std::forward<Sender>(snd)[.](#1.sentence-1)
[🔗](#lib:try_associate,execution::simple_counting_scope::token)
`bool try_associate() const noexcept;
`
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8171)
*Effects*: Equivalent to: return *scope*->*try-associate*();
[🔗](#lib:disassociate,execution::simple_counting_scope::token)
`void disassociate() const noexcept;
`
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/exec.tex#L8182)
*Effects*: Equivalent to *scope*->*disassociate*()[.](#3.sentence-1)