Minh Nguyen / ArduinoJson
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers enable_if.hpp Source File

enable_if.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 
00011 // A meta-function that return the type T if Condition is true.
00012 template <bool Condition, typename T = void>
00013 struct enable_if {};
00014 
00015 template <typename T>
00016 struct enable_if<true, T> {
00017   typedef T type;
00018 };
00019 }  // namespace ARDUINOJSON_NAMESPACE