tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
coroutine_traits.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2// SPDX-FileCopyrightText: Copyright (C) 2021 Tobias Hienzsch
3
4#ifndef TETL_COROUTINE_COROUTINE_TRAITS_HPP
5#define TETL_COROUTINE_COROUTINE_TRAITS_HPP
6
7#include <etl/_type_traits/void_t.hpp>
8
9#if defined(__cpp_coroutines)
10
11namespace etl {
12
13namespace detail {
14template <typename R, typename = void>
15struct coro_traits { };
16
17template <typename R>
18struct coro_traits<R, void_t<typename R::promise_type>> {
19 using promise_type = typename R::promise_type;
20};
21} // namespace detail
22
23/// \ingroup coroutine
24template <typename R, typename... Args>
25struct coroutine_traits : detail::coro_traits<R> { };
26
27} // namespace etl
28
29#endif // defined(__cpp_coroutines)
30
31#endif // TETL_COROUTINE_COROUTINE_TRAITS_HPP