mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Remove explicit exclusion of as<char*>() and as<char>() (#1860)
				
					
				
			If you try to call them, you'll now get the same error message as any unsupported type. You could also add a custom converter for `char*` and `char`.
This commit is contained in:
		| @@ -1,6 +1,13 @@ | |||||||
| ArduinoJson: change log | ArduinoJson: change log | ||||||
| ======================= | ======================= | ||||||
|  |  | ||||||
|  | HEAD | ||||||
|  | ---- | ||||||
|  |  | ||||||
|  | * Remove explicit exclusion of `as<char*>()` and `as<char>()` (issue #1860) | ||||||
|  |   If you try to call them, you'll now get the same error message as any unsupported type. | ||||||
|  |   You could also add a custom converter for `char*` and `char`. | ||||||
|  |  | ||||||
| v6.20.0 (2022-12-26) | v6.20.0 (2022-12-26) | ||||||
| ------- | ------- | ||||||
|  |  | ||||||
|   | |||||||
| @@ -46,10 +46,8 @@ class VariantRefBase : public VariantTag { | |||||||
|   // Casts the value to the specified type. |   // Casts the value to the specified type. | ||||||
|   // https://arduinojson.org/v6/api/jsonvariant/as/ |   // https://arduinojson.org/v6/api/jsonvariant/as/ | ||||||
|   template <typename T> |   template <typename T> | ||||||
|   FORCE_INLINE typename enable_if<!is_same<T, char*>::value && |   FORCE_INLINE | ||||||
|                                       !is_same<T, char>::value && |       typename enable_if<!ConverterNeedsWriteableRef<T>::value, T>::type | ||||||
|                                       !ConverterNeedsWriteableRef<T>::value, |  | ||||||
|                                   T>::type |  | ||||||
|       as() const { |       as() const { | ||||||
|     return Converter<T>::fromJson(getVariantConst()); |     return Converter<T>::fromJson(getVariantConst()); | ||||||
|   } |   } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user