From Jason Turner

[stoptoken.general]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpwo65d3qj/{from.md → to.md} +33 -0
tmp/tmpwo65d3qj/{from.md → to.md} RENAMED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### General <a id="stoptoken.general">[[stoptoken.general]]</a>
2
+
3
+ The class `stop_token` provides an interface for querying whether a stop
4
+ request has been made (`stop_requested`) or can ever be made
5
+ (`stop_possible`) using an associated `stop_source` object
6
+ [[stopsource]]. A `stop_token` can also be passed to a `stop_callback`
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
+ // [stoptoken.cons], constructors, copy, and assignment
15
+ stop_token() noexcept;
16
+
17
+ stop_token(const stop_token&) noexcept;
18
+ stop_token(stop_token&&) noexcept;
19
+ stop_token& operator=(const stop_token&) noexcept;
20
+ stop_token& operator=(stop_token&&) noexcept;
21
+ ~stop_token();
22
+ void swap(stop_token&) noexcept;
23
+
24
+ // [stoptoken.mem], stop handling
25
+ [[nodiscard]] bool stop_requested() const noexcept;
26
+ [[nodiscard]] bool stop_possible() const noexcept;
27
+
28
+ [[nodiscard]] friend bool operator==(const stop_token& lhs, const stop_token& rhs) noexcept;
29
+ friend void swap(stop_token& lhs, stop_token& rhs) noexcept;
30
+ };
31
+ }
32
+ ```
33
+