diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 1f39e3ec7..cd7fb22f4 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -5542,8 +5542,10 @@ class basic_json @brief comparison: equal @copydoc operator==(const_reference, const_reference) */ - template::value, int>::type = 0> + template < typename ScalarType, typename std::enable_if < + std::is_scalar::value, int >::type = 0, + typename std::enable_if < + std::is_same>::value, int >::type = 0 > friend bool operator==(const_reference lhs, const ScalarType rhs) noexcept { return (lhs == basic_json(rhs)); @@ -5553,8 +5555,10 @@ class basic_json @brief comparison: equal @copydoc operator==(const_reference, const_reference) */ - template::value, int>::type = 0> + template < typename ScalarType, typename std::enable_if < + std::is_scalar::value, int >::type = 0, + typename std::enable_if < + std::is_same>::value, int >::type = 0 > friend bool operator==(const ScalarType lhs, const_reference rhs) noexcept { return (basic_json(lhs) == rhs); diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index ac27d3d4c..2f6dd1766 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -16649,8 +16649,10 @@ class basic_json @brief comparison: equal @copydoc operator==(const_reference, const_reference) */ - template::value, int>::type = 0> + template < typename ScalarType, typename std::enable_if < + std::is_scalar::value, int >::type = 0, + typename std::enable_if < + !std::is_same>::value, int >::type = 0 > friend bool operator==(const_reference lhs, const ScalarType rhs) noexcept { return (lhs == basic_json(rhs)); @@ -16660,8 +16662,10 @@ class basic_json @brief comparison: equal @copydoc operator==(const_reference, const_reference) */ - template::value, int>::type = 0> + template < typename ScalarType, typename std::enable_if < + std::is_scalar::value, int >::type = 0, + typename std::enable_if < + !std::is_same>::value, int >::type = 0 > friend bool operator==(const ScalarType lhs, const_reference rhs) noexcept { return (basic_json(lhs) == rhs);