llvm-project
67 строк · 1.9 Кб
1// -*- C++ -*-
2//===----------------------------------------------------------------------===//
3//
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
7//
8//===----------------------------------------------------------------------===//
9
10#ifndef _LIBCPP_COROUTINE
11#define _LIBCPP_COROUTINE
12
13/**
14coroutine synopsis
15
16namespace std {
17// [coroutine.traits]
18template <class R, class... ArgTypes>
19struct coroutine_traits;
20// [coroutine.handle]
21template <class Promise = void>
22struct coroutine_handle;
23// [coroutine.handle.compare]
24constexpr bool operator==(coroutine_handle<> x, coroutine_handle<> y) noexcept;
25constexpr strong_ordering operator<=>(coroutine_handle<> x, coroutine_handle<> y) noexcept;
26// [coroutine.handle.hash]
27template <class T> struct hash;
28template <class P> struct hash<coroutine_handle<P>>;
29// [coroutine.noop]
30struct noop_coroutine_promise;
31template<> struct coroutine_handle<noop_coroutine_promise>;
32using noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
33noop_coroutine_handle noop_coroutine() noexcept;
34// [coroutine.trivial.awaitables]
35struct suspend_never;
36struct suspend_always;
37} // namespace std
38
39*/
40
41#include <__config>
42
43#if _LIBCPP_STD_VER >= 20
44# include <__coroutine/coroutine_handle.h>
45# include <__coroutine/coroutine_traits.h>
46# include <__coroutine/noop_coroutine_handle.h>
47# include <__coroutine/trivial_awaitables.h>
48#endif // _LIBCPP_STD_VER >= 20
49
50#include <version>
51
52// standard-mandated includes
53
54// [coroutine.syn]
55#include <compare>
56
57#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
58# pragma GCC system_header
59#endif
60
61#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
62# include <iosfwd>
63# include <limits>
64# include <type_traits>
65#endif
66
67#endif // _LIBCPP_COROUTINE
68