diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index 2195dcb4..5a44312a 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -3768,7 +3768,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 bf10cae2..b47b4ac4 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -19560,7 +19560,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