Commit 8d485aeb authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

tweak is_coroutine_handle detail trait

Summary: Tweak `is_coroutine_handle` detail trait. No need for leading `_` and let it be a trait variable.

Reviewed By: iahs

Differential Revision: D25864424

fbshipit-source-id: 2f0723fcb3c97c6a0972056999f1d9574695c30b
parent f07bb93a
...@@ -41,14 +41,11 @@ using remove_reference_wrapper_t = typename remove_reference_wrapper<T>::type; ...@@ -41,14 +41,11 @@ using remove_reference_wrapper_t = typename remove_reference_wrapper<T>::type;
namespace detail { namespace detail {
template <typename T> template <typename T>
using _is_coroutine_handle = inline constexpr bool is_coroutine_handle_v =
folly::detail::is_instantiation_of<std::experimental::coroutine_handle, T>; folly::detail::is_instantiation_of_v< //
std::experimental::coroutine_handle,
T>;
template <typename T>
struct _is_valid_await_suspend_return_type : folly::Disjunction<
std::is_void<T>,
std::is_same<bool, T>,
_is_coroutine_handle<T>> {};
} // namespace detail } // namespace detail
/// is_awaiter<T>::value /// is_awaiter<T>::value
......
...@@ -229,8 +229,7 @@ class StackAwareViaIfAsyncAwaiter { ...@@ -229,8 +229,7 @@ class StackAwareViaIfAsyncAwaiter {
viaCoroutine_.setContinuation(h); viaCoroutine_.setContinuation(h);
viaCoroutine_.setAsyncFrame(asyncFrame); viaCoroutine_.setAsyncFrame(asyncFrame);
if constexpr (!detail::_is_coroutine_handle< if constexpr (!detail::is_coroutine_handle_v<await_suspend_result_t>) {
await_suspend_result_t>::value) {
viaCoroutine_.saveContext(); viaCoroutine_.saveContext();
} }
...@@ -316,8 +315,7 @@ class ViaIfAsyncAwaiter { ...@@ -316,8 +315,7 @@ class ViaIfAsyncAwaiter {
-> await_suspend_result_t { -> await_suspend_result_t {
viaCoroutine_.setContinuation(continuation); viaCoroutine_.setContinuation(continuation);
if constexpr (!detail::_is_coroutine_handle< if constexpr (!detail::is_coroutine_handle_v<await_suspend_result_t>) {
await_suspend_result_t>::value) {
viaCoroutine_.saveContext(); viaCoroutine_.saveContext();
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment