From 2c92e07f337e42cf58970443f9de678f85a9b2a4 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Thu, 19 Oct 2023 22:50:07 -0700 Subject: The great renaming: switch to "module style" --- source/10-common/RTTI.hpp | 44 -------------------------------------------- 1 file changed, 44 deletions(-) delete mode 100644 source/10-common/RTTI.hpp (limited to 'source/10-common/RTTI.hpp') diff --git a/source/10-common/RTTI.hpp b/source/10-common/RTTI.hpp deleted file mode 100644 index bd9475b..0000000 --- a/source/10-common/RTTI.hpp +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once - -#include - -template -bool is_a(TBase* t) { - assert(t != nullptr); - return T::IsInstance(t); -} - -template -bool is_a_nullable(TBase* t) { - if (t) { - return is_a(t); - } else { - return false; - } -} - -template -T* dyn_cast(TBase* t) { - assert(t != nullptr); - if (T::IsInstance(t)) { - return static_cast(t); - } else { - return nullptr; - } -} - -template -const T* dyn_cast(const TBase* t) { - assert(t != nullptr); - if (T::IsInstance(t)) { - return static_cast(t); - } else { - return nullptr; - } -} - -template -T* dyn_cast_nullable(TBase* t) { - if (!t) return nullptr; - return dyn_cast(t); -} -- cgit v1.2.3-70-g09d2