diff --git a/include/nlohmann/detail/meta/type_traits.hpp b/include/nlohmann/detail/meta/type_traits.hpp index 1714a3d6..d993bc17 100644 --- a/include/nlohmann/detail/meta/type_traits.hpp +++ b/include/nlohmann/detail/meta/type_traits.hpp @@ -90,25 +90,23 @@ template struct is_compatible_object_type : is_compatible_object_type_impl {}; -template +template struct is_compatible_string_type_impl : std::false_type {}; -template -struct is_compatible_string_type_impl +template +struct is_compatible_string_type_impl < + BasicJsonType, CompatibleStringType, + enable_if_t::value >> { static constexpr auto value = - std::is_same::value and - std::is_constructible::value; + std::is_constructible::value; }; -template +template struct is_compatible_string_type -{ - static auto constexpr value = is_compatible_string_type_impl < - conjunction>, - is_detected>::value, - typename BasicJsonType::string_t, CompatibleStringType >::value; -}; + : is_compatible_string_type_impl {}; template struct is_basic_json_nested_type diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index cfadee2d..ce08aab8 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -470,25 +470,23 @@ template struct is_compatible_object_type : is_compatible_object_type_impl {}; -template +template struct is_compatible_string_type_impl : std::false_type {}; -template -struct is_compatible_string_type_impl +template +struct is_compatible_string_type_impl < + BasicJsonType, CompatibleStringType, + enable_if_t::value >> { static constexpr auto value = - std::is_same::value and - std::is_constructible::value; + std::is_constructible::value; }; -template +template struct is_compatible_string_type -{ - static auto constexpr value = is_compatible_string_type_impl < - conjunction>, - is_detected>::value, - typename BasicJsonType::string_t, CompatibleStringType >::value; -}; + : is_compatible_string_type_impl {}; template struct is_basic_json_nested_type