std::suspend_always - cppreference.com (original) (raw)
| | | | | ----------------------- | | ------------- | | struct suspend_always; | | (since C++20) |
suspend_always is an empty class which can be used to indicate that an await expression always suspends and does not produce a value.
Contents
- 1 Member functions
- 2 std::suspend_always::await_ready
- 3 std::suspend_always::await_suspend
- 4 std::suspend_always::await_resume
[edit] Member functions
| | indicates that an await expression always suspends (public member function) | | ------------------------------------------------------------------------------ | | | no-op (public member function) | | | no-op (public member function) |
std::suspend_always::await_ready
| constexpr bool await_ready() const noexcept { return false; } | | | | -------------------------------------------------------------- | | |
Always returns false, indicating that an await expression always suspends.
std::suspend_always::await_suspend
Does nothing.
std::suspend_always::await_resume
| constexpr void await_resume() const noexcept {} | | | | ------------------------------------------------ | | |
Does nothing. An await expression does not produce a value if suspend_always is used.