2 //===----------------------------------------------------------------------===//
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8 //===----------------------------------------------------------------------===//
10 #ifndef _LIBCPP___CXX03_COROUTINE
11 #define _LIBCPP___CXX03_COROUTINE
18 template <class R, class... ArgTypes>
19 struct coroutine_traits;
21 template <class Promise = void>
22 struct coroutine_handle;
23 // [coroutine.handle.compare]
24 constexpr bool operator==(coroutine_handle<> x, coroutine_handle<> y) noexcept;
25 constexpr strong_ordering operator<=>(coroutine_handle<> x, coroutine_handle<> y) noexcept;
26 // [coroutine.handle.hash]
27 template <class T> struct hash;
28 template <class P> struct hash<coroutine_handle<P>>;
30 struct noop_coroutine_promise;
31 template<> struct coroutine_handle<noop_coroutine_promise>;
32 using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
33 noop_coroutine_handle noop_coroutine() noexcept;
34 // [coroutine.trivial.awaitables]
36 struct suspend_always;
41 #include <__cxx03/__config>
43 #if _LIBCPP_STD_VER >= 20
44 # include <__cxx03/__coroutine/coroutine_handle.h>
45 # include <__cxx03/__coroutine/coroutine_traits.h>
46 # include <__cxx03/__coroutine/noop_coroutine_handle.h>
47 # include <__cxx03/__coroutine/trivial_awaitables.h>
48 #endif // _LIBCPP_STD_VER >= 20
50 #include <__cxx03/version>
52 // standard-mandated includes
55 #include <__cxx03/compare>
57 #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
58 # pragma GCC system_header
61 #if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
62 # include <__cxx03/iosfwd>
63 # include <__cxx03/limits>
64 # include <__cxx03/type_traits>
67 #endif // _LIBCPP___CXX03_COROUTINE