From 0633923935de2f060eb2e585105d430b2c444084 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 7 May 2022 16:50:46 +0200 Subject: [PATCH] Simplify use of type traits in `json/reflector.h` --- lib/json/reflector.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/json/reflector.h b/lib/json/reflector.h index 384ef76..0f34369 100644 --- a/lib/json/reflector.h +++ b/lib/json/reflector.h @@ -82,9 +82,8 @@ inline RAPIDJSON_NAMESPACE::Document parseJsonDocFromString(const char *json, st // define traits to distinguish between "built-in" types like int, std::string, std::vector, ... and custom structs/classes template using IsBuiltInType = Traits::Any, std::is_floating_point, std::is_pointer, std::is_enum, - Traits::IsSpecializationOf, Traits::IsSpecializationOf, Traits::IsIteratable, - Traits::IsSpecializationOf, Traits::IsSpecializationOf, - Traits::IsSpecializationOf, IsVariant>; + Traits::IsSpecializingAnyOf, Traits::IsIteratable, + Traits::IsSpecializingAnyOf, IsVariant>; template using IsCustomType = Traits::Not>; // define trait to check for custom structs/classes which are JSON serializable @@ -310,8 +309,7 @@ void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ * \brief Pushes the specified unique_ptr, shared_ptr or weak_ptr to the specified value. */ template , Traits::IsSpecializationOf, - Traits::IsSpecializationOf> * = nullptr> + Traits::EnableIfAny> * = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { if (!reflectable) {