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

From cppreference.com
< cpp‎ | coroutine‎ | generator
Utilities library
General utilities
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)
(C++20)
Swap and type operations
(C++20)
(C++14)
(C++11)
(C++23)
(C++11)
(C++23)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++11)
(C++17)
(C++17)
(C++23)



Coroutine support
Coroutine traits
Coroutine handle
No-op coroutines
(C++20)
Trivial awaitables
(C++20)
(C++20)
Range generators
(C++23)
Ranges library
Range adaptors
~generator();
(since C++23)

Destructs the generator object.

Given coroutine_ as the underlying coroutine object, equivalent to:

if (coroutine_)
    coroutine_.destroy();

Note, that destroying the root generator effectively destroys the entire stack of yielded generators, because the ownership of recursively yielded generators is held in awaitable objects in the coroutine frame of the yielding generator.

Complexity

Example