#include <Pt/Generator.h>
Provides the awaitable returned by Generator::next(). More...
Inherits AwaiterBase.
Public Member Functions | |
| NextAwaiter (Generator &generator) | |
| Constructs a next-awaiter for generator. | |
| ~NextAwaiter () | |
| Detaches from the generator if still pending. | |
| void | cancel () override |
| Cancels the generator's pending operation. | |
| bool | await_ready () const noexcept |
| Returns true if the generator has already finished. | |
| template<typename FormP > | |
| std::coroutine_handle | await_suspend (std::coroutine_handle< FormP > outer) |
| Suspends the consumer and resumes the generator. More... | |
| bool | await_resume () |
| Returns true if a yielded value is available. More... | |
co_await resumes when the generator yields a value or finishes. The resume value is true if Generator::value() is valid. Cancelling the generator cancels a pending next() await.
| std::coroutine_handle await_suspend | ( | std::coroutine_handle< FormP > | outer | ) |
| %std::logic_error | if the generator is already pending. |
| bool await_resume | ( | ) |
Rethrows if the generator body exited with an exception.