File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -297,8 +297,7 @@ constexpr auto cx_detect1(auto) { return 0; }
297297 STDX_PRAGMA (diagnostic push) \
298298 STDX_PRAGMA (diagnostic ignored " -Wold-style-cast" ) \
299299 if constexpr (::stdx::is_cx_value_v< \
300- std::invoke_result_t <decltype (f)>> or \
301- std::is_empty_v<std::invoke_result_t <decltype (f)>>) { \
300+ std::invoke_result_t <decltype (f)>>) { \
302301 return f (); \
303302 } else if constexpr (CX_DETECT (X)) { \
304303 if constexpr (decltype (::stdx::cxv_detail::is_type< \
@@ -310,6 +309,9 @@ constexpr auto cx_detect1(auto) { return 0; }
310309 decltype (::stdx::cxv_detail::type_of< \
311310 ::stdx::cxv_detail::from_any (X)>())>{}; \
312311 }}; \
312+ } else if constexpr (std::is_empty_v< \
313+ std::invoke_result_t <decltype (f)>>) { \
314+ return f (); \
313315 } else { \
314316 return ::stdx::overload{::stdx::cxv_detail::cx_base{}, f}; \
315317 } \
Original file line number Diff line number Diff line change @@ -364,6 +364,13 @@ TEST_CASE("CX_WRAP type argument", "[utility]") {
364364 std::is_same_v<decltype (CX_WRAP (int )()), stdx::type_identity<int >>);
365365}
366366
367+ TEST_CASE (" CX_WRAP empty type argument" , " [utility]" ) {
368+ using X = std::integral_constant<int , 17 >;
369+ STATIC_REQUIRE (stdx::is_cx_value_v<decltype (CX_WRAP (X))>);
370+ STATIC_REQUIRE (
371+ std::is_same_v<decltype (CX_WRAP (X)()), stdx::type_identity<X>>);
372+ }
373+
367374TEST_CASE (" CX_WRAP integral_constant arg" , " [utility]" ) {
368375 auto x = std::integral_constant<int , 17 >{};
369376 STATIC_REQUIRE (std::is_same_v<decltype (CX_WRAP (x)), decltype (x)>);
You can’t perform that action at this time.
0 commit comments