From 307b828ed510f286852848ccf94c186e038cc928 Mon Sep 17 00:00:00 2001 From: Florian Albrechtskirchinger Date: Sun, 24 Jul 2022 07:35:40 +0200 Subject: [PATCH] Add value_type detection to from_json for strings --- include/nlohmann/detail/conversions/from_json.hpp | 1 + single_include/nlohmann/json.hpp | 1 + 2 files changed, 2 insertions(+) diff --git a/include/nlohmann/detail/conversions/from_json.hpp b/include/nlohmann/detail/conversions/from_json.hpp index f1df783e51..af2abddbf0 100644 --- a/include/nlohmann/detail/conversions/from_json.hpp +++ b/include/nlohmann/detail/conversions/from_json.hpp @@ -117,6 +117,7 @@ template < typename BasicJsonType, typename StringType, enable_if_t < std::is_assignable::value + && is_detected_exact::value && !std::is_same::value && !is_json_ref::value, int > = 0 > inline void from_json(const BasicJsonType& j, StringType& s) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 859fdd5528..e9a451eacf 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -4480,6 +4480,7 @@ template < typename BasicJsonType, typename StringType, enable_if_t < std::is_assignable::value + && is_detected_exact::value && !std::is_same::value && !is_json_ref::value, int > = 0 > inline void from_json(const BasicJsonType& j, StringType& s)