From Jason Turner

[stopcallback.inplace.general]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmp2b7uecj6/{from.md → to.md} +48 -0
tmp/tmp2b7uecj6/{from.md → to.md} RENAMED
@@ -0,0 +1,48 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### General <a id="stopcallback.inplace.general">[[stopcallback.inplace.general]]</a>
2
+
3
+ ``` cpp
4
+ namespace std {
5
+ template<class CallbackFn>
6
+ class inplace_stop_callback {
7
+ public:
8
+ using callback_type = CallbackFn;
9
+
10
+ // [stopcallback.inplace.cons], constructors and destructor
11
+ template<class Initializer>
12
+ explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)
13
+ noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>);
14
+ ~inplace_stop_callback();
15
+
16
+ inplace_stop_callback(inplace_stop_callback&&) = delete;
17
+ inplace_stop_callback(const inplace_stop_callback&) = delete;
18
+ inplace_stop_callback& operator=(inplace_stop_callback&&) = delete;
19
+ inplace_stop_callback& operator=(const inplace_stop_callback&) = delete;
20
+
21
+ private:
22
+ CallbackFn callback-fn; // exposition only
23
+ };
24
+
25
+ template<class CallbackFn>
26
+ inplace_stop_callback(inplace_stop_token, CallbackFn)
27
+ -> inplace_stop_callback<CallbackFn>;
28
+ }
29
+ ```
30
+
31
+ *Mandates:* `CallbackFn` satisfies both `invocable` and `destructible`.
32
+
33
+ *Remarks:* For a type `Initializer`, if
34
+
35
+ ``` cpp
36
+ stoppable-callback-for<CallbackFn, inplace_stop_token, Initializer>
37
+ ```
38
+
39
+ is satisfied, then
40
+
41
+ ``` cpp
42
+ stoppable-callback-for<CallbackFn, inplace_stop_token, Initializer>
43
+ ```
44
+
45
+ is modeled. For an `inplace_stop_callback<CallbackFn>` object, the
46
+ exposition-only *`callback-fn`* member is its associated callback
47
+ function [[stoptoken.concepts]].
48
+