名稱空間
變體
操作

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

來自 cppreference.com
< cpp‎ | 協程‎ | generator
 
 
 
協程支援
協程特質
協程控制代碼
無操作協程
平凡可等待物件
範圍生成器 (Range generators)
(C++23)
 
範圍庫 (Ranges library)
範圍介面卡 (Range adaptors)
 
 
generator& operator=( generator other ) noexcept;
(C++23 起)

替換生成器物件的內容。等同於

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

目錄

[編輯] 引數

其他 - 要從中移動的另一個生成器

[編輯] 返回值

*this

[編輯] 複雜度

[編輯] 註解

以前從 other 獲取的迭代器不會失效——它們會變成指向 *this 的迭代器。

此賦值運算子在技術上是複製賦值運算子,儘管 std::generator 僅支援移動賦值。

[編輯] 示例