From 418fdbab62465124704583d1f6bc0397ba3a1f94 Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 30 Mar 2021 10:14:26 +0200 Subject: [PATCH] :alembic: exclude iterators from KeyType --- include/nlohmann/detail/meta/type_traits.hpp | 8 +++++--- single_include/nlohmann/json.hpp | 8 +++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/nlohmann/detail/meta/type_traits.hpp b/include/nlohmann/detail/meta/type_traits.hpp index dc20cc08b..f25afd2ce 100644 --- a/include/nlohmann/detail/meta/type_traits.hpp +++ b/include/nlohmann/detail/meta/type_traits.hpp @@ -399,11 +399,13 @@ struct is_constructible_tuple> : conjunction struct is_key_type { - static constexpr bool value = + static constexpr bool value = ( #if defined(JSON_HAS_CPP_17) - std::is_same::type, std::string_view>::value || + std::is_same::type, std::string_view>::value || #endif - std::is_convertible::value; + std::is_convertible::value) + && !std::is_same::value + && !std::is_same::value; }; } // namespace detail diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index c7f9e2b46..fd5a62c42 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -3776,11 +3776,13 @@ struct is_constructible_tuple> : conjunction struct is_key_type { - static constexpr bool value = + static constexpr bool value = ( #if defined(JSON_HAS_CPP_17) - std::is_same::type, std::string_view>::value || + std::is_same::type, std::string_view>::value || #endif - std::is_convertible::value; + std::is_convertible::value) + && !std::is_same::value + && !std::is_same::value; }; } // namespace detail