From Jason Turner

[stoptoken.inplace]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmprmq8xnqh/{from.md → to.md} +64 -0
tmp/tmprmq8xnqh/{from.md → to.md} RENAMED
@@ -0,0 +1,64 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Class `inplace_stop_token` <a id="stoptoken.inplace">[[stoptoken.inplace]]</a>
2
+
3
+ #### General <a id="stoptoken.inplace.general">[[stoptoken.inplace.general]]</a>
4
+
5
+ The class `inplace_stop_token` models the concept `stoppable_token`. It
6
+ references the stop state of its associated `inplace_stop_source` object
7
+ [[stopsource.inplace]], if any.
8
+
9
+ ``` cpp
10
+ namespace std {
11
+ class inplace_stop_token {
12
+ public:
13
+ template<class CallbackFn>
14
+ using callback_type = inplace_stop_callback<CallbackFn>;
15
+
16
+ inplace_stop_token() = default;
17
+ bool operator==(const inplace_stop_token&) const = default;
18
+
19
+ // [stoptoken.inplace.mem], member functions
20
+ bool stop_requested() const noexcept;
21
+ bool stop_possible() const noexcept;
22
+ void swap(inplace_stop_token&) noexcept;
23
+
24
+ private:
25
+ const inplace_stop_source* stop-source = nullptr; // exposition only
26
+ };
27
+ }
28
+ ```
29
+
30
+ #### Member functions <a id="stoptoken.inplace.mem">[[stoptoken.inplace.mem]]</a>
31
+
32
+ ``` cpp
33
+ void swap(inplace_stop_token& rhs) noexcept;
34
+ ```
35
+
36
+ *Effects:* Exchanges the values of *stop-source* and
37
+ `rhs.`*`stop-source`*.
38
+
39
+ ``` cpp
40
+ bool stop_requested() const noexcept;
41
+ ```
42
+
43
+ *Effects:* Equivalent to:
44
+
45
+ ``` cpp
46
+ return stop-source != nullptr && stop-source->stop_requested();
47
+ ```
48
+
49
+ [*Note 1*: As specified in [[basic.life]], the behavior of
50
+ `stop_requested` is undefined unless the call strongly happens before
51
+ the start of the destructor of the associated `inplace_stop_source`
52
+ object, if any. — *end note*]
53
+
54
+ ``` cpp
55
+ stop_possible() const noexcept;
56
+ ```
57
+
58
+ *Returns:* *`stop-source`*` != nullptr`.
59
+
60
+ [*Note 2*: As specified in [[basic.stc.general]], the behavior of
61
+ `stop_possible` is implementation-defined unless the call strongly
62
+ happens before the end of the storage duration of the associated
63
+ `inplace_stop_source` object, if any. — *end note*]
64
+