summaryrefslogtreecommitdiff
path: root/include/lib/ArduinoJson/TypeTraits/IsChar.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/lib/ArduinoJson/TypeTraits/IsChar.hpp')
-rw-r--r--include/lib/ArduinoJson/TypeTraits/IsChar.hpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/include/lib/ArduinoJson/TypeTraits/IsChar.hpp b/include/lib/ArduinoJson/TypeTraits/IsChar.hpp
new file mode 100644
index 0000000..d97cec2
--- /dev/null
+++ b/include/lib/ArduinoJson/TypeTraits/IsChar.hpp
@@ -0,0 +1,23 @@
+// ArduinoJson - arduinojson.org
+// Copyright Benoit Blanchon 2014-2018
+// MIT License
+
+#pragma once
+
+#include "IsSame.hpp"
+
+namespace ArduinoJson {
+namespace Internals {
+
+// A meta-function that returns true if T is a charater
+template <typename T>
+struct IsChar {
+ static const bool value = IsSame<T, char>::value ||
+ IsSame<T, signed char>::value ||
+ IsSame<T, unsigned char>::value;
+};
+
+template <typename T>
+struct IsChar<const T> : IsChar<T> {};
+}
+}