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

From cppreference.com
< cpp‎ | coroutine‎ | generator

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

| This section is incomplete

### Notes

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

### Example

| This section is incomplete Reason: no example

Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/coroutine/generator/operator%3D&oldid=147891"