andle  ](http://en.cppreference.com/w/cpp/coroutine/coroutine_handle) < promise_type  >   
(  exposition-only member object*  )  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/coroutine/generator&action=edit&section=4 "Edit
section: Member functions") ]  Member functions

[ (constructor)  ](/w/cpp/coroutine/generator/generator "cpp/coroutine/generator/generator") |  constructs a ` generator ` object   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/coroutine/generator/dsc_constructor&action=edit)  
---|---  
[ (destructor)  ](/w/cpp/coroutine/generator/%7Egenerator "cpp/coroutine/generator/~generator") |  effectively destroys the entire stack of yielded ` generator ` s   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/coroutine/generator/dsc_destructor&action=edit)  
[ operator=  ](/w/cpp/coroutine/generator/operator%3D "cpp/coroutine/generator/operator=") |  assigns a ` generator ` object   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/coroutine/generator/dsc_operator%3D&action=edit)  
[ begin  ](/w/cpp/coroutine/generator/begin "cpp/coroutine/generator/begin") |  resumes the initially suspended coroutine and returns an iterator to its handle   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/coroutine/generator/dsc_begin&action=edit)  
[ end  ](/w/cpp/coroutine/generator/end "cpp/coroutine/generator/end") |  returns  [ std::default_sentinel ](/w/cpp/iterator/default_sentinel "cpp/iterator/default sentinel")   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/coroutine/generator/dsc_end&action=edit)  
  
#####  Inherited from  [ std::ranges::view_interface
](/w/cpp/ranges/view_interface "cpp/ranges/view interface")  
  
[ empty  ](/w/cpp/ranges/view_interface/empty "cpp/ranges/view interface/empty") (C++20)  |  returns whether the derived view is empty. Provided if it satisfies [ ` sized_range ` ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") or [ ` forward_range ` ](/w/cpp/ranges/forward_range "cpp/ranges/forward range") .   
(public member function of ` std::ranges::view_interface<D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_empty&action=edit)  
[ cbegin  ](/w/cpp/ranges/view_interface/cbegin "cpp/ranges/view interface/cbegin") (C++23)  |  returns a constant iterator to the beginning of the range.   
(public member function of ` std::ranges::view_interface<D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_cbegin&action=edit)  
[ cend  ](/w/cpp/ranges/view_interface/cend "cpp/ranges/view interface/cend") (C++23)  |  returns a sentinel for the constant iterator of the range.   
(public member function of ` std::ranges::view_interface<D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_cend&action=edit)  
[ operator bool  ](/w/cpp/ranges/view_interface/operator_bool "cpp/ranges/view interface/operator bool") (C++20)  |  returns whether the derived view is not empty. Provided if  [ ranges::empty ](/w/cpp/ranges/empty "cpp/ranges/empty") is applicable to it.   
(public member function of ` std::ranges::view_interface<D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_operator_bool&action=edit)  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/coroutine/generator&action=edit&section=5 "Edit
section: Nested classes") ]  Nested classes

[ promise_type  ](/w/cpp/coroutine/generator/promise_type "cpp/coroutine/generator/promise type") |  the promise type   
(public member class)  
---|---  
[ _ iterator  _ ](/w/cpp/coroutine/generator/iterator "cpp/coroutine/generator/iterator") |  the iterator type   
(  exposition-only member class*  )