summaryrefslogtreecommitdiff
path: root/Runtime/Utilities/TypeUtilities.h
diff options
context:
space:
mode:
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;
+}