tmp/tmpwlws0680/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,72 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
### Class template `inplace_stop_callback` <a id="stopcallback.inplace">[[stopcallback.inplace]]</a>
|
| 2 |
+
|
| 3 |
+
#### General <a id="stopcallback.inplace.general">[[stopcallback.inplace.general]]</a>
|
| 4 |
+
|
| 5 |
+
``` cpp
|
| 6 |
+
namespace std {
|
| 7 |
+
template<class CallbackFn>
|
| 8 |
+
class inplace_stop_callback {
|
| 9 |
+
public:
|
| 10 |
+
using callback_type = CallbackFn;
|
| 11 |
+
|
| 12 |
+
// [stopcallback.inplace.cons], constructors and destructor
|
| 13 |
+
template<class Initializer>
|
| 14 |
+
explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)
|
| 15 |
+
noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>);
|
| 16 |
+
~inplace_stop_callback();
|
| 17 |
+
|
| 18 |
+
inplace_stop_callback(inplace_stop_callback&&) = delete;
|
| 19 |
+
inplace_stop_callback(const inplace_stop_callback&) = delete;
|
| 20 |
+
inplace_stop_callback& operator=(inplace_stop_callback&&) = delete;
|
| 21 |
+
inplace_stop_callback& operator=(const inplace_stop_callback&) = delete;
|
| 22 |
+
|
| 23 |
+
private:
|
| 24 |
+
CallbackFn callback-fn; // exposition only
|
| 25 |
+
};
|
| 26 |
+
|
| 27 |
+
template<class CallbackFn>
|
| 28 |
+
inplace_stop_callback(inplace_stop_token, CallbackFn)
|
| 29 |
+
-> inplace_stop_callback<CallbackFn>;
|
| 30 |
+
}
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
*Mandates:* `CallbackFn` satisfies both `invocable` and `destructible`.
|
| 34 |
+
|
| 35 |
+
*Remarks:* For a type `Initializer`, if
|
| 36 |
+
|
| 37 |
+
``` cpp
|
| 38 |
+
stoppable-callback-for<CallbackFn, inplace_stop_token, Initializer>
|
| 39 |
+
```
|
| 40 |
+
|
| 41 |
+
is satisfied, then
|
| 42 |
+
|
| 43 |
+
``` cpp
|
| 44 |
+
stoppable-callback-for<CallbackFn, inplace_stop_token, Initializer>
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
is modeled. For an `inplace_stop_callback<CallbackFn>` object, the
|
| 48 |
+
exposition-only *`callback-fn`* member is its associated callback
|
| 49 |
+
function [[stoptoken.concepts]].
|
| 50 |
+
|
| 51 |
+
#### Constructors and destructor <a id="stopcallback.inplace.cons">[[stopcallback.inplace.cons]]</a>
|
| 52 |
+
|
| 53 |
+
``` cpp
|
| 54 |
+
template<class Initializer>
|
| 55 |
+
explicit inplace_stop_callback(inplace_stop_token st, Initializer&& init)
|
| 56 |
+
noexcept(is_nothrow_constructible_v<CallbackFn, Initializer>);
|
| 57 |
+
```
|
| 58 |
+
|
| 59 |
+
*Constraints:* `constructible_from<CallbackFn, Initializer>` is
|
| 60 |
+
satisfied.
|
| 61 |
+
|
| 62 |
+
*Effects:* Initializes *callback-fn* with
|
| 63 |
+
`std::forward<Initializer>(init)` and executes a stoppable callback
|
| 64 |
+
registration [[stoptoken.concepts]].
|
| 65 |
+
|
| 66 |
+
``` cpp
|
| 67 |
+
~inplace_stop_callback();
|
| 68 |
+
```
|
| 69 |
+
|
| 70 |
+
*Effects:* Executes a stoppable callback
|
| 71 |
+
deregistration [[stoptoken.concepts]].
|
| 72 |
+
|