< cpp‎ | coroutine
Utilities library
General utilities
Date and time
Function objects
Formatting library (C++20)
Relational operators (deprecated in C++20)
Integer comparison functions
Swap and type operations
Common vocabulary types

Elementary string conversions
Coroutine support
Coroutine traits
Coroutine handle
No-op coroutines
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.


[edit] Parameters


[edit] Return value

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

[edit] 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.

[edit] Example

[edit] See also

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