forked from bblanchon/ArduinoJson
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:
@ -46,11 +46,9 @@ class VariantRefBase : public VariantTag {
|
||||
// Casts the value to the specified type.
|
||||
// https://arduinojson.org/v6/api/jsonvariant/as/
|
||||
template <typename T>
|
||||
FORCE_INLINE typename enable_if<!is_same<T, char*>::value &&
|
||||
!is_same<T, char>::value &&
|
||||
!ConverterNeedsWriteableRef<T>::value,
|
||||
T>::type
|
||||
as() const {
|
||||
FORCE_INLINE
|
||||
typename enable_if<!ConverterNeedsWriteableRef<T>::value, T>::type
|
||||
as() const {
|
||||
return Converter<T>::fromJson(getVariantConst());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user