C/C++ API Reference
Loading...
Searching...
No Matches
pw::async2::Generator< T > Class Template Reference

Overview

template<typename T>
class pw::async2::Generator< T >

An asynchronous generator that yields values of type T.

Generators are coroutines that use co_yield to produce a stream of values. They implement a Next() method that returns a future, allowing them to be consumed in a while loop with co_await.

Public Types

using promise_type = internal::GeneratorPromise< T >
 
using handle_type = internal::OwningCoroutineHandle< promise_type >
 

Public Member Functions

 Generator (handle_type &&handle)
 
 Generator (const Generator &)=delete
 
Generatoroperator= (const Generator &)=delete
 
 Generator (Generator &&other) noexcept=default
 
Generatoroperator= (Generator &&other) noexcept=default
 
bool ok () const
 
PollOptional< T > Pend (Context &cx)
 
auto Next ()
 

Static Public Member Functions

static Generator Empty ()
 

The documentation for this class was generated from the following file: