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

< cpp‎ | coroutine‎ | generator
generator& operator=( generator other ) noexcept;
(C++23 起)

替换生成器对象的内容。

等价于:

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

参数

other - 要被复制的生成器对象

返回值

*this

复杂度

注解

来自 other 的迭代器不会失效 – 他们现在是 *this 的迭代器。

Example