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

From cppreference.com
< cpp‎ | coroutine‎ | generator
 
 
Utilities library
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& operator=( generator other ) noexcept;
(since C++23)

Replaces the contents of the generator object.

Equivalent to:

std::swap(coroutine_, other.coroutine_);
std::swap(active_, other.active_);

Parameters

other - another generator to be copied from

Return value

*this

Complexity

Notes

Iterators previously obtained from other are not invalidated – they become iterators into *this.

Example