STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Classes | Public Member Functions | Private Attributes | List of all members
experimental::generator< _Ty, _Alloc > Struct Template Reference

Classes

struct  iterator
 
struct  promise_type
 

Public Member Functions

iterator begin ()
 
iterator end ()
 
 generator (promise_type &_Prom)
 
 generator ()=default
 
 generator (generator const &)=delete
 
generatoroperator= (generator const &)=delete
 
 generator (generator &&_Right)
 
generatoroperator= (generator &&_Right)
 
 ~generator ()
 

Private Attributes

coroutine_handle< promise_type_Coro = nullptr
 

Constructor & Destructor Documentation

template<typename _Ty , typename _Alloc = allocator<char>>
experimental::generator< _Ty, _Alloc >::generator ( promise_type _Prom)
inlineexplicit
152  : _Coro(coroutine_handle<promise_type>::from_promise(
153  _Prom))
154  {
155  }
coroutine_handle< promise_type > _Coro
Definition: generator:185
template<typename _Ty , typename _Alloc = allocator<char>>
experimental::generator< _Ty, _Alloc >::generator ( )
default
template<typename _Ty , typename _Alloc = allocator<char>>
experimental::generator< _Ty, _Alloc >::generator ( generator< _Ty, _Alloc > const &  )
delete
template<typename _Ty , typename _Alloc = allocator<char>>
experimental::generator< _Ty, _Alloc >::generator ( generator< _Ty, _Alloc > &&  _Right)
inline
163  : _Coro(_Right._Coro)
164  {
165  _Right._Coro = nullptr;
166  }
coroutine_handle< promise_type > _Coro
Definition: generator:185
constexpr const _Ty &() _Right
Definition: algorithm:3591
template<typename _Ty , typename _Alloc = allocator<char>>
experimental::generator< _Ty, _Alloc >::~generator ( )
inline
178  {
179  if (_Coro) {
180  _Coro.destroy();
181  }
182  }
coroutine_handle< promise_type > _Coro
Definition: generator:185

Member Function Documentation

template<typename _Ty , typename _Alloc = allocator<char>>
iterator experimental::generator< _Ty, _Alloc >::begin ( )
inline
136  {
137  if (_Coro) {
138  _Coro.resume();
139  if (_Coro.done())
140  return {nullptr};
141  }
142 
143  return {_Coro};
144  }
coroutine_handle< promise_type > _Coro
Definition: generator:185
template<typename _Ty , typename _Alloc = allocator<char>>
iterator experimental::generator< _Ty, _Alloc >::end ( )
inline
147  {
148  return {nullptr};
149  }
template<typename _Ty , typename _Alloc = allocator<char>>
generator& experimental::generator< _Ty, _Alloc >::operator= ( generator< _Ty, _Alloc > const &  )
delete
template<typename _Ty , typename _Alloc = allocator<char>>
generator& experimental::generator< _Ty, _Alloc >::operator= ( generator< _Ty, _Alloc > &&  _Right)
inline
169  {
170  if (&_Right != this) {
171  _Coro = _Right._Coro;
172  _Right._Coro = nullptr;
173  }
174  return *this;
175  }
coroutine_handle< promise_type > _Coro
Definition: generator:185
constexpr const _Ty &() _Right
Definition: algorithm:3591

Member Data Documentation

template<typename _Ty , typename _Alloc = allocator<char>>
coroutine_handle<promise_type> experimental::generator< _Ty, _Alloc >::_Coro = nullptr
private

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