mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-02 00:38:26 +01:00
25 lines
474 B
C++
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
|