Namespaces
Variants
Views
Actions

std::generator<Ref,V,Allocator>::generator

From cppreference.com
< cpp‎ | coroutine‎ | generator
 
 
Utilities library
Language support
Type support (basic types, RTTI)
Library feature-test macros (C++20)
Dynamic memory management
Program utilities
Coroutine support (C++20)
Variadic functions
Debugging support
(C++26)
Three-way comparison
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)

 
Coroutine support
Coroutine traits
Coroutine handle
No-op coroutines
Trivial awaitables
Range generators
(C++23)
 
Ranges library
Range access
Range conversions
(C++23)

Range primitives



Dangling iterator handling
Range concepts
Views

Range factories
Range adaptors
Range generators
Range adaptor objects
Range adaptor closure objects
Helper items
(until C++23)(C++23)


 
 
generator( const generator& ) = delete;
(1) (since C++23)
generator( generator&& other ) noexcept;
(2) (since C++23)

Constructs a generator.

1) The copy-constructor is deleted.
2) The move-constructor that initializes the underlying coroutine_ with std::exchange(other.coroutine_, {}), and the underlying stack of coroutine handles (active_) with std::exchange(other.active_, nullptr). Note, that the iterators, previously obtained from other, are not invalidated, but become iterators into *this.

[edit] Parameters

other - a generator object to be moved in

[edit] Example