mp-coro main
Coroutine support tools
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
generator< T > Class Template Reference

#include <mp-coro/generator.h>

Detailed Description

template<typename T>
class mp_coro::generator< T >
Examples
generator.cpp.

Definition at line 39 of file generator.h.

+ Collaboration diagram for generator< T >:

Classes

class  iterator
 
struct  promise_type
 

Public Types

using value_type = std::remove_reference_t< T >
 
using reference = std::conditional_t< std::is_reference_v< T >, T, const value_type & >
 
using pointer = std::add_pointer_t< reference >
 

Public Member Functions

 generator ()=default
 
iterator begin ()
 
std::default_sentinel_t end () const noexcept
 

Private Member Functions

 generator (promise_type *promise)
 

Private Attributes

promise_ptr< promise_typepromise_
 

Member Typedef Documentation

◆ value_type

using value_type = std::remove_reference_t<T>

Definition at line 41 of file generator.h.

◆ reference

using reference = std::conditional_t<std::is_reference_v<T>, T, const value_type &>

Definition at line 42 of file generator.h.

◆ pointer

using pointer = std::add_pointer_t<reference>

Definition at line 43 of file generator.h.

Constructor & Destructor Documentation

◆ generator() [1/2]

generator ( )
default

◆ generator() [2/2]

generator ( promise_type promise)
inlineprivate

Definition at line 141 of file generator.h.

Member Function Documentation

◆ begin()

iterator begin ( )
inline

Definition at line 126 of file generator.h.

◆ end()

std::default_sentinel_t end ( ) const
inlinenoexcept

Definition at line 134 of file generator.h.

Member Data Documentation

◆ promise_

promise_ptr<promise_type> promise_
private

Definition at line 140 of file generator.h.


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