Init
This commit is contained in:
47
cppdraft/stopcallback/cons.md
Normal file
47
cppdraft/stopcallback/cons.md
Normal file
@@ -0,0 +1,47 @@
|
||||
[stopcallback.cons]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopcallback.cons)
|
||||
|
||||
### 32.3.6 Class template stop_callback [[stopcallback]](stopcallback#cons)
|
||||
|
||||
#### 32.3.6.2 Constructors and destructor [stopcallback.cons]
|
||||
|
||||
[ð](#lib:stop_callback,constructor)
|
||||
|
||||
`template<class Initializer>
|
||||
explicit stop_callback(const stop_token& st, Initializer&& init)
|
||||
noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>);
|
||||
|
||||
template<class Initializer>
|
||||
explicit stop_callback(stop_token&& st, Initializer&& init)
|
||||
noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>);
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1103)
|
||||
|
||||
*Constraints*: CallbackFn and Initializer satisfy[constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_from [concept.constructible]")<CallbackFn, Initializer>[.](#1.sentence-1)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1108)
|
||||
|
||||
*Effects*: Initializes *callback-fn* with std::forward<Initializer>(init) and executes a stoppable callback registration ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts"))[.](#2.sentence-1)
|
||||
|
||||
If a callback is registered with st's shared stop state,
|
||||
then *this acquires shared ownership of that stop state[.](#2.sentence-2)
|
||||
|
||||
[ð](#lib:stop_callback,destructor)
|
||||
|
||||
`~stop_callback();
|
||||
`
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1122)
|
||||
|
||||
*Effects*: Executes a stoppable callback deregistration ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts")) and
|
||||
releases ownership of the stop state, if any[.](#3.sentence-1)
|
||||
40
cppdraft/stopcallback/general.md
Normal file
40
cppdraft/stopcallback/general.md
Normal file
@@ -0,0 +1,40 @@
|
||||
[stopcallback.general]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopcallback.general)
|
||||
|
||||
### 32.3.6 Class template stop_callback [[stopcallback]](stopcallback#general)
|
||||
|
||||
#### 32.3.6.1 General [stopcallback.general]
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1039)
|
||||
|
||||
[ð](#lib:stop_callback)
|
||||
|
||||
namespace std {template<class CallbackFn>class stop_callback {public:using callback_type = CallbackFn; // [[stopcallback.cons]](stopcallback.cons "32.3.6.2 Constructors and destructor"), constructors and destructortemplate<class Initializer>explicit stop_callback(const stop_token& st, Initializer&& init)noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>); template<class Initializer>explicit stop_callback(stop_token&& st, Initializer&& init)noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>); ~stop_callback();
|
||||
|
||||
stop_callback(const stop_callback&) = delete;
|
||||
stop_callback(stop_callback&&) = delete;
|
||||
stop_callback& operator=(const stop_callback&) = delete;
|
||||
stop_callback& operator=(stop_callback&&) = delete; private: CallbackFn *callback-fn*; // *exposition only*}; template<class CallbackFn> stop_callback(stop_token, CallbackFn) -> stop_callback<CallbackFn>;}
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1071)
|
||||
|
||||
*Mandates*: stop_callback is instantiated with an argument for the
|
||||
template parameter CallbackFn that satisfies both [invocable](concept.invocable#concept:invocable "18.7.2 Concept invocable [concept.invocable]") and [destructible](concept.destructible#concept:destructible "18.4.10 Concept destructible [concept.destructible]")[.](#2.sentence-1)
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1078)
|
||||
|
||||
*Remarks*: For a type Initializer,
|
||||
if[*stoppable-callback-for*](stoptoken.concepts#concept:stoppable-callback-for "32.3.3 Stop token concepts [stoptoken.concepts]")<CallbackFn, stop_token, Initializer> is satisfied, then[*stoppable-callback-for*](stoptoken.concepts#concept:stoppable-callback-for "32.3.3 Stop token concepts [stoptoken.concepts]")<CallbackFn, stop_token, Initializer> is modeled[.](#3.sentence-1)
|
||||
|
||||
The exposition-only *callback-fn* member is
|
||||
the associated callback function ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts")) ofstop_callback<
|
||||
CallbackFn> objects[.](#3.sentence-2)
|
||||
64
cppdraft/stopcallback/inplace.md
Normal file
64
cppdraft/stopcallback/inplace.md
Normal file
@@ -0,0 +1,64 @@
|
||||
[stopcallback.inplace]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopcallback.inplace)
|
||||
|
||||
### 32.3.10 Class template inplace_stop_callback [stopcallback.inplace]
|
||||
|
||||
#### [32.3.10.1](#general) General [[stopcallback.inplace.general]](stopcallback.inplace.general)
|
||||
|
||||
namespace std {template<class CallbackFn>class inplace_stop_callback {public:using callback_type = CallbackFn; // [[stopcallback.inplace.cons]](#cons "32.3.10.2 Constructors and destructor"), constructors and destructortemplate<class Initializer>explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>); ~inplace_stop_callback();
|
||||
|
||||
inplace_stop_callback(inplace_stop_callback&&) = delete;
|
||||
inplace_stop_callback(const inplace_stop_callback&) = delete;
|
||||
inplace_stop_callback& operator=(inplace_stop_callback&&) = delete;
|
||||
inplace_stop_callback& operator=(const inplace_stop_callback&) = delete; private: CallbackFn *callback-fn*; // *exposition only*}; template<class CallbackFn> inplace_stop_callback(inplace_stop_token, CallbackFn)-> inplace_stop_callback<CallbackFn>;}
|
||||
|
||||
[1](#general-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1352)
|
||||
|
||||
*Mandates*: CallbackFn satisfies both[invocable](concept.invocable#concept:invocable "18.7.2 Concept invocable [concept.invocable]") and [destructible](concept.destructible#concept:destructible "18.4.10 Concept destructible [concept.destructible]")[.](#general-1.sentence-1)
|
||||
|
||||
[2](#general-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1357)
|
||||
|
||||
*Remarks*: For a type Initializer, if[*stoppable-callback-for*](stoptoken.concepts#concept:stoppable-callback-for "32.3.3 Stop token concepts [stoptoken.concepts]")<CallbackFn, inplace_stop_token, Initializer> is satisfied, then[*stoppable-callback-for*](stoptoken.concepts#concept:stoppable-callback-for "32.3.3 Stop token concepts [stoptoken.concepts]")<CallbackFn, inplace_stop_token, Initializer> is modeled[.](#general-2.sentence-1)
|
||||
|
||||
For an inplace_stop_callback<CallbackFn> object,
|
||||
the exposition-only *callback-fn* member is
|
||||
its associated callback function ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts"))[.](#general-2.sentence-2)
|
||||
|
||||
#### [32.3.10.2](#cons) Constructors and destructor [[stopcallback.inplace.cons]](stopcallback.inplace.cons)
|
||||
|
||||
[ð](#cons-itemdecl:1)
|
||||
|
||||
`template<class Initializer>
|
||||
explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)
|
||||
noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>);
|
||||
`
|
||||
|
||||
[1](#cons-1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1381)
|
||||
|
||||
*Constraints*: [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_from [concept.constructible]")<CallbackFn, Initializer> is satisfied[.](#cons-1.sentence-1)
|
||||
|
||||
[2](#cons-2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1385)
|
||||
|
||||
*Effects*: Initializes *callback-fn* with std::forward<Initializer>(init) and executes a stoppable callback registration ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts"))[.](#cons-2.sentence-1)
|
||||
|
||||
[ð](#cons-itemdecl:2)
|
||||
|
||||
`~inplace_stop_callback();
|
||||
`
|
||||
|
||||
[3](#cons-3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1396)
|
||||
|
||||
*Effects*: Executes a stoppable callback deregistration ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts"))[.](#cons-3.sentence-1)
|
||||
39
cppdraft/stopcallback/inplace/cons.md
Normal file
39
cppdraft/stopcallback/inplace/cons.md
Normal file
@@ -0,0 +1,39 @@
|
||||
[stopcallback.inplace.cons]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopcallback.inplace.cons)
|
||||
|
||||
### 32.3.10 Class template inplace_stop_callback [[stopcallback.inplace]](stopcallback.inplace#cons)
|
||||
|
||||
#### 32.3.10.2 Constructors and destructor [stopcallback.inplace.cons]
|
||||
|
||||
[ð](#itemdecl:1)
|
||||
|
||||
`template<class Initializer>
|
||||
explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)
|
||||
noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>);
|
||||
`
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1381)
|
||||
|
||||
*Constraints*: [constructible_from](concept.constructible#concept:constructible_from "18.4.11 Concept constructible_from [concept.constructible]")<CallbackFn, Initializer> is satisfied[.](#1.sentence-1)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1385)
|
||||
|
||||
*Effects*: Initializes *callback-fn* with std::forward<Initializer>(init) and executes a stoppable callback registration ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts"))[.](#2.sentence-1)
|
||||
|
||||
[ð](#itemdecl:2)
|
||||
|
||||
`~inplace_stop_callback();
|
||||
`
|
||||
|
||||
[3](#3)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1396)
|
||||
|
||||
*Effects*: Executes a stoppable callback deregistration ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts"))[.](#3.sentence-1)
|
||||
32
cppdraft/stopcallback/inplace/general.md
Normal file
32
cppdraft/stopcallback/inplace/general.md
Normal file
@@ -0,0 +1,32 @@
|
||||
[stopcallback.inplace.general]
|
||||
|
||||
# 32 Concurrency support library [[thread]](./#thread)
|
||||
|
||||
## 32.3 Stop tokens [[thread.stoptoken]](thread.stoptoken#stopcallback.inplace.general)
|
||||
|
||||
### 32.3.10 Class template inplace_stop_callback [[stopcallback.inplace]](stopcallback.inplace#general)
|
||||
|
||||
#### 32.3.10.1 General [stopcallback.inplace.general]
|
||||
|
||||
namespace std {template<class CallbackFn>class inplace_stop_callback {public:using callback_type = CallbackFn; // [[stopcallback.inplace.cons]](stopcallback.inplace.cons "32.3.10.2 Constructors and destructor"), constructors and destructortemplate<class Initializer>explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>); ~inplace_stop_callback();
|
||||
|
||||
inplace_stop_callback(inplace_stop_callback&&) = delete;
|
||||
inplace_stop_callback(const inplace_stop_callback&) = delete;
|
||||
inplace_stop_callback& operator=(inplace_stop_callback&&) = delete;
|
||||
inplace_stop_callback& operator=(const inplace_stop_callback&) = delete; private: CallbackFn *callback-fn*; // *exposition only*}; template<class CallbackFn> inplace_stop_callback(inplace_stop_token, CallbackFn)-> inplace_stop_callback<CallbackFn>;}
|
||||
|
||||
[1](#1)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1352)
|
||||
|
||||
*Mandates*: CallbackFn satisfies both[invocable](concept.invocable#concept:invocable "18.7.2 Concept invocable [concept.invocable]") and [destructible](concept.destructible#concept:destructible "18.4.10 Concept destructible [concept.destructible]")[.](#1.sentence-1)
|
||||
|
||||
[2](#2)
|
||||
|
||||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/threads.tex#L1357)
|
||||
|
||||
*Remarks*: For a type Initializer, if[*stoppable-callback-for*](stoptoken.concepts#concept:stoppable-callback-for "32.3.3 Stop token concepts [stoptoken.concepts]")<CallbackFn, inplace_stop_token, Initializer> is satisfied, then[*stoppable-callback-for*](stoptoken.concepts#concept:stoppable-callback-for "32.3.3 Stop token concepts [stoptoken.concepts]")<CallbackFn, inplace_stop_token, Initializer> is modeled[.](#2.sentence-1)
|
||||
|
||||
For an inplace_stop_callback<CallbackFn> object,
|
||||
the exposition-only *callback-fn* member is
|
||||
its associated callback function ([[stoptoken.concepts]](stoptoken.concepts "32.3.3 Stop token concepts"))[.](#2.sentence-2)
|
||||
Reference in New Issue
Block a user