名稱空間
變體
操作

std::coroutine_handle<Promise>::operator=

來自 cppreference.com
 
 
 
協程支援
協程特質
協程控制代碼
無操作協程
平凡可等待物件
範圍生成器 (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