diff --git a/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp b/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp index 27ce98a..a5f01e5 100644 --- a/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp +++ b/Redcraft.Utility/Source/Private/Testing/TemplatesTesting.cpp @@ -75,6 +75,9 @@ void TestReferenceWrapper() always_check(ArrayA[0] == 2); always_check(ArrayA[1] == 4); always_check(ArrayA[2] == 6); + + always_check((TIsSame::Type>::Value)); + always_check((TIsSame>::Type>::Value)); } void TestOptional() diff --git a/Redcraft.Utility/Source/Public/Templates/ReferenceWrapper.h b/Redcraft.Utility/Source/Public/Templates/ReferenceWrapper.h index 579acd2..c28dc9e 100644 --- a/Redcraft.Utility/Source/Public/Templates/ReferenceWrapper.h +++ b/Redcraft.Utility/Source/Public/Templates/ReferenceWrapper.h @@ -40,6 +40,11 @@ private: template TReferenceWrapper(T&) -> TReferenceWrapper; +template struct TUnwrapReference { using Type = T; }; +template struct TUnwrapReference> { using Type = T&; }; + +template struct TUnwrapRefDecay { using Type = typename TUnwrapReference::Type>::Type; }; + NAMESPACE_MODULE_END(Utility) NAMESPACE_MODULE_END(Redcraft) NAMESPACE_REDCRAFT_END