From 628f76729e66dd67a2dd66fcc25a9f504c4a0a7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20DELRIEU?= Date: Wed, 5 Sep 2018 17:26:32 +0200 Subject: [PATCH] do not check for compatible_object_type in compatible_array_type --- include/nlohmann/detail/conversions/to_json.hpp | 10 ++++++---- single_include/nlohmann/json.hpp | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/include/nlohmann/detail/conversions/to_json.hpp b/include/nlohmann/detail/conversions/to_json.hpp index 35be5de46..04c93be19 100644 --- a/include/nlohmann/detail/conversions/to_json.hpp +++ b/include/nlohmann/detail/conversions/to_json.hpp @@ -248,10 +248,12 @@ void to_json(BasicJsonType& j, const std::vector& e) external_constructor::construct(j, e); } -template::value or - std::is_same::value, - int> = 0> +template ::value and + not is_compatible_object_type< + BasicJsonType, CompatibleArrayType>::value, + int> = 0> void to_json(BasicJsonType& j, const CompatibleArrayType& arr) { external_constructor::construct(j, arr); diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index 0d2f9f017..4590b694b 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -1769,10 +1769,12 @@ void to_json(BasicJsonType& j, const std::vector& e) external_constructor::construct(j, e); } -template::value or - std::is_same::value, - int> = 0> +template ::value and + not is_compatible_object_type< + BasicJsonType, CompatibleArrayType>::value, + int> = 0> void to_json(BasicJsonType& j, const CompatibleArrayType& arr) { external_constructor::construct(j, arr);