HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Data Structures | Public Types | Public Member Functions
v1::generator< T > Class Template Reference

#include <hikogui/generator.hpp>

Data Structures

class  iterator
 A forward iterator which iterates through values co_yieled by the generator-function. More...
 
class  promise_type
 
class  value_proxy
 

Public Types

using value_type = T
 
using handle_type = std::coroutine_handle<promise_type>
 

Public Member Functions

 generator (handle_type coroutine)
 
 generator (const generator &)=delete
 
generatoroperator= (const generator &)=delete
 
 generator (generator &&other) noexcept
 
generatoroperator= (generator &&other) noexcept
 
iterator begin ()
 Start the generator-function and return an iterator.
 
std::default_sentinel_t end ()
 Return a sentinal for the iterator.
 

Detailed Description

template<typename T>
class v1::generator< T >

A return value for a generator-function.

A generator-function is a coroutine which co_yields zero or more values.

The generator object returned from the generator-function is used to retrieve the yielded values through an forward-iterator returned by the begin() and end() member functions.

The incrementing the iterator will resume the generator-function until the generator-function co_yields another value.

Member Function Documentation

◆ begin()

template<typename T >
iterator v1::generator< T >::begin ( )
inline

Start the generator-function and return an iterator.

◆ end()

template<typename T >
std::default_sentinel_t v1::generator< T >::end ( )
inline

Return a sentinal for the iterator.


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