diff options
Diffstat (limited to 'include/lib/ArduinoJson/Polyfills/type_traits/enable_if.hpp')
-rw-r--r-- | include/lib/ArduinoJson/Polyfills/type_traits/enable_if.hpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/lib/ArduinoJson/Polyfills/type_traits/enable_if.hpp b/include/lib/ArduinoJson/Polyfills/type_traits/enable_if.hpp new file mode 100644 index 0000000..cc29b33 --- /dev/null +++ b/include/lib/ArduinoJson/Polyfills/type_traits/enable_if.hpp @@ -0,0 +1,19 @@ +// ArduinoJson - https://arduinojson.org +// Copyright Benoit Blanchon 2014-2021 +// MIT License + +#pragma once + +#include <ArduinoJson/Namespace.hpp> + +namespace ARDUINOJSON_NAMESPACE { + +// A meta-function that return the type T if Condition is true. +template <bool Condition, typename T = void> +struct enable_if {}; + +template <typename T> +struct enable_if<true, T> { + typedef T type; +}; +} // namespace ARDUINOJSON_NAMESPACE |