summaryrefslogtreecommitdiff
path: root/Runtime/Utilities/TypeUtilities.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/Utilities/TypeUtilities.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/Utilities/TypeUtilities.h')
-rw-r--r--Runtime/Utilities/TypeUtilities.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/Runtime/Utilities/TypeUtilities.h b/Runtime/Utilities/TypeUtilities.h
new file mode 100644
index 0000000..3455701
--- /dev/null
+++ b/Runtime/Utilities/TypeUtilities.h
@@ -0,0 +1,20 @@
+// Utility functions and types for working with static types.
+#pragma once
+
+template<typename T1, typename T2>
+struct IsSameType
+{
+ static const bool result = false;
+};
+
+template<typename T>
+struct IsSameType<T, T>
+{
+ static const bool result = true;
+};
+
+template<typename Expected, typename Actual>
+inline bool IsOfType (Actual& value)
+{
+ return IsSameType<Actual, Expected>::result;
+}