xref: /freebsd/contrib/llvm-project/libcxx/include/coroutine (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
1349cc55cSDimitry Andric// -*- C++ -*-
2349cc55cSDimitry Andric//===----------------------------------------------------------------------===//
3349cc55cSDimitry Andric//
4349cc55cSDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5349cc55cSDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
6349cc55cSDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7349cc55cSDimitry Andric//
8349cc55cSDimitry Andric//===----------------------------------------------------------------------===//
9349cc55cSDimitry Andric
10349cc55cSDimitry Andric#ifndef _LIBCPP_COROUTINE
11349cc55cSDimitry Andric#define _LIBCPP_COROUTINE
12349cc55cSDimitry Andric
13349cc55cSDimitry Andric/**
14349cc55cSDimitry Andric    coroutine synopsis
15349cc55cSDimitry Andric
16349cc55cSDimitry Andricnamespace std {
17349cc55cSDimitry Andric// [coroutine.traits]
18349cc55cSDimitry Andrictemplate <class R, class... ArgTypes>
19349cc55cSDimitry Andric  struct coroutine_traits;
20349cc55cSDimitry Andric// [coroutine.handle]
21349cc55cSDimitry Andrictemplate <class Promise = void>
22349cc55cSDimitry Andric  struct coroutine_handle;
23349cc55cSDimitry Andric// [coroutine.handle.compare]
24349cc55cSDimitry Andricconstexpr bool operator==(coroutine_handle<> x, coroutine_handle<> y) noexcept;
25349cc55cSDimitry Andricconstexpr strong_ordering operator<=>(coroutine_handle<> x, coroutine_handle<> y) noexcept;
26349cc55cSDimitry Andric// [coroutine.handle.hash]
27349cc55cSDimitry Andrictemplate <class T> struct hash;
28349cc55cSDimitry Andrictemplate <class P> struct hash<coroutine_handle<P>>;
29349cc55cSDimitry Andric// [coroutine.noop]
30349cc55cSDimitry Andricstruct noop_coroutine_promise;
31349cc55cSDimitry Andrictemplate<> struct coroutine_handle<noop_coroutine_promise>;
32349cc55cSDimitry Andricusing noop_coroutine_handle = coroutine_handle<noop_coroutine_promise>;
33349cc55cSDimitry Andricnoop_coroutine_handle noop_coroutine() noexcept;
34349cc55cSDimitry Andric// [coroutine.trivial.awaitables]
35349cc55cSDimitry Andricstruct suspend_never;
36349cc55cSDimitry Andricstruct suspend_always;
37349cc55cSDimitry Andric} // namespace std
38349cc55cSDimitry Andric
39349cc55cSDimitry Andric */
40349cc55cSDimitry Andric
41349cc55cSDimitry Andric#include <__config>
42*0fca6ea1SDimitry Andric
43*0fca6ea1SDimitry Andric#if _LIBCPP_STD_VER >= 20
44349cc55cSDimitry Andric#  include <__coroutine/coroutine_handle.h>
45349cc55cSDimitry Andric#  include <__coroutine/coroutine_traits.h>
4604eeddc0SDimitry Andric#  include <__coroutine/noop_coroutine_handle.h>
47349cc55cSDimitry Andric#  include <__coroutine/trivial_awaitables.h>
48*0fca6ea1SDimitry Andric#endif // _LIBCPP_STD_VER >= 20
49*0fca6ea1SDimitry Andric
50349cc55cSDimitry Andric#include <version>
51349cc55cSDimitry Andric
5281ad6265SDimitry Andric// standard-mandated includes
53bdd1243dSDimitry Andric
54bdd1243dSDimitry Andric// [coroutine.syn]
5581ad6265SDimitry Andric#include <compare>
5681ad6265SDimitry Andric
57349cc55cSDimitry Andric#ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
58349cc55cSDimitry Andric#  pragma GCC system_header
59349cc55cSDimitry Andric#endif
60349cc55cSDimitry Andric
61bdd1243dSDimitry Andric#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
62bdd1243dSDimitry Andric#  include <iosfwd>
63*0fca6ea1SDimitry Andric#  include <limits>
64bdd1243dSDimitry Andric#  include <type_traits>
65bdd1243dSDimitry Andric#endif
66bdd1243dSDimitry Andric
67349cc55cSDimitry Andric#endif // _LIBCPP_COROUTINE
68