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_ ) ;

목차

매개변수

other - 이동될 다른 제너레이터

반환값

* this

복잡도

참고 사항

이전에 other 에서 얻은 반복자들은 무효화되지 않으며, * this 의 반복자로 변환됩니다.

이 할당 연산자는 기술적으로 copy assignment operator 이지만, std::generator 는 move assignable만 가능합니다.

예제