Namespaces
Variants
Views
Actions

std::generator<Ref,V,Allocator>::begin

From cppreference.com
< cpp‎ | coroutine‎ | generator
 
 
Utilities library
 
Coroutine support
Coroutine traits
Coroutine handle
No-op coroutines
Trivial awaitables
Range generators
(C++23)
 
Ranges library
Range adaptors
 
 
/*iterator*/ begin();
(since C++23)

Pushes coroutine_ into *active_ stack, then evaluates coroutine_.resume().

Before invocation of begin() the coroutine_ must refer to a coroutine suspended at its initial suspend point.

[edit] Return value

An iterator whose coroutine_ member refers to the same coroutine as coroutine_ does.

[edit] Notes

It is an undefined behavior to call begin() more than once on the same generator object.

[edit] Example