libcopp  2.2.0
coroutine.h
Go to the documentation of this file.
1 
13 #ifndef LIBCOPP_UTILS_STD_COROUTINE_H
14 #define LIBCOPP_UTILS_STD_COROUTINE_H
15 
16 #pragma once
17 
18 #include <libcopp/utils/config/libcopp_build_features.h>
19 
20 // clang-format off
21 #include <libcopp/utils/config/stl_include_prefix.h> // NOLINT(build/include_order)
22 // clang-format on
23 #if defined(LIBCOPP_MACRO_ENABLE_STD_COROUTINE) && LIBCOPP_MACRO_ENABLE_STD_COROUTINE
24 # if defined(LIBCOPP_MACRO_USE_STD_EXPERIMENTAL_COROUTINE) && LIBCOPP_MACRO_USE_STD_EXPERIMENTAL_COROUTINE
25 # include <experimental/coroutine>
26 # define LIBCOPP_MACRO_FUTURE_COROUTINE_VOID std::experimental::coroutine_handle<>
27 # define LIBCOPP_MACRO_FUTURE_COROUTINE_TYPE(T) std::experimental::coroutine_handle<T>
28 # else
29 # include <coroutine>
30 # define LIBCOPP_MACRO_FUTURE_COROUTINE_VOID std::coroutine_handle<>
31 # define LIBCOPP_MACRO_FUTURE_COROUTINE_TYPE(T) std::coroutine_handle<T>
32 # endif
33 #endif
34 // clang-format off
35 #include <libcopp/utils/config/stl_include_suffix.h> // NOLINT(build/include_order)
36 // clang-format on
37 
38 #if defined(LIBCOPP_MACRO_USE_STD_EXPERIMENTAL_COROUTINE) && LIBCOPP_MACRO_USE_STD_EXPERIMENTAL_COROUTINE
39 # define LIBCOPP_MACRO_STD_COROUTINE_NAMESPACE std::experimental::
40 #else
41 # define LIBCOPP_MACRO_STD_COROUTINE_NAMESPACE std::
42 #endif
43 
44 #endif