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

来自cppreference.com
< cpp‎ | coroutine‎ | generator
 
 
 
协程支持
协程特征
协程句柄
无操作协程
平凡可等待体
范围生成器
(C++23)
 
范围库
范围适配器
 
 
generator& operator=( generator other )noexcept;
(C++23 起)

替换生成器对象的内容。等价于:

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

目录

[编辑]参数

other - 要被移动的生成器对象

[编辑]返回值

*this

[编辑]复杂度

[编辑]注解

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

这个赋值运算符技术上是一个复制赋值运算符,虽然 std::generator 仅可移动赋值。

[编辑]示例

close