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

From cppreference.com
 
 
Utilities library
Language support
Type support (basic types, RTTI)
Library feature-test macros (C++20)
Dynamic memory management
Program utilities
Coroutine support (C++20)
Variadic functions
Debugging support
(C++26)
Three-way comparison
(C++20)
(C++20)(C++20)(C++20)
(C++20)(C++20)(C++20)
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(C++20)(C++20)(C++20)   
(C++20)
Swap and type operations
(C++14)
(C++11)
(C++11)
(C++11)
(C++17)
Common vocabulary types
(C++11)
(C++17)
(C++17)
(C++17)
(C++11)
(C++17)
(C++23)
Elementary string conversions
(C++17)
(C++17)

 
Coroutine support
Coroutine traits
Coroutine handle
No-op coroutines
Trivial awaitables
Range generators
(C++23)
 
Ranges library
Range access
Range conversions
(C++23)

Range primitives



Dangling iterator handling
Range concepts
Views

Range factories
Range adaptors
Range generators
Range adaptor objects
Range adaptor closure objects
Helper items
(until C++23)(C++23)


 
 
auto final_suspend() noexcept;
(since C++23)

Let x be some generator object.

final_suspend does the following:

  1. Pops the coroutine handle from the top of *active_.
  2. If *x.active_ is not empty, resumes execution of the coroutine referred to by x.active_->top(). If it is empty, control flow returns to the current coroutine caller or resumer.

A handle referring to the coroutine whose promise object is *this must be at the top of *x.active_ of x. This function must be called by the coroutine upon reaching its final suspend point, otherwise the behavior is undefined.

Parameters

(none)

Return value

An awaitable object of unspecified type whose member functions are configured to suspend the calling coroutine.