From Jason Turner

[coroutine.noop]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpr7401htk/{from.md → to.md} +99 -0
tmp/tmpr7401htk/{from.md → to.md} RENAMED
@@ -0,0 +1,99 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### No-op coroutines <a id="coroutine.noop">[[coroutine.noop]]</a>
2
+
3
+ #### Class `noop_coroutine_promise` <a id="coroutine.promise.noop">[[coroutine.promise.noop]]</a>
4
+
5
+ ``` cpp
6
+ struct noop_coroutine_promise {};
7
+ ```
8
+
9
+ The class `noop_coroutine_promise` defines the promise type for the
10
+ coroutine referred to by `noop_coroutine_handle` [[coroutine.syn]].
11
+
12
+ #### Class `coroutine_handle<noop_coroutine_promise>` <a id="coroutine.handle.noop">[[coroutine.handle.noop]]</a>
13
+
14
+ ``` cpp
15
+ namespace std {
16
+ template<>
17
+ struct coroutine_handle<noop_coroutine_promise> : coroutine_handle<>
18
+ {
19
+ // [coroutine.handle.noop.observers], observers
20
+ constexpr explicit operator bool() const noexcept;
21
+ constexpr bool done() const noexcept;
22
+
23
+ // [coroutine.handle.noop.resumption], resumption
24
+ constexpr void operator()() const noexcept;
25
+ constexpr void resume() const noexcept;
26
+ constexpr void destroy() const noexcept;
27
+
28
+ // [coroutine.handle.noop.promise], promise access
29
+ noop_coroutine_promise& promise() const noexcept;
30
+
31
+ // [coroutine.handle.noop.address], address
32
+ constexpr void* address() const noexcept;
33
+ private:
34
+ coroutine_handle(unspecified);
35
+ };
36
+ }
37
+ ```
38
+
39
+ ##### Observers <a id="coroutine.handle.noop.observers">[[coroutine.handle.noop.observers]]</a>
40
+
41
+ ``` cpp
42
+ constexpr explicit operator bool() const noexcept;
43
+ ```
44
+
45
+ *Returns:* `true`.
46
+
47
+ ``` cpp
48
+ constexpr bool done() const noexcept;
49
+ ```
50
+
51
+ *Returns:* `false`.
52
+
53
+ ##### Resumption <a id="coroutine.handle.noop.resumption">[[coroutine.handle.noop.resumption]]</a>
54
+
55
+ ``` cpp
56
+ constexpr void operator()() const noexcept;
57
+ constexpr void resume() const noexcept;
58
+ constexpr void destroy() const noexcept;
59
+ ```
60
+
61
+ *Effects:* None.
62
+
63
+ *Remarks:* If `noop_coroutine_handle` is converted to
64
+ `coroutine_handle<>`, calls to `operator()`, `resume` and `destroy` on
65
+ that handle will also have no observable effects.
66
+
67
+ ##### Promise access <a id="coroutine.handle.noop.promise">[[coroutine.handle.noop.promise]]</a>
68
+
69
+ ``` cpp
70
+ noop_coroutine_promise& promise() const noexcept;
71
+ ```
72
+
73
+ *Returns:* A reference to the promise object associated with this
74
+ coroutine handle.
75
+
76
+ ##### Address <a id="coroutine.handle.noop.address">[[coroutine.handle.noop.address]]</a>
77
+
78
+ ``` cpp
79
+ constexpr void* address() const noexcept;
80
+ ```
81
+
82
+ *Returns:* `ptr`.
83
+
84
+ *Remarks:* A `noop_coroutine_handle`’s `ptr` is always a non-null
85
+ pointer value.
86
+
87
+ #### Function `noop_coroutine` <a id="coroutine.noop.coroutine">[[coroutine.noop.coroutine]]</a>
88
+
89
+ ``` cpp
90
+ noop_coroutine_handle noop_coroutine() noexcept;
91
+ ```
92
+
93
+ *Returns:* A handle to a coroutine that has no observable effects when
94
+ resumed or destroyed.
95
+
96
+ *Remarks:* A handle returned from `noop_coroutine` may or may not
97
+ compare equal to a handle returned from another invocation of
98
+ `noop_coroutine`.
99
+