From cdf5327ace25503efb22a9c3c8a07753b11b655b Mon Sep 17 00:00:00 2001 From: chenguoping Date: Thu, 14 May 2020 12:44:30 +0800 Subject: [PATCH] Fix issue#2086 --- include/nlohmann/json.hpp | 3 ++- single_include/nlohmann/json.hpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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