mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Fix compatibility with GCC 5.2 (fixes #1897)
This commit is contained in:
		| @@ -12,6 +12,17 @@ | ||||
|  | ||||
| ARDUINOJSON_BEGIN_PRIVATE_NAMESPACE | ||||
|  | ||||
| // A meta-function that returns the first type of the parameter pack | ||||
| // or void if empty | ||||
| template <typename...> | ||||
| struct first_or_void { | ||||
|   using type = void; | ||||
| }; | ||||
| template <typename T, typename... Rest> | ||||
| struct first_or_void<T, Rest...> { | ||||
|   using type = T; | ||||
| }; | ||||
|  | ||||
| template <template <typename, typename> class TDeserializer, typename TReader, | ||||
|           typename TWriter> | ||||
| TDeserializer<TReader, TWriter> makeDeserializer(MemoryPool* pool, | ||||
| @@ -22,7 +33,9 @@ TDeserializer<TReader, TWriter> makeDeserializer(MemoryPool* pool, | ||||
| } | ||||
|  | ||||
| template <template <typename, typename> class TDeserializer, typename TStream, | ||||
|           typename... Args> | ||||
|           typename... Args, | ||||
|           typename = typename enable_if<  // issue #1897 | ||||
|               !is_integral<typename first_or_void<Args...>::type>::value>::type> | ||||
| DeserializationError deserialize(JsonDocument& doc, TStream&& input, | ||||
|                                  Args... args) { | ||||
|   auto reader = makeReader(detail::forward<TStream>(input)); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user