@@ -163,10 +163,14 @@ struct type_val {
163
163
}
164
164
};
165
165
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{}; };
168
170
169
- template <typename > struct typer ;
171
+ template <typename > struct typer {
172
+ using type = void ;
173
+ };
170
174
template <typename T> struct typer <from_any(T)> {
171
175
using type = T;
172
176
};
@@ -239,8 +243,8 @@ template <typename T> constexpr auto is_ct_v<T const> = is_ct_v<T>;
239
243
STDX_PRAGMA (diagnostic ignored " -Wold-style-cast" ) \
240
244
STDX_PRAGMA (diagnostic ignored " -Wunused-value" ) \
241
245
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) { \
244
248
return ::stdx::overload{ \
245
249
::stdx::cxv_detail::cx_base{}, [] { \
246
250
return ::stdx::type_identity< \
@@ -299,14 +303,14 @@ constexpr auto cx_detect1(auto) { return 0; }
299
303
STDX_PRAGMA (diagnostic push) \
300
304
STDX_PRAGMA (diagnostic ignored " -Wold-style-cast" ) \
301
305
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) { \
304
308
return ::stdx::overload{ \
305
309
::stdx::cxv_detail::cx_base{}, [&] { \
306
310
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> {}; \
310
314
}}; \
311
315
} else if constexpr (::stdx::is_cx_value_v< \
312
316
std::invoke_result_t <decltype (f)>> or \
0 commit comments