File indexing completed on 2025-01-18 09:54:52
0001
0002
0003
0004
0005 #ifndef CPPCORO_IS_AWAITABLE_HPP_INCLUDED
0006 #define CPPCORO_IS_AWAITABLE_HPP_INCLUDED
0007
0008 #include <cppcoro/detail/get_awaiter.hpp>
0009
0010 #include <type_traits>
0011
0012 namespace cppcoro
0013 {
0014 template<typename T, typename = std::void_t<>>
0015 struct is_awaitable : std::false_type {};
0016
0017 template<typename T>
0018 struct is_awaitable<T, std::void_t<decltype(cppcoro::detail::get_awaiter(std::declval<T>()))>>
0019 : std::true_type
0020 {};
0021
0022 template<typename T>
0023 constexpr bool is_awaitable_v = is_awaitable<T>::value;
0024 }
0025
0026 #endif