26 Ranges library [ranges]

26.8 Range generators [coro.generator]

26.8.4 Members [coro.generator.members]

generator(generator&& other) noexcept;
Effects: Initializes coroutine_ with exchange(other.coroutine_, {}) and active_ with exchange(​other.active_, nullptr).
[Note 1: 
Iterators previously obtained from other are not invalidated; they become iterators into *this.
— end note]
~generator();
Effects: Equivalent to: if (coroutine_) { coroutine_.destroy(); }
[Note 2: 
Ownership of recursively yielded generators is held in awaitable objects in the coroutine frame of the yielding generator, so destroying the root generator effectively destroys the entire stack of yielded generators.
— end note]
generator& operator=(generator other) noexcept;
Effects: Equivalent to: swap(coroutine_, other.coroutine_); swap(active_, other.active_);
Returns: *this.
[Note 3: 
Iterators previously obtained from other are not invalidated; they become iterators into *this.
— end note]
iterator begin();
Preconditions: coroutine_ refers to a coroutine suspended at its initial suspend point ([dcl.fct.def.coroutine]).
Effects: Pushes coroutine_ into *active_, then evaluates coroutine_.resume().
Returns: An iterator object whose member coroutine_ refers to the same coroutine as does coroutine_.
[Note 4: 
A program that calls begin more than once on the same generator has undefined behavior.
— end note]
default_sentinel_t end() const noexcept;
Returns: default_sentinel.