命名空间
变体
操作

std::coroutine_handle<Promise>::operator=

来自 cppreference.cn
< cpp‎ | 协程‎ | 协程句柄
 
 
 
协程支持
协程特性
协程句柄
无操作协程
平凡可等待对象
范围生成器
(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 的地址。复制和移动赋值运算符等效于隐式声明的运算符。

[edit] 参数

other - 另一个要从中赋值的 coroutine_handle

[edit] 返回值

*this