std::noop_coroutine

From cppreference.com
< cpp‎ | coroutine
 
 
Utilities library
General utilities
Date and time
Function objects
Formatting library (C++20)
(C++11)
Relational operators (deprecated in C++20)
Integer comparison functions
(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++17)

Elementary string conversions
(C++17)
(C++17)
 
Coroutine support
Coroutine traits
Coroutine handle
No-op coroutines
noop_coroutine
(C++20)
Trivial awaitables
 
Defined in header <coroutine>
std::noop_coroutine_handle noop_coroutine() noexcept;
(since C++20)

Returns a coroutine handle referring to a no-op coroutine.

If there has been already a coroutine state of no-op coroutine, it is unspecified whether subsequent call to noop_coroutine returns a previously obtained coroutine handle, or a coroutine handle referring to a new coroutine state of no-op coroutine.

Parameters

(none)

Return value

A std::noop_coroutine_handle referring to a no-op coroutine.

Notes

Return values from different calls to noop_coroutine may and may not compare equal.

No-op coroutines are not required to be defined, and noop_coroutine may only return a noop_coroutine_handle referring to a coroutine state object without starting a coroutine.

Example

See also

used for coroutines with no observable effects
(class)
std::coroutine_handle<std::noop_coroutine_promise>, intended to refer to a no-op coroutine
(typedef)