Minh Nguyen / ArduinoJson
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers VariantTo.hpp Source File

VariantTo.hpp

00001 // ArduinoJson - arduinojson.org
00002 // Copyright Benoit Blanchon 2014-2021
00003 // MIT License
00004 
00005 #pragma once
00006 
00007 #include <ArduinoJson/Namespace.hpp>
00008 
00009 namespace ARDUINOJSON_NAMESPACE {
00010 class ArrayRef;
00011 class ObjectRef;
00012 class VariantRef;
00013 
00014 // A metafunction that returns the type of the value returned by
00015 // VariantRef::to<T>()
00016 template <typename T>
00017 struct VariantTo {};
00018 
00019 template <>
00020 struct VariantTo<ArrayRef> {
00021   typedef ArrayRef type;
00022 };
00023 template <>
00024 struct VariantTo<ObjectRef> {
00025   typedef ObjectRef type;
00026 };
00027 template <>
00028 struct VariantTo<VariantRef> {
00029   typedef VariantRef type;
00030 };
00031 
00032 }  // namespace ARDUINOJSON_NAMESPACE