diff --git a/include/nlohmann/detail/meta/detected.hpp b/include/nlohmann/detail/meta/detected.hpp index 7b5a00353..deea3e17c 100644 --- a/include/nlohmann/detail/meta/detected.hpp +++ b/include/nlohmann/detail/meta/detected.hpp @@ -37,7 +37,7 @@ struct detector>, Op, Args...> }; template class Op, class... Args> -using is_detected = typename detector::value_t; +struct is_detected : detector::value_t {}; template class Op, class... Args> using detected_t = typename detector::type; diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 0bbaa9503..1215747ec 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -3342,15 +3342,18 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec @since version 1.0.0 */ template < typename ValueType, typename std::enable_if < - !std::is_pointer::value&& - !std::is_same>::value&& - !std::is_same::value&& - !detail::is_basic_json::value - && !std::is_same>::value + detail::conjunction < + std::integral_constant < bool, + !std::is_pointer::value&& + !std::is_same>::value&& + !std::is_same::value&& + !detail::is_basic_json::value + && !std::is_same>::value #if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1910 && _MSC_VER <= 1914)) - && !std::is_same::value + && !std::is_same::value #endif - && detail::is_detected::value + >, + detail::is_detected>::value , int >::type = 0 > JSON_EXPLICIT operator ValueType() const { diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 2716e1e7b..2e8dd72b2 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -3305,7 +3305,7 @@ struct detector>, Op, Args...> }; template class Op, class... Args> -using is_detected = typename detector::value_t; +struct is_detected : detector::value_t {}; template class Op, class... Args> using detected_t = typename detector::type; @@ -20362,15 +20362,18 @@ class basic_json // NOLINT(cppcoreguidelines-special-member-functions,hicpp-spec @since version 1.0.0 */ template < typename ValueType, typename std::enable_if < - !std::is_pointer::value&& - !std::is_same>::value&& - !std::is_same::value&& - !detail::is_basic_json::value - && !std::is_same>::value + detail::conjunction < + std::integral_constant < bool, + !std::is_pointer::value&& + !std::is_same>::value&& + !std::is_same::value&& + !detail::is_basic_json::value + && !std::is_same>::value #if defined(JSON_HAS_CPP_17) && (defined(__GNUC__) || (defined(_MSC_VER) && _MSC_VER >= 1910 && _MSC_VER <= 1914)) - && !std::is_same::value + && !std::is_same::value #endif - && detail::is_detected::value + >, + detail::is_detected>::value , int >::type = 0 > JSON_EXPLICIT operator ValueType() const {