Added JsonVariant::is<JsonVariant/JsonVariantConst>() (issue #1412)

This commit is contained in:
Benoit Blanchon
2021-02-23 08:41:24 +01:00
parent 05498aa178
commit 744d61f6fd
3 changed files with 21 additions and 1 deletions

View File

@ -121,6 +121,16 @@ class VariantRefBase : public VariantTag {
is() const {
return !!_data;
}
//
// bool is<VariantConstRef> const;
// bool is<const VariantConstRef> const;
template <typename T>
FORCE_INLINE typename enable_if<
is_same<typename remove_const<T>::type, VariantConstRef>::value,
bool>::type
is() const {
return !!_data;
}
#if ARDUINOJSON_HAS_NULLPTR
//
// bool is<nullptr_t> const;