@@ -163,10 +163,14 @@ struct type_val {
163163 }
164164};
165165
166- template <int > constexpr auto is_type () -> std::false_type;
167- template <typename > constexpr auto is_type () -> std::true_type;
166+ template <typename >
167+ constexpr inline auto is_type = [] { return std::true_type{}; };
168+ template <>
169+ constexpr inline auto is_type<from_any> = [] { return std::false_type{}; };
168170
169- template <typename > struct typer ;
171+ template <typename > struct typer {
172+ using type = void ;
173+ };
170174template <typename T> struct typer <from_any(T)> {
171175 using type = T;
172176};
@@ -239,8 +243,8 @@ template <typename T> constexpr auto is_ct_v<T const> = is_ct_v<T>;
239243 STDX_PRAGMA (diagnostic ignored " -Wold-style-cast" ) \
240244 STDX_PRAGMA (diagnostic ignored " -Wunused-value" ) \
241245 if constexpr (decltype (::stdx::cxv_detail::is_type< \
242- ::stdx::cxv_detail::from_any ( \
243- __VA_ARGS__)>())::value) { \
246+ __typeof__ ( ::stdx::cxv_detail::from_any ( \
247+ __VA_ARGS__)) >())::value) { \
244248 return ::stdx::overload{ \
245249 ::stdx::cxv_detail::cx_base{}, [] { \
246250 return ::stdx::type_identity< \
@@ -299,14 +303,14 @@ constexpr auto cx_detect1(auto) { return 0; }
299303 STDX_PRAGMA (diagnostic push) \
300304 STDX_PRAGMA (diagnostic ignored " -Wold-style-cast" ) \
301305 if constexpr (decltype (::stdx::cxv_detail::is_type< \
302- ::stdx::cxv_detail::from_any ( \
303- __VA_ARGS__)>())::value) { \
306+ __typeof__ ( ::stdx::cxv_detail::from_any ( \
307+ __VA_ARGS__)) >())::value) { \
304308 return ::stdx::overload{ \
305309 ::stdx::cxv_detail::cx_base{}, [&] { \
306310 return ::stdx::type_identity< \
307- decltype ( ::stdx::cxv_detail::type_of< \
308- ::stdx::cxv_detail::from_any ( \
309- __VA_ARGS__)>())> {}; \
311+ typename ::stdx::cxv_detail::typer< \
312+ __typeof__ ( ::stdx::cxv_detail::from_any ( \
313+ __VA_ARGS__))>::type> {}; \
310314 }}; \
311315 } else if constexpr (::stdx::is_cx_value_v< \
312316 std::invoke_result_t <decltype (f)>> or \
0 commit comments