Coroutine support (C++20)
From cppreference.com
< cpp
C++
Utilities library
|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Coroutine support
| Coroutine traits | ||||
(C++20) | ||||
| Coroutine handle | ||||
(C++20) | ||||
| No-op coroutines | ||||
(C++20) | ||||
(C++20) | ||||
| Trivial awaitables | ||||
(C++20) | ||||
(C++20) | ||||
| Range generators | ||||
(C++23) |
The coroutine support library defines several types that provide compile and run-time support for coroutines.
Contents |
[edit] Coroutine traits
| Defined in header
<coroutine> | |
| (C++20) |
trait type for discovering coroutine promise types (class template) [edit] |
[edit] Coroutine handle
| Defined in header
<coroutine> | |
| (C++20) |
used to refer to a suspended or executing coroutine (class template) [edit] |
[edit] No-op coroutines
| Defined in header
<coroutine> | |
| (C++20) |
creates a coroutine handle that has no observable effects when resumed or destroyed (function) [edit] |
| (C++20) |
used for coroutines with no observable effects (class) [edit] |
| (C++20) |
std::coroutine_handle<std::noop_coroutine_promise>, intended to refer to a no-op coroutine (typedef) [edit] |
[edit] Trivial awaitables
| Defined in header
<coroutine> | |
| (C++20) |
indicates that an await-expression should never suspend (class) [edit] |
| (C++20) |
indicates that an await-expression should always suspend (class) [edit] |
[edit] Notes
| Feature-test macro | Value | Std | Feature |
|---|---|---|---|
__cpp_lib_coroutine |
201902L |
(C++20) | Coroutine support library |
[edit] See also
| (C++23) |
A view that represents synchronous coroutine generator (class template) [edit] |