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