Namespaces
Variants

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

From cppreference.net
Utilities library
Coroutine support
Coroutine traits
Coroutine handle
No-op coroutines
Trivial awaitables
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 へのイテレータになります。

この代入演算子は技術的には copy assignment operator ですが、 std::generator はmove assignableのみです。