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:
@ -1,6 +1,13 @@
|
||||
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)
|
||||
-------
|
||||
|
||||
|
@ -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