From Jason Turner

[coro.generator.members]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpsd9_be16/{from.md → to.md} +68 -0
tmp/tmpsd9_be16/{from.md → to.md} RENAMED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ### Members <a id="coro.generator.members">[[coro.generator.members]]</a>
2
+
3
+ ``` cpp
4
+ generator(generator&& other) noexcept;
5
+ ```
6
+
7
+ *Effects:* Initializes *coroutine\_* with
8
+ `exchange(other.`*`coroutine_`*`, {})` and *active\_* with
9
+ `exchange(other.active_, nullptr)`.
10
+
11
+ [*Note 1*: Iterators previously obtained from `other` are not
12
+ invalidated; they become iterators into `*this`. — *end note*]
13
+
14
+ ``` cpp
15
+ ~generator();
16
+ ```
17
+
18
+ *Effects:* Equivalent to:
19
+
20
+ ``` cpp
21
+ if (coroutine_) {
22
+ coroutine_.destroy();
23
+ }
24
+ ```
25
+
26
+ [*Note 2*: Ownership of recursively yielded generators is held in
27
+ awaitable objects in the coroutine frame of the yielding generator, so
28
+ destroying the root generator effectively destroys the entire stack of
29
+ yielded generators. — *end note*]
30
+
31
+ ``` cpp
32
+ generator& operator=(generator other) noexcept;
33
+ ```
34
+
35
+ *Effects:* Equivalent to:
36
+
37
+ ``` cpp
38
+ swap(coroutine_, other.coroutine_);
39
+ swap(active_, other.active_);
40
+ ```
41
+
42
+ *Returns:* `*this`.
43
+
44
+ [*Note 3*: Iterators previously obtained from `other` are not
45
+ invalidated; they become iterators into `*this`. — *end note*]
46
+
47
+ ``` cpp
48
+ iterator begin();
49
+ ```
50
+
51
+ *Preconditions:* *coroutine\_* refers to a coroutine suspended at its
52
+ initial suspend point [[dcl.fct.def.coroutine]].
53
+
54
+ *Effects:* Pushes *coroutine\_* into `*`*`active_`*, then evaluates
55
+ *`coroutine_`*`.resume()`.
56
+
57
+ *Returns:* An *iterator* object whose member *coroutine\_* refers to the
58
+ same coroutine as does *coroutine\_*.
59
+
60
+ [*Note 4*: A program that calls `begin` more than once on the same
61
+ generator has undefined behavior. — *end note*]
62
+
63
+ ``` cpp
64
+ default_sentinel_t end() const noexcept;
65
+ ```
66
+
67
+ *Returns:* `default_sentinel`.
68
+