diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 9b26dd70..f7216673 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -3759,7 +3759,8 @@ class basic_json @since version 1.0.0 */ template::value, int>::type = 0> + std::is_convertible::value + and not std::is_same::value, int>::type = 0> ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const { // at only works for objects diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index f5abd465..af66b320 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -19205,7 +19205,8 @@ class basic_json @since version 1.0.0 */ template::value, int>::type = 0> + std::is_convertible::value + and not std::is_same::value, int>::type = 0> ValueType value(const typename object_t::key_type& key, const ValueType& default_value) const { // at only works for objects