wwa-coro 0.0.1
Yet Another C++20 Coroutine Library
|
Asynchronous generator. More...
#include <coroutine>
#include <exception>
#include <iterator>
#include <memory>
#include <type_traits>
#include <utility>
#include "detail.h"
#include "exceptions.h"
Go to the source code of this file.
Classes | |
class | wwa::coro::async_generator< Result > |
An asynchronous generator that produces values of type Result . More... | |
class | wwa::coro::async_generator< Result >::iterator |
An input iterator that asynchronously produces values of type Result . More... | |
class | wwa::coro::async_generator< Result >::promise_type |
The promise type of the generator. More... | |
Namespaces | |
namespace | wwa |
namespace | wwa::coro |
Library namespace. | |
Asynchronous generator.
This file contains the definition of an asynchronous generator class template. The async_generator
template class allows for the creation of coroutine-based generators that produce values of a specified type asynchronously. It provides an interface for iterating over the generated values using co_await and asynchronous iteration.
Example usage:
With the help of sync_generator_adapter
, you can adapt an asynchronous generator to use it in a synchronous context (e.g., range-based for loops or views).
Definition in file async_generator.h.