tmp/tmpoia84fc2/{from.md → to.md}
RENAMED
|
@@ -1,33 +1,33 @@
|
|
| 1 |
#### General <a id="stoptoken.general">[[stoptoken.general]]</a>
|
| 2 |
|
| 3 |
-
The class `stop_token`
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
[[stopcallback]] constructor to register a callback to be called when a
|
| 8 |
-
stop request has been made from an associated `stop_source`.
|
| 9 |
|
| 10 |
``` cpp
|
| 11 |
namespace std {
|
| 12 |
class stop_token {
|
| 13 |
public:
|
| 14 |
-
|
| 15 |
-
|
| 16 |
|
| 17 |
-
stop_token(
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
stop_token& operator=(stop_token&&) noexcept;
|
| 21 |
-
~stop_token();
|
| 22 |
void swap(stop_token&) noexcept;
|
| 23 |
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
[[nodiscard]] bool stop_possible() const noexcept;
|
| 27 |
|
| 28 |
-
|
| 29 |
-
|
|
|
|
|
|
|
| 30 |
};
|
| 31 |
}
|
| 32 |
```
|
| 33 |
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
#### General <a id="stoptoken.general">[[stoptoken.general]]</a>
|
| 2 |
|
| 3 |
+
The class `stop_token` models the concept `stoppable_token`. It shares
|
| 4 |
+
ownership of its stop state, if any, with its associated `stop_source`
|
| 5 |
+
object [[stopsource]] and any `stop_token` objects to which it compares
|
| 6 |
+
equal.
|
|
|
|
|
|
|
| 7 |
|
| 8 |
``` cpp
|
| 9 |
namespace std {
|
| 10 |
class stop_token {
|
| 11 |
public:
|
| 12 |
+
template<class CallbackFn>
|
| 13 |
+
using callback_type = stop_callback<CallbackFn>;
|
| 14 |
|
| 15 |
+
stop_token() noexcept = default;
|
| 16 |
+
|
| 17 |
+
// [stoptoken.mem], member functions
|
|
|
|
|
|
|
| 18 |
void swap(stop_token&) noexcept;
|
| 19 |
|
| 20 |
+
bool stop_requested() const noexcept;
|
| 21 |
+
bool stop_possible() const noexcept;
|
|
|
|
| 22 |
|
| 23 |
+
bool operator==(const stop_token& rhs) noexcept = default;
|
| 24 |
+
|
| 25 |
+
private:
|
| 26 |
+
shared_ptr<unspecified> stop-state; // exposition only
|
| 27 |
};
|
| 28 |
}
|
| 29 |
```
|
| 30 |
|
| 31 |
+
*`stop-state`* refers to the `stop_token`’s associated stop state. A
|
| 32 |
+
`stop_token` object is disengaged when *`stop-state`* is empty.
|
| 33 |
+
|