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/utility/generator.hpp>

Data Structures

class  const_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
 
const_iterator begin () const
 Start the generator-function and return an iterator.
 
const_iterator cbegin () const
 Start the generator-function and return an iterator.
 
std::default_sentinel_t end () const
 Return a sentinel for the iterator.
 
std::default_sentinel_t cend () const
 Return a sentinel 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 >
const_iterator v1::generator< T >::begin ( ) const
inline

Start the generator-function and return an iterator.

◆ cbegin()

template<typename T >
const_iterator v1::generator< T >::cbegin ( ) const
inline

Start the generator-function and return an iterator.

◆ cend()

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

Return a sentinel for the iterator.

◆ end()

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

Return a sentinel for the iterator.


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