mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Added support for enums in as<T>() and is<T>() (fixes #1256)
This commit is contained in:
@@ -101,6 +101,11 @@ class VariantRefBase {
|
||||
return variantIsNull(_data);
|
||||
}
|
||||
#endif
|
||||
// bool is<enum>() const;
|
||||
template <typename T>
|
||||
FORCE_INLINE typename enable_if<is_enum<T>::value, bool>::type is() const {
|
||||
return variantIsInteger<int>(_data);
|
||||
}
|
||||
|
||||
FORCE_INLINE bool isNull() const {
|
||||
return variantIsNull(_data);
|
||||
|
||||
Reference in New Issue
Block a user