命名空间
变体
操作

std::coroutine_handle<Promise>::operator=

来自 cppreference.cn
< cpp‎ | 协程‎ | 协程句柄
 
 
 
协程支持
协程特质
协程句柄
无操作协程
平凡可等待对象
范围生成器 (Range generators)
(C++23)
 
 
coroutine_handle& operator=( std::nullptr_t ) noexcept;
(1) (C++20 起)
coroutine_handle& operator=( const coroutine_handle& other ) = default;
(2) (C++20 起)
coroutine_handle& operator=( coroutine_handle&& other ) = default;
(3) (C++20 起)

替换底层地址。

1) 将底层地址替换为 null 指针值。赋值后,*this 不再引用协程。此赋值运算符未为特化 std::coroutine_handle<std::noop_coroutine_promise> 声明。
2,3) 将底层地址替换为 other 的底层地址。拷贝和移动赋值运算符等同于隐式声明的运算符。

[编辑] 参数

其他 - 另一个 coroutine_handle 用于赋值

[编辑] 返回值

*this