From Jason Turner

[stopsource.general]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpb23k_ryw/{from.md → to.md} +42 -0
tmp/tmpb23k_ryw/{from.md → to.md} RENAMED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #### General <a id="stopsource.general">[[stopsource.general]]</a>
2
+
3
+ The class `stop_source` implements the semantics of making a stop
4
+ request. A stop request made on a `stop_source` object is visible to all
5
+ associated `stop_source` and `stop_token` [[stoptoken]] objects. Once a
6
+ stop request has been made it cannot be withdrawn (a subsequent stop
7
+ request has no effect).
8
+
9
+ ``` cpp
10
+ namespace std {
11
+ // no-shared-stop-state indicator
12
+ struct nostopstate_t {
13
+ explicit nostopstate_t() = default;
14
+ };
15
+ inline constexpr nostopstate_t nostopstate{};
16
+
17
+ class stop_source {
18
+ public:
19
+ // [stopsource.cons], constructors, copy, and assignment
20
+ stop_source();
21
+ explicit stop_source(nostopstate_t) noexcept;
22
+
23
+ stop_source(const stop_source&) noexcept;
24
+ stop_source(stop_source&&) noexcept;
25
+ stop_source& operator=(const stop_source&) noexcept;
26
+ stop_source& operator=(stop_source&&) noexcept;
27
+ ~stop_source();
28
+ void swap(stop_source&) noexcept;
29
+
30
+ // [stopsource.mem], stop handling
31
+ [[nodiscard]] stop_token get_token() const noexcept;
32
+ [[nodiscard]] bool stop_possible() const noexcept;
33
+ [[nodiscard]] bool stop_requested() const noexcept;
34
+ bool request_stop() noexcept;
35
+
36
+ [[nodiscard]] friend bool
37
+ operator==(const stop_source& lhs, const stop_source& rhs) noexcept;
38
+ friend void swap(stop_source& lhs, stop_source& rhs) noexcept;
39
+ };
40
+ }
41
+ ```
42
+