Clang conformance - #779
Conversation
| template <typename> static constexpr bool find_co_await_free(...) { return false; } | ||
|
|
||
| #ifdef WINRT_IMPL_COROUTINES | ||
| template <typename U, typename = decltype(std::declval<U>().await_ready())> static constexpr bool find_awaitable_member(int) { return true; } |
There was a problem hiding this comment.
This one doesn't mention operator co_await and could stay in its original location, I think.
There was a problem hiding this comment.
It was just cleaner to group the trues and falses together.
| template <typename T> | ||
| decltype(auto) get_awaiter(T&& value) noexcept | ||
| { | ||
| #ifdef WINRT_IMPL_COROUTINES |
There was a problem hiding this comment.
I think we don't need this #ifdef any more. has_co_await_member and has_co_await_free will always be false if WINRT_IMPL_COROUTINES is not defined, so we fall through to the last case, which requires the type to be its own awaiter (and if we move the find_awaitable_member outside the #ifdef it will work), it will look for an await_ready which is fine.
There was a problem hiding this comment.
Unfortunately, Clang currently looks inside the if constexpr regardless and fails to compile.
There was a problem hiding this comment.
Oh, yeah, forgot about that. Even though it's if constexpr'd out, it still has to compile.
Fixes #566
Looks like Clang defines
__cpp_coroutinesbut not__cpp_lib_coroutineas it should. Anyway, this fix should tide us over until Clang offers full coroutine support. This change justifdefs away the mentions ofoperator co_awaitifWINRT_IMPL_COROUTINESis not defined.Also, silenced a few more warnings about dependent template names.