From 8628427e6d48604b67cf7013219b661212f0e827 Mon Sep 17 00:00:00 2001 From: Martchus Date: Mon, 7 May 2018 23:48:37 +0200 Subject: [PATCH] Fix usage of enable_if with GCC 8 Seems like the trick with the three dots isn't working with GCC 8 anymore. So let's make it a default template parameter then. Not sure whether GCC 8 is here correct and whether this workaround causes further trouble. --- generator/tests/helper.h | 2 +- lib/json/errorhandling.h | 10 +-- lib/json/reflector-boosthana.h | 4 +- lib/json/reflector.h | 114 ++++++++++++++++----------------- lib/json/serializable.h | 4 +- 5 files changed, 67 insertions(+), 67 deletions(-) diff --git a/generator/tests/helper.h b/generator/tests/helper.h index 5ab2daa..2803c75 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>>...> +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 e738e48..8627241 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>>...> + Traits::EnableIf>, Traits::Any, std::is_floating_point>>* = nullptr> constexpr JsonType jsonType() { return JsonType::Number; } -template >...> constexpr JsonType jsonType() +template >* = nullptr> constexpr JsonType jsonType() { return JsonType::Bool; } -template , Traits::IsCString>...> 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>>>...> + 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>>>>...> + Traits::IsSpecializationOf>>>>* = nullptr> constexpr JsonType jsonType() { return JsonType::Object; diff --git a/lib/json/reflector-boosthana.h b/lib/json/reflector-boosthana.h index fcdaed4..2f2bece 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 00e49b3..6c5894b 100644 --- a/lib/json/reflector.h +++ b/lib/json/reflector.h @@ -107,32 +107,32 @@ using IsArray = Traits::All, Traits::Not>...> +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 >...> +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 >...> +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 >...> +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 >...> +template >* = nullptr> void push( const Type &reflectable, const char *name, RAPIDJSON_NAMESPACE::Value::Object &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator); @@ -140,13 +140,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 >...> +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 +157,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>...> +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 +166,7 @@ inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ /*! * \brief Pushes the specified enumeration item to the specified value. */ -template >...> +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 +175,7 @@ inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ /*! * \brief Pushes the specified C-string to the specified value. */ -template >...> +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 +184,7 @@ inline void push(Type reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ /*! * \brief Pushes the specified constant C-string to the specified value. */ -template >...> +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 +193,7 @@ inline void push(const char *const &reflectable, RAPIDJSON_NAMESPACE::Value &val /*! * \brief Pushes the specified std::string to the specified value. */ -template >...> +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 +202,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>...> +template , Traits::HasSize>* = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetArray(); @@ -216,7 +216,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>>...> +template , Traits::Not>>* = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetArray(); @@ -229,7 +229,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 >...> +template >* = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetObject(); @@ -263,7 +263,7 @@ template struct TuplePushHelper { /*! * \brief Pushes the specified tuple to the specified value. */ -template >...> +template >* = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { value.SetArray(); @@ -277,7 +277,7 @@ void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_ */ template , Traits::IsSpecializationOf, - Traits::IsSpecializationOf>...> + Traits::IsSpecializationOf>* = nullptr> void push(const Type &reflectable, RAPIDJSON_NAMESPACE::Value &value, RAPIDJSON_NAMESPACE::Document::AllocatorType &allocator) { if (!reflectable) { @@ -290,7 +290,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 +302,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 +313,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 +326,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 +341,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 >...> +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 >...> +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>>...> +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>...> +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 >...> +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 >...> +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 >...> +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 >...> +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 >...> +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 >...> +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 >...> +template >* = nullptr> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors); /*! @@ -424,14 +424,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>>...> + Traits::EnableIf>, Traits::Any, std::is_floating_point>>* = nullptr> inline void pull( Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) { @@ -447,7 +447,7 @@ inline void pull( /*! * \brief Pulls the boolean from the specified value which is supposed and checked to contain the right type. */ -template >...> +template >* = nullptr> inline void pull( Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) { @@ -464,7 +464,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 >...> +template >* = nullptr> inline void pull( Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) { @@ -481,7 +481,7 @@ inline void pull( /*! * \brief Pulls the std::string from the specified value which is supposed and checked to contain a string. */ -template >...> +template >* = nullptr> inline void pull( Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) { @@ -498,7 +498,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>...> +template , std::is_same>* = nullptr> inline void pull(Type &, const RAPIDJSON_NAMESPACE::GenericValue> &value, JsonDeserializationErrors *errors) { if (!value.IsString()) { @@ -512,7 +512,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 +527,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 +544,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 +571,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 +599,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 +629,7 @@ void pull(Type &reflectable, rapidjson::GenericValue>...> +template >*> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors) { if (!value.IsObject()) { @@ -669,7 +669,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 +692,7 @@ void pull(Type &reflectable, const rapidjson::GenericValue>...> +template >*> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors) { if (value.IsNull()) { @@ -706,7 +706,7 @@ void pull(Type &reflectable, const rapidjson::GenericValue>...> +template >*> void pull(Type &reflectable, const rapidjson::GenericValue> &value, JsonDeserializationErrors *errors) { if (value.IsNull()) { @@ -761,7 +761,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 +778,7 @@ void pull(Type &reflectable, const RAPIDJSON_NAMESPACE::GenericValue, IsMapOrHash>...> +template , IsMapOrHash>* = nullptr> RAPIDJSON_NAMESPACE::StringBuffer toJson(const Type &reflectable) { RAPIDJSON_NAMESPACE::Document document(RAPIDJSON_NAMESPACE::kObjectType); @@ -790,7 +790,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>...> +template , std::is_floating_point>* = nullptr> RAPIDJSON_NAMESPACE::StringBuffer toJson(Type reflectable) { RAPIDJSON_NAMESPACE::Document document(RAPIDJSON_NAMESPACE::kNumberType); @@ -801,7 +801,7 @@ RAPIDJSON_NAMESPACE::StringBuffer toJson(Type reflectable) /*! * \brief Serializes the specified \a reflectable which is an std::string. */ -template >...> +template >* = nullptr> RAPIDJSON_NAMESPACE::StringBuffer toJson(const std::string &reflectable) { RAPIDJSON_NAMESPACE::Document document(RAPIDJSON_NAMESPACE::kStringType); @@ -812,7 +812,7 @@ RAPIDJSON_NAMESPACE::StringBuffer toJson(const std::string &reflectable) /*! * \brief Serializes the specified \a reflectable which is a C-string. */ -template >...> 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 +822,7 @@ template >...> /*! * \brief Serializes the specified \a reflectable which can be mapped to an array. */ -template >...> 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 +834,7 @@ template >...> RAPIDJSON_NAMESPACE /*! * \brief Deserializes the specified JSON to \tparam Type which is a custom type or can be mapped to an object. */ -template , IsMapOrHash>...> +template , IsMapOrHash>* = nullptr> Type fromJson(const char *json, std::size_t jsonSize, JsonDeserializationErrors *errors = nullptr) { RAPIDJSON_NAMESPACE::Document doc(parseJsonDocFromString(json, jsonSize)); @@ -853,7 +853,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>...> +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 +870,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 >...> +template >* = nullptr> Type fromJson(const char *json, std::size_t jsonSize, JsonDeserializationErrors *errors = nullptr) { RAPIDJSON_NAMESPACE::Document doc(parseJsonDocFromString(json, jsonSize)); @@ -887,7 +887,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 >...> +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 24abcf9..e48f85e 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>>...> 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>>...> +template , Type>>* = nullptr> const JsonSerializable &as(const Type &serializable) { return static_cast &>(serializable);