mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Added a deprecation warning for as<char*>()
This commit is contained in:
@@ -94,10 +94,17 @@ class VariantRef : public VariantRefBase<VariantData>,
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
FORCE_INLINE T as() const {
|
||||
FORCE_INLINE typename enable_if<!is_same<T, char *>::value, T>::type as()
|
||||
const {
|
||||
return Converter<T>::fromJson(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
FORCE_INLINE typename enable_if<is_same<T, char *>::value, const char *>::type
|
||||
DEPRECATED("Replace as<char*>() with as<const char*>()") as() const {
|
||||
return as<const char *>();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
FORCE_INLINE bool is() const {
|
||||
return Converter<T>::checkJson(*this);
|
||||
@@ -204,10 +211,17 @@ class VariantConstRef : public VariantRefBase<const VariantData>,
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
FORCE_INLINE T as() const {
|
||||
FORCE_INLINE typename enable_if<!is_same<T, char *>::value, T>::type as()
|
||||
const {
|
||||
return Converter<T>::fromJson(*this);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
FORCE_INLINE typename enable_if<is_same<T, char *>::value, const char *>::type
|
||||
DEPRECATED("Replace as<char*>() with as<const char*>()") as() const {
|
||||
return as<const char *>();
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
FORCE_INLINE bool is() const {
|
||||
return Converter<T>::checkJson(*this);
|
||||
|
||||
Reference in New Issue
Block a user