From 60ccc62f4934e44ad5b905fdbcf458302b8d8a09 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Fri, 3 Jun 2022 23:26:44 -0700 Subject: Changeset: 63 [WIP] Rename directories --- source/Common/TypeTraits.hpp | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 source/Common/TypeTraits.hpp (limited to 'source/Common/TypeTraits.hpp') diff --git a/source/Common/TypeTraits.hpp b/source/Common/TypeTraits.hpp new file mode 100644 index 0000000..73a56f9 --- /dev/null +++ b/source/Common/TypeTraits.hpp @@ -0,0 +1,27 @@ +#pragma once + +#include + +/// This template will be instanciated for each unique type, and the char variable will be ODR-used which gives it an unique address. +template +struct TypeIdentifier { + static const char obj = 0; +}; + +template +struct DefaultDeleter { + void operator()(T* ptr) const { + delete ptr; + } +}; + +template +struct RemoveMemberPtrImpl {}; + +template +struct RemoveMemberPtrImpl { + using Type = U; +}; + +template +using RemoveMemberPtr = typename RemoveMemberPtrImpl::Type; -- cgit v1.2.3-70-g09d2