File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ template <typename T> constexpr auto is_ct_v<T const> = is_ct_v<T>;
234234
235235#ifndef CX_VALUE
236236#define CX_VALUE (...) \
237- [& ]() constexpr { \
237+ []() constexpr { \
238238 STDX_PRAGMA (diagnostic push) \
239239 STDX_PRAGMA (diagnostic ignored " -Wold-style-cast" ) \
240240 STDX_PRAGMA (diagnostic ignored " -Wunused-value" ) \
@@ -274,7 +274,10 @@ template <typename T> constexpr auto is_ct_v<T const> = is_ct_v<T>;
274274 }([&] { return X; })
275275
276276#ifdef __clang__
277- #define CX_DETECT (X ) std::is_empty_v<decltype (CX_VALUE(X))>
277+ #define CX_DETECT (X ) \
278+ std::is_empty_v<decltype ([&] { \
279+ return (X) + ::stdx::cxv_detail::type_val{}; \
280+ })>
278281#else
279282namespace stdx {
280283inline namespace v1 {
@@ -290,10 +293,11 @@ constexpr auto cx_detect1(auto) { return 0; }
290293#endif
291294
292295#define CX_WRAP (X ) \
293- [&]< typename F>(F f) { \
296+ [&]( auto f) { \
294297 STDX_PRAGMA (diagnostic push) \
295298 STDX_PRAGMA (diagnostic ignored " -Wold-style-cast" ) \
296- if constexpr (::stdx::is_cx_value_v<std::invoke_result_t <F>>) { \
299+ if constexpr (::stdx::is_cx_value_v< \
300+ std::invoke_result_t <decltype (f)>>) { \
297301 return f (); \
298302 } else if constexpr (CX_DETECT (X)) { \
299303 if constexpr (decltype (::stdx::cxv_detail::is_type< \
You can’t perform that action at this time.
0 commit comments