Namespaces
Variants
Actions

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

From cppreference.com
< cpp‎ | coroutine‎ | generator
 
C++
 
Utilities library
General utilities
Relational operators (deprecated in C++20)
 
Coroutine support
Coroutine traits
Coroutine handle
No-op coroutines
Trivial awaitables
Range generators
(C++23)
 
Ranges library
Range adaptors
 
std::generator
generator( const generator& ) = delete;
(1) (since C++23)
generator( generator&& other ) noexcept;
(2) (since C++23)

Constructs a generator.

1) The copy-constructor is deleted.
2) The move-constructor that initializes the underlying coroutine_ with std::exchange(other.coroutine_, {}), and the underlying stack of coroutine handles (active_) with std::exchange(other.active_, nullptr). Note, that the iterators, previously obtained from other, are not invalidated, but become iterators into *this.

[edit] Parameters

other - a generator object to be moved in

[edit] Example

Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!

Check out: eBank.nz (Art Generator) | Netwrck.com (AI Tools) | Text-Generator.io (AI API) | BitBank.nz (Crypto AI) | ReadingTime (Kids Reading) | RewordGame | BigMultiplayerChess | WebFiddle | How.nz | Helix AI Assistant