tmp/tmpyan3njtq/{from.md → to.md}
RENAMED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### General <a id="stopcallback.general">[[stopcallback.general]]</a>
|
| 2 |
+
|
| 3 |
+
``` cpp
|
| 4 |
+
namespace std {
|
| 5 |
+
template<class Callback>
|
| 6 |
+
class stop_callback {
|
| 7 |
+
public:
|
| 8 |
+
using callback_type = Callback;
|
| 9 |
+
|
| 10 |
+
// [stopcallback.cons], constructors and destructor
|
| 11 |
+
template<class C>
|
| 12 |
+
explicit stop_callback(const stop_token& st, C&& cb)
|
| 13 |
+
noexcept(is_nothrow_constructible_v<Callback, C>);
|
| 14 |
+
template<class C>
|
| 15 |
+
explicit stop_callback(stop_token&& st, C&& cb)
|
| 16 |
+
noexcept(is_nothrow_constructible_v<Callback, C>);
|
| 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 |
+
Callback callback; // exposition only
|
| 26 |
+
};
|
| 27 |
+
|
| 28 |
+
template<class Callback>
|
| 29 |
+
stop_callback(stop_token, Callback) -> stop_callback<Callback>;
|
| 30 |
+
}
|
| 31 |
+
```
|
| 32 |
+
|
| 33 |
+
*Mandates:* `stop_callback` is instantiated with an argument for the
|
| 34 |
+
template parameter `Callback` that satisfies both `invocable` and
|
| 35 |
+
`destructible`.
|
| 36 |
+
|
| 37 |
+
*Preconditions:* `stop_callback` is instantiated with an argument for
|
| 38 |
+
the template parameter `Callback` that models both `invocable` and
|
| 39 |
+
`destructible`.
|
| 40 |
+
|