From 831711ab7e4402c34ba4f9c6ebe02f3bf42ac035 Mon Sep 17 00:00:00 2001 From: apio Date: Sat, 31 Dec 2022 11:50:30 +0100 Subject: [PATCH] TypeTraits: Remove const, volatile, and reference --- luna/include/luna/TypeTraits.h | 47 +++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/luna/include/luna/TypeTraits.h b/luna/include/luna/TypeTraits.h index b9c6309c..e34e941d 100644 --- a/luna/include/luna/TypeTraits.h +++ b/luna/include/luna/TypeTraits.h @@ -1,4 +1,49 @@ #pragma once template inline constexpr bool IsBaseOf = __is_base_of(Base, Derived); -template inline constexpr bool IsPowerOfTwo = (value & (value - 1)) == 0; \ No newline at end of file +template inline constexpr bool IsPowerOfTwo = (value & (value - 1)) == 0; + +template struct __remove_const_impl +{ + using type = T; +}; + +template struct __remove_const_impl +{ + using type = T; +}; + +template using RemoveConst = __remove_const_impl::type; + +template struct __remove_volatile_impl +{ + using type = T; +}; + +template struct __remove_volatile_impl +{ + using type = T; +}; + +template using RemoveVolatile = __remove_volatile_impl::type; + +template using RemoveCV = RemoveVolatile>; + +template struct __remove_ref_impl +{ + using type = T; +}; + +template struct __remove_ref_impl +{ + using type = T; +}; + +template struct __remove_ref_impl +{ + using type = T; +}; + +template using RemoveReference = __remove_ref_impl::type; + +template using RemoveCVReference = RemoveCV>; \ No newline at end of file