mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Simpify variant reader
This commit is contained in:
		| @@ -9,20 +9,11 @@ | |||||||
|  |  | ||||||
| namespace ARDUINOJSON_NAMESPACE { | namespace ARDUINOJSON_NAMESPACE { | ||||||
|  |  | ||||||
| template <typename TSource> | template <typename TVariant> | ||||||
| struct Reader<VariantProxy<TSource>, void> : Reader<char*, void> { | struct Reader<TVariant, typename enable_if<IsVariant<TVariant>::value>::type> | ||||||
|   explicit Reader(const VariantProxy<TSource>& x) |     : Reader<char*, void> { | ||||||
|  |   explicit Reader(const TVariant& x) | ||||||
|       : Reader<char*, void>(x.template as<const char*>()) {} |       : Reader<char*, void>(x.template as<const char*>()) {} | ||||||
| }; | }; | ||||||
|  |  | ||||||
| template <> |  | ||||||
| struct Reader<VariantRef, void> : Reader<char*, void> { |  | ||||||
|   explicit Reader(VariantRef x) : Reader<char*, void>(x.as<const char*>()) {} |  | ||||||
| }; |  | ||||||
|  |  | ||||||
| template <> |  | ||||||
| struct Reader<VariantConstRef, void> : Reader<char*, void> { |  | ||||||
|   explicit Reader(VariantConstRef x) |  | ||||||
|       : Reader<char*, void>(x.as<const char*>()) {} |  | ||||||
| }; |  | ||||||
| }  // namespace ARDUINOJSON_NAMESPACE | }  // namespace ARDUINOJSON_NAMESPACE | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user