diff --git a/generator/tests/helper.h b/generator/tests/helper.h index 2803c75..6c01db9 100644 --- a/generator/tests/helper.h +++ b/generator/tests/helper.h @@ -13,7 +13,7 @@ using TestUtilities::operator<<; /*! * \brief Asserts equality of two iteratables printing the differing indices. */ -template , Traits::Not>>* = nullptr> +template , Traits::Not>> * = nullptr> inline void assertEqualityLinewise(const Iteratable &iteratable1, const Iteratable &iteratable2) { std::vector differentLines; diff --git a/lib/json/errorhandling.h b/lib/json/errorhandling.h index 8627241..7936c30 100644 --- a/lib/json/errorhandling.h +++ b/lib/json/errorhandling.h @@ -44,18 +44,18 @@ enum class JsonType : byte { // define helper functions which return the JsonType for the C++ type specified as template parameter template >, Traits::Any, std::is_floating_point>>* = nullptr> + Traits::EnableIf>, Traits::Any, std::is_floating_point>> * = nullptr> constexpr JsonType jsonType() { return JsonType::Number; } -template >* = nullptr> constexpr JsonType jsonType() +template > * = nullptr> constexpr JsonType jsonType() { return JsonType::Bool; } -template , Traits::IsCString>* = nullptr> constexpr JsonType jsonType() +template , Traits::IsCString> * = nullptr> constexpr JsonType jsonType() { return JsonType::String; } @@ -63,7 +63,7 @@ template , Traits::IsC template , Traits::Not, Traits::IsSpecializationOf, - Traits::IsSpecializationOf>>>* = nullptr> + Traits::IsSpecializationOf>>> * = nullptr> constexpr JsonType jsonType() { return JsonType::Array; @@ -73,7 +73,7 @@ template , std::is_floating_point, Traits::IsString, Traits::IsCString, Traits::All, Traits::Not, Traits::IsSpecializationOf, - Traits::IsSpecializationOf>>>>* = nullptr> + Traits::IsSpecializationOf>>>> * = nullptr> constexpr JsonType jsonType() { return JsonType::Object; diff --git a/lib/json/reflector-boosthana.h b/lib/json/reflector-boosthana.h index 2f2bece..17fe3e1 100644 --- a/lib/json/reflector-boosthana.h +++ b/lib/json/reflector-boosthana.h @@ -26,7 +26,7 @@ namespace JsonReflector { // define function to "push" values to a RapidJSON array or object -template >*> +template > *> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value::Object &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { boost::hana::for_each(boost::hana::keys(reflectable), [&reflectable, &value, &allocator](auto key) { @@ -36,7 +36,7 @@ void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value::Object &value, RA // define function to "pull" values from a RapidJSON array or object -template >*> +template > *> void pull(Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue>::ConstObject &value, JsonDeserializationErrors *errors) { diff --git a/lib/json/reflector.h b/lib/json/reflector.h index 6c5894b..521a492 100644 --- a/lib/json/reflector.h +++ b/lib/json/reflector.h @@ -7,8 +7,9 @@ * std::vector, ... with RapidJSON. */ +#include "../traits.h" + #include -#include #include #include @@ -16,13 +17,9 @@ #include #include -#include #include -#include #include #include -#include -#include #include "./errorhandling.h" @@ -89,50 +86,37 @@ template using IsJsonSerializable = Traits::Any>, std::is_base_of, Type>, AdaptedJsonSerializable>; -// define trait to check for map or hash -template -using IsMapOrHash = Traits::Any, Traits::IsSpecializationOf>; -template using IsSet = Traits::Any, Traits::IsSpecializationOf>; -template -using IsMultiSet = Traits::Any, Traits::IsSpecializationOf>; -template -using IsArrayOrSet - = Traits::All, Traits::Not>, Traits::Not>>; -template -using IsArray = Traits::All, Traits::Not>, - Traits::Not>, Traits::Not>, Traits::Not>>; - // define functions to "push" values to a RapidJSON array or object /*! * \brief Pushes the specified \a reflectable to the specified value. */ -template >* = nullptr> +template > * = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator); /*! * \brief Pushes the \a reflectable to the specified array. */ -template >* = nullptr> +template > * = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value::Array &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator); /*! * \brief Pushes the \a reflectable which has a custom type to the specified array. */ -template >* = nullptr> +template > * = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value::Array &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator); /*! * \brief Pushes the specified \a reflectable which has custom type as a member to the specified object. */ -template >* = nullptr> +template > * = nullptr> void push( const Type &reflectable, const char *name, RAPIDJSON_NAMESPACE::Value::Object &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator); /*! * \brief Pushes the specified \a reflectable as a member to the specified object. */ -template >* = nullptr> +template > * = nullptr> void push( const Type &reflectable, const char *name, RAPIDJSON_NAMESPACE::Value::Object &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator); @@ -140,13 +124,13 @@ void push( * \brief Pushes the \a reflectable which has a custom type to the specified object. * \remarks The definition of this function must be provided by the code generator or Boost.Hana. */ -template >* = nullptr> +template > * = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value::Object &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator); /*! * \brief Pushes the specified \a reflectable which has a custom type to the specified value. */ -template >*> +template > *> inline void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetObject(); @@ -157,7 +141,7 @@ inline void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAP /*! * \brief Pushes the specified integer/float/boolean to the specified value. */ -template , std::is_floating_point>* = nullptr> +template , std::is_floating_point> * = nullptr> inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.Set(reflectable, allocator); @@ -166,7 +150,7 @@ inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ /*! * \brief Pushes the specified enumeration item to the specified value. */ -template >* = nullptr> +template > * = nullptr> inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.Set(static_cast::type>, uint64, int64>>(reflectable), allocator); @@ -175,7 +159,7 @@ inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ /*! * \brief Pushes the specified C-string to the specified value. */ -template >* = nullptr> +template > * = nullptr> inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetString(RAPIDJSON_NAMESPACE::StringRef(reflectable), allocator); @@ -184,7 +168,7 @@ inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ /*! * \brief Pushes the specified constant C-string to the specified value. */ -template >* = nullptr> +template > * = nullptr> inline void push(const char *const &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetString(RAPIDJSON_NAMESPACE::StringRef(reflectable), allocator); @@ -193,7 +177,7 @@ inline void push(const char *const &reflectable, RAPIDJSON_NAMESPACE::Value &val /*! * \brief Pushes the specified std::string to the specified value. */ -template >* = nullptr> +template > * = nullptr> inline void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetString(RAPIDJSON_NAMESPACE::StringRef(reflectable.data(), reflectable.size()), allocator); @@ -202,7 +186,7 @@ inline void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAP /*! * \brief Pushes the specified iteratable (eg. std::vector, std::list) to the specified value. */ -template , Traits::HasSize>* = nullptr> +template , Traits::HasSize> * = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetArray(); @@ -216,7 +200,7 @@ void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ /*! * \brief Pushes the specified iteratable list (eg. std::vector, std::list) to the specified value. */ -template , Traits::Not>>* = nullptr> +template , Traits::Not>> * = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetArray(); @@ -229,7 +213,7 @@ void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ /*! * \brief Pushes the specified map (std::map, std::unordered_map) to the specified value. */ -template >* = nullptr> +template > * = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetObject(); @@ -263,7 +247,7 @@ template struct TuplePushHelper { /*! * \brief Pushes the specified tuple to the specified value. */ -template >* = nullptr> +template > * = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetArray(); @@ -277,7 +261,7 @@ void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ */ template , Traits::IsSpecializationOf, - Traits::IsSpecializationOf>* = nullptr> + Traits::IsSpecializationOf> * = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { if (!reflectable) { @@ -290,7 +274,7 @@ void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ /*! * \brief Pushes the specified \a reflectable which has a custom type to the specified array. */ -template >*> +template > *> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value::Array &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { RAPIDJSON_NAMESPACE::Value objectValue(RAPIDJSON_NAMESPACE::kObjectType); @@ -302,7 +286,7 @@ void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value::Array &value, RAP /*! * \brief Pushes the specified \a reflectable to the specified array. */ -template >*> +template > *> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value::Array &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { RAPIDJSON_NAMESPACE::Value genericValue; @@ -313,7 +297,7 @@ void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value::Array &value, RAP /*! * \brief Pushes the specified \a reflectable which has custom type as a member to the specified object. */ -template >*> +template > *> void push( const Type &reflectable, const char *name, RAPIDJSON_NAMESPACE::Value::Object &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { @@ -326,7 +310,7 @@ void push( /*! * \brief Pushes the specified \a reflectable as a member to the specified object. */ -template >*> +template > *> void push( const Type &reflectable, const char *name, RAPIDJSON_NAMESPACE::Value::Object &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { @@ -341,68 +325,68 @@ void push( * \brief Pulls the \a reflectable which has a custom type from the specified object. * \remarks The definition of this function must be provided by the code generator or Boost.Hana. */ -template >* = nullptr> +template > * = nullptr> void pull(Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue>::ConstObject &value, JsonDeserializationErrors *errors); /*! * \brief Pulls the \a reflectable which has a custom type from the specified value which is supposed and checked to contain an object. */ -template >* = nullptr> +template > * = nullptr> void pull(Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors); /*! * \brief Pulls the specified \a reflectable which is an iteratable without reserve() method from the specified value which is checked to contain an array. */ -template , Traits::Not>>* = nullptr> +template , Traits::Not>> * = nullptr> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors); /*! * \brief Pulls the specified \a reflectable which is an iteratable with reserve() method from the specified value which is checked to contain an array. */ -template , Traits::IsReservable>* = nullptr> +template , Traits::IsReservable> * = nullptr> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors); /*! * \brief Pulls the specified \a reflectable which is an array/vector/list from the specified array. The \a reflectable is cleared before. */ -template >* = nullptr> +template > * = nullptr> void pull(Type &reflectable, rapidjson::GenericValue>::ConstArray array, JsonDeserializationErrors *errors); /*! * \brief Pulls the specified \a reflectable which is a set from the specified array. The \a reflectable is cleared before. */ -template >* = nullptr> +template > * = nullptr> void pull(Type &reflectable, rapidjson::GenericValue>::ConstArray array, JsonDeserializationErrors *errors); /*! * \brief Pulls the specified \a reflectable which is a multiset from the specified array. The \a reflectable is cleared before. */ -template >* = nullptr> +template > * = nullptr> void pull(Type &reflectable, rapidjson::GenericValue>::ConstArray array, JsonDeserializationErrors *errors); /*! * \brief Pulls the specified \a reflectable which is a map from the specified value which is checked to contain an object. */ -template >* = nullptr> +template > * = nullptr> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors); /*! * \brief Pulls the specified \a reflectable which is a tuple from the specified value which is checked to contain an array. */ -template >* = nullptr> +template > * = nullptr> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors); /*! * \brief Pulls the specified \a reflectable which is a unique_ptr from the specified value which might be null. */ -template >* = nullptr> +template > * = nullptr> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors); /*! * \brief Pulls the specified \a reflectable which is a shared_ptr from the specified value which might be null. */ -template >* = nullptr> +template > * = nullptr> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors); /*! @@ -424,14 +408,14 @@ inline void pull(Type &reflectable, const char *name, const rapidjson::GenericVa /*! * \brief Pulls the \a reflectable which has a custom type from the specified value which is supposed and checked to contain an object. */ -template >*> +template > *> void pull(Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors); /*! * \brief Pulls the integer or float from the specified value which is supposed and checked to contain the right type. */ template >, Traits::Any, std::is_floating_point>>* = nullptr> + Traits::EnableIf>, Traits::Any, std::is_floating_point>> * = nullptr> inline void pull( Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) { @@ -447,7 +431,7 @@ inline void pull( /*! * \brief Pulls the boolean from the specified value which is supposed and checked to contain the right type. */ -template >* = nullptr> +template > * = nullptr> inline void pull( Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) { @@ -464,7 +448,7 @@ inline void pull( * \brief Pulls the specified enumeration item from the specified value which is supposed and checked to be compatible with the underlying type. * \remarks It is *not* checked, whether \a value is actually a valid enum item. */ -template >* = nullptr> +template > * = nullptr> inline void pull( Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) { @@ -481,7 +465,7 @@ inline void pull( /*! * \brief Pulls the std::string from the specified value which is supposed and checked to contain a string. */ -template >* = nullptr> +template > * = nullptr> inline void pull( Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) { @@ -498,7 +482,7 @@ inline void pull( * \brief Checks whether the specified value contains a string. * \remarks Does not actually store the value since the ownership would not be clear (see README.md). */ -template , std::is_same>* = nullptr> +template , std::is_same> * = nullptr> inline void pull(Type &, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) { if (!value.IsString()) { @@ -512,7 +496,7 @@ inline void pull(Type &, const RAPIDJSON_NAMESPACE::GenericValue, Traits::Not>>*> +template , Traits::Not>> *> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors) { if (!value.IsArray()) { @@ -527,7 +511,7 @@ void pull(Type &reflectable, const rapidjson::GenericValue, Traits::IsReservable>*> +template , Traits::IsReservable> *> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors) { if (!value.IsArray()) { @@ -544,7 +528,7 @@ void pull(Type &reflectable, const rapidjson::GenericValue>*> +template > *> void pull(Type &reflectable, rapidjson::GenericValue>::ConstArray array, JsonDeserializationErrors *errors) { // clear previous contents of the array @@ -571,7 +555,7 @@ void pull(Type &reflectable, rapidjson::GenericValue>*> +template > *> void pull(Type &reflectable, rapidjson::GenericValue>::ConstArray array, JsonDeserializationErrors *errors) { // clear previous contents of the array @@ -599,7 +583,7 @@ void pull(Type &reflectable, rapidjson::GenericValue>*> +template > *> void pull(Type &reflectable, rapidjson::GenericValue>::ConstArray array, JsonDeserializationErrors *errors) { // clear previous contents of the array @@ -629,7 +613,7 @@ void pull(Type &reflectable, rapidjson::GenericValue>*> +template > *> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors) { if (!value.IsObject()) { @@ -669,7 +653,7 @@ template struct TuplePullHelper { /*! * \brief Pulls the specified \a reflectable which is a tuple from the specified value which is checked to contain an array. */ -template >*> +template > *> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors) { if (!value.IsArray()) { @@ -692,7 +676,7 @@ void pull(Type &reflectable, const rapidjson::GenericValue>*> +template > *> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors) { if (value.IsNull()) { @@ -706,7 +690,7 @@ void pull(Type &reflectable, const rapidjson::GenericValue>*> +template > *> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors) { if (value.IsNull()) { @@ -761,7 +745,7 @@ inline void pull(Type &reflectable, const char *name, const rapidjson::GenericVa /*! * \brief Pulls the \a reflectable which has a custom type from the specified value which is supposed and checked to contain an object. */ -template >*> +template > *> void pull(Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) { if (!value.IsObject()) { @@ -778,7 +762,7 @@ void pull(Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue, IsMapOrHash>* = nullptr> +template , IsMapOrHash> * = nullptr> RAPIDJSON_NAMESPACE::StringBuffer toJson(const Type &reflectable) { RAPIDJSON_NAMESPACE::Document document(RAPIDJSON_NAMESPACE::kObjectType); @@ -790,7 +774,7 @@ RAPIDJSON_NAMESPACE::StringBuffer toJson(const Type &reflectable) /*! * \brief Serializes the specified \a reflectable which is an integer, float or boolean. */ -template , std::is_floating_point>* = nullptr> +template , std::is_floating_point> * = nullptr> RAPIDJSON_NAMESPACE::StringBuffer toJson(Type reflectable) { RAPIDJSON_NAMESPACE::Document document(RAPIDJSON_NAMESPACE::kNumberType); @@ -801,7 +785,7 @@ RAPIDJSON_NAMESPACE::StringBuffer toJson(Type reflectable) /*! * \brief Serializes the specified \a reflectable which is an std::string. */ -template >* = nullptr> +template > * = nullptr> RAPIDJSON_NAMESPACE::StringBuffer toJson(const std::string &reflectable) { RAPIDJSON_NAMESPACE::Document document(RAPIDJSON_NAMESPACE::kStringType); @@ -812,7 +796,8 @@ RAPIDJSON_NAMESPACE::StringBuffer toJson(const std::string &reflectable) /*! * \brief Serializes the specified \a reflectable which is a C-string. */ -template >* = nullptr> RAPIDJSON_NAMESPACE::StringBuffer toJson(const char *reflectable) +template > * = nullptr> +RAPIDJSON_NAMESPACE::StringBuffer toJson(const char *reflectable) { RAPIDJSON_NAMESPACE::Document document(RAPIDJSON_NAMESPACE::kStringType); document.SetString(RAPIDJSON_NAMESPACE::StringRef(reflectable), document.GetAllocator()); @@ -822,7 +807,7 @@ template >* = n /*! * \brief Serializes the specified \a reflectable which can be mapped to an array. */ -template >* = nullptr> RAPIDJSON_NAMESPACE::StringBuffer toJson(const Type &reflectable) +template > * = nullptr> RAPIDJSON_NAMESPACE::StringBuffer toJson(const Type &reflectable) { RAPIDJSON_NAMESPACE::Document document(RAPIDJSON_NAMESPACE::kArrayType); push(reflectable, document, document.GetAllocator()); @@ -834,7 +819,7 @@ template >* = nullptr> RAPIDJSON_N /*! * \brief Deserializes the specified JSON to \tparam Type which is a custom type or can be mapped to an object. */ -template , IsMapOrHash>* = nullptr> +template , IsMapOrHash> * = nullptr> Type fromJson(const char *json, std::size_t jsonSize, JsonDeserializationErrors *errors = nullptr) { RAPIDJSON_NAMESPACE::Document doc(parseJsonDocFromString(json, jsonSize)); @@ -853,7 +838,7 @@ Type fromJson(const char *json, std::size_t jsonSize, JsonDeserializationErrors /*! * \brief Deserializes the specified JSON to \tparam Type which is an integer, float or boolean. */ -template , std::is_floating_point>* = nullptr> +template , std::is_floating_point> * = nullptr> Type fromJson(const char *json, std::size_t jsonSize, JsonDeserializationErrors *errors = nullptr) { RAPIDJSON_NAMESPACE::Document doc(parseJsonDocFromString(json, jsonSize)); @@ -870,7 +855,7 @@ Type fromJson(const char *json, std::size_t jsonSize, JsonDeserializationErrors /*! * \brief Deserializes the specified JSON to \tparam Type which is a std::string. */ -template >* = nullptr> +template > * = nullptr> Type fromJson(const char *json, std::size_t jsonSize, JsonDeserializationErrors *errors = nullptr) { RAPIDJSON_NAMESPACE::Document doc(parseJsonDocFromString(json, jsonSize)); @@ -887,7 +872,7 @@ Type fromJson(const char *json, std::size_t jsonSize, JsonDeserializationErrors /*! * \brief Deserializes the specified JSON to \tparam Type which can be mapped to an array. */ -template >* = nullptr> +template > * = nullptr> Type fromJson(const char *json, std::size_t jsonSize, JsonDeserializationErrors *errors = nullptr) { RAPIDJSON_NAMESPACE::Document doc(parseJsonDocFromString(json, jsonSize)); diff --git a/lib/json/serializable.h b/lib/json/serializable.h index e48f85e..87fd2e3 100644 --- a/lib/json/serializable.h +++ b/lib/json/serializable.h @@ -84,7 +84,7 @@ template Type JsonSerializable::fromJson(const std::string /*! * \brief Helps to disambiguate when inheritance is used. */ -template , Type>>* = nullptr> JsonSerializable &as(Type &serializable) +template , Type>> * = nullptr> JsonSerializable &as(Type &serializable) { return static_cast &>(serializable); } @@ -92,7 +92,7 @@ template /*! * \brief Helps to disambiguate when inheritance is used. */ -template , Type>>* = nullptr> +template , Type>> * = nullptr> const JsonSerializable &as(const Type &serializable) { return static_cast &>(serializable);