20 #include <experimental/coroutine> 21 #include <type_traits> 38 std::is_same<bool, T>,
39 _is_coroutine_handle<T>> {};
60 template <
typename T,
typename =
void>
67 decltype(std::declval<T&>().await_ready()),
68 decltype(std::declval<T&>().await_suspend(
69 std::declval<std::experimental::coroutine_handle<void>>())),
70 decltype(std::declval<T&>().await_resume())>>
72 std::is_same<bool, decltype(std::declval<T&>().await_ready())>,
73 detail::_is_valid_await_suspend_return_type<decltype(
74 std::declval<T&>().await_suspend(
76 std::experimental::coroutine_handle<void>>()))>> {};
83 template <
typename Awaitable,
typename =
void>
86 template <
typename Awaitable>
89 folly::
void_t<decltype(std::declval<Awaitable>().operator co_await())>>
90 :
is_awaiter<decltype(std::declval<Awaitable>().operator co_await())> {};
92 template <
typename Awaitable,
typename =
void>
95 template <
typename Awaitable>
98 folly::
void_t<decltype(operator co_await(std::declval<Awaitable>()))>>
99 :
is_awaiter<decltype(operator co_await(std::declval<Awaitable>()))> {};
113 template <
typename T>
115 detail::_has_member_operator_co_await<T>,
116 detail::_has_free_operator_co_await<T>,
119 template <
typename T>
148 return static_cast<Awaitable&&
>(awaitable).
operator co_await();
159 decltype(
auto)
get_awaiter(Awaitable&& awaitable) {
160 return operator co_await(static_cast<Awaitable&&>(awaitable));
169 template <
typename Awaitable,
typename =
void>
172 template <
typename Awaitable>
182 template <
typename Awaitable>
185 template <
typename Awaitable,
typename =
void>
188 template <
typename Awaitable>
193 template <
typename Awaitable>
typename awaiter_type< Awaitable >::type awaiter_type_t
constexpr bool is_awaiter_v
decltype(get_awaiter(std::declval< Awaitable >()).await_resume()) type
—— Concurrent Priority Queue Implementation ——
typename await_result< Awaitable >::type await_result_t
bool_constant< true > true_type
type_t< void, Ts... > void_t
constexpr bool is_awaitable_v
Awaitable & get_awaiter(Awaitable &&awaitable)
uint64_t value(const typename LockFreeRingBuffer< T, Atom >::Cursor &rbcursor)
bool_constant< false > false_type
decltype(get_awaiter(std::declval< Awaitable >())) type