Added operator|(JsonVariantConst, JsonVariantConst)

This commit is contained in:
Benoit Blanchon
2020-09-26 14:48:17 +02:00
parent fee029b86e
commit 726f8be341
4 changed files with 61 additions and 4 deletions

View File

@@ -139,4 +139,9 @@ template <typename TString>
inline VariantRef VariantRef::getOrAddMember(const TString &key) const {
return VariantRef(_pool, variantGetOrAddMember(_data, key, _pool));
}
inline VariantConstRef operator|(VariantConstRef preferedValue,
VariantConstRef defaultValue) {
return preferedValue ? preferedValue : defaultValue;
}
} // namespace ARDUINOJSON_NAMESPACE