mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Simplified the implementation of implicit casts
This commit is contained in:
@@ -39,4 +39,19 @@ inline typename enable_if<IsWriteableString<T>::value, T>::type variantAs(
|
||||
return s;
|
||||
}
|
||||
|
||||
template <>
|
||||
inline ArrayRef variantAs<ArrayRef>(VariantData* data, MemoryPool* pool) {
|
||||
return ArrayRef(pool, data != 0 ? data->asArray() : 0);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline ObjectRef variantAs<ObjectRef>(VariantData* data, MemoryPool* pool) {
|
||||
return ObjectRef(pool, data != 0 ? data->asObject() : 0);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline VariantRef variantAs<VariantRef>(VariantData* data, MemoryPool* pool) {
|
||||
return VariantRef(pool, data);
|
||||
}
|
||||
|
||||
} // namespace ARDUINOJSON_NAMESPACE
|
||||
|
||||
Reference in New Issue
Block a user