aboutsummaryrefslogtreecommitdiff
path: root/source/Common/RTTI.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-06-03 23:30:01 -0700
committerrtk0c <[email protected]>2022-06-03 23:30:01 -0700
commit791b3f354b378769bffe623b05f1305c91b77101 (patch)
tree5409b311e6232eb4a6d3f8259b780d76b8ee1c59 /source/Common/RTTI.hpp
parent60ccc62f4934e44ad5b905fdbcf458302b8d8a09 (diff)
Changeset: 64 [WIP] Rename directoriesmaster-switch-to-build2
Diffstat (limited to 'source/Common/RTTI.hpp')
-rw-r--r--source/Common/RTTI.hpp44
1 files changed, 0 insertions, 44 deletions
diff --git a/source/Common/RTTI.hpp b/source/Common/RTTI.hpp
deleted file mode 100644
index bc0d289..0000000
--- a/source/Common/RTTI.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-#pragma once
-
-#include <cassert>
-
-template <class T, class TBase>
-bool is_a(TBase* t) {
- assert(t != nullptr);
- return T::IsInstance(t);
-}
-
-template <class T, class TBase>
-bool is_a_nullable(TBase* t) {
- if (t) {
- return is_a<T, TBase>(t);
- } else {
- return false;
- }
-}
-
-template <class T, class TBase>
-T* dyn_cast(TBase* t) {
- assert(t != nullptr);
- if (T::IsInstance(t)) {
- return static_cast<T*>(t);
- } else {
- return nullptr;
- }
-}
-
-template <class T, class TBase>
-const T* dyn_cast(const TBase* t) {
- assert(t != nullptr);
- if (T::IsInstance(t)) {
- return static_cast<const T*>(t);
- } else {
- return nullptr;
- }
-}
-
-template <class T, class TBase>
-T* dyn_cast_nullable(TBase* t) {
- if (!t) return nullptr;
- return dyn_cast<T, TBase>(t);
-}