Files
thirdparty-ArduinoJson/src/ArduinoJson/Operators/VariantCasts.hpp
2020-01-09 15:48:38 +01:00

25 lines
474 B
C++

// ArduinoJson - arduinojson.org
// Copyright Benoit Blanchon 2014-2020
// MIT License
#pragma once
#include <ArduinoJson/Polyfills/attributes.hpp>
namespace ARDUINOJSON_NAMESPACE {
template <typename TImpl>
class VariantCasts {
public:
template <typename T>
FORCE_INLINE operator T() const {
return impl()->template as<T>();
}
private:
const TImpl *impl() const {
return static_cast<const TImpl *>(this);
}
};
} // namespace ARDUINOJSON_NAMESPACE