From b4cea6825d477428acc0da7070a02c999ec872b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20DELRIEU?= Date: Sun, 8 Jan 2017 19:06:00 +0100 Subject: [PATCH] remove is_compatible_array_type_impl trait --- src/json.hpp | 59 ++++++++------------------ src/json.hpp.re2c | 59 ++++++++------------------ src/json.hpp.re2c.rej | 98 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 132 insertions(+), 84 deletions(-) create mode 100644 src/json.hpp.re2c.rej diff --git a/src/json.hpp b/src/json.hpp index fd27d83fe..4435102eb 100644 --- a/src/json.hpp +++ b/src/json.hpp @@ -398,40 +398,30 @@ struct is_compatible_object_type typename BasicJson::object_t, CompatibleObjectType>::value; }; -template -struct is_compatible_array_type_impl : std::false_type {}; - -template -struct is_compatible_array_type_impl +template +struct is_basic_json_nested_type { - static constexpr auto value = - not std::is_same::value and - not std::is_same::value and - not std::is_same::value and - not std::is_same::value and - not std::is_same::value and - not std::is_same::value; + static auto constexpr value = std::is_same::value or + std::is_same::value or + std::is_same::value or + std::is_same::value or + std::is_same::value; }; template struct is_compatible_array_type { - // the check for CompatibleArrayType = void is done in - // `is_compatible_object_type`, but we need the conjunction here as well - static auto constexpr value = is_compatible_array_type_impl< - conjunction>, + negation>, negation>, + negation>, has_value_type, - has_iterator>::value, - BasicJson, CompatibleArrayType>::value; + has_iterator>::value; }; template @@ -461,16 +451,6 @@ struct is_compatible_integer_type RealIntegerType, CompatibleNumberIntegerType > ::value; }; -template -struct is_basic_json_nested_type -{ - static auto constexpr value = std::is_same::value or - std::is_same::value or - std::is_same::value or - std::is_same::value or - std::is_same::value; -}; - // This trait checks if JSONSerializer::from_json(json const&, udt&) exists template