1 //===----------------------------------------------------------------------===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 #ifndef __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H
10 #define __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H
13 #include <__coroutine/coroutine_handle.h>
15 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
16 # pragma GCC system_header
19 #if _LIBCPP_STD_VER >= 20
21 _LIBCPP_BEGIN_NAMESPACE_STD
23 // [coroutine.trivial.awaitables]
24 struct suspend_never
{
26 constexpr bool await_ready() const noexcept
{ return true; }
28 constexpr void await_suspend(coroutine_handle
<>) const noexcept
{}
30 constexpr void await_resume() const noexcept
{}
33 struct suspend_always
{
35 constexpr bool await_ready() const noexcept
{ return false; }
37 constexpr void await_suspend(coroutine_handle
<>) const noexcept
{}
39 constexpr void await_resume() const noexcept
{}
42 _LIBCPP_END_NAMESPACE_STD
44 #endif // __LIBCPP_STD_VER >= 20
46 #endif // __LIBCPP___COROUTINE_TRIVIAL_AWAITABLES_H