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
154  : _Coro(coroutine_handle<promise_type>::from_promise(_Prom))
155  {
156  }
coroutine_handle< promise_type > _Coro
Definition: generator:186
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
164  : _Coro(_Right._Coro)
165  {
166  _Right._Coro = nullptr;
167  }
coroutine_handle< promise_type > _Coro
Definition: generator:186
constexpr const _Ty &() _Right
Definition: algorithm:3723
template<typename _Ty , typename _Alloc = allocator<char>>
experimental::generator< _Ty, _Alloc >::~generator ( )
inline
179  {
180  if (_Coro) {
181  _Coro.destroy();
182  }
183  }
coroutine_handle< promise_type > _Coro
Definition: generator:186

Member Function Documentation

template<typename _Ty , typename _Alloc = allocator<char>>
iterator experimental::generator< _Ty, _Alloc >::begin ( )
inline
138  {
139  if (_Coro) {
140  _Coro.resume();
141  if (_Coro.done())
142  return {nullptr};
143  }
144 
145  return {_Coro};
146  }
coroutine_handle< promise_type > _Coro
Definition: generator:186
template<typename _Ty , typename _Alloc = allocator<char>>
iterator experimental::generator< _Ty, _Alloc >::end ( )
inline
149  {
150  return {nullptr};
151  }
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
170  {
171  if (this != _STD addressof(_Right)) {
172  _Coro = _Right._Coro;
173  _Right._Coro = nullptr;
174  }
175  return *this;
176  }
_STD_BEGIN constexpr _Ty * addressof(_Ty &_Val) _NOEXCEPT
Definition: xstddef:628
coroutine_handle< promise_type > _Coro
Definition: generator:186
constexpr const _Ty &() _Right
Definition: algorithm:3723

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: