diff --git a/Redcraft.Utility/Source/Private/Testing/TypeTraitsTesting.cpp b/Redcraft.Utility/Source/Private/Testing/TypeTraitsTesting.cpp index 842d6eb..7a8a059 100644 --- a/Redcraft.Utility/Source/Private/Testing/TypeTraitsTesting.cpp +++ b/Redcraft.Utility/Source/Private/Testing/TypeTraitsTesting.cpp @@ -2,6 +2,7 @@ #include "Misc/AssertionMacros.h" #include "TypeTraits/HelperClasses.h" #include "TypeTraits/PrimaryType.h" +#include "TypeTraits/CompositeType.h" NAMESPACE_REDCRAFT_BEGIN NAMESPACE_MODULE_BEGIN(Redcraft) @@ -106,6 +107,46 @@ void TestTypeTraits() always_check(!TypeTraits::TIsEnumClass::Value); always_check(TypeTraits::TIsEnumClass::Value); + + // CompositeType.h + + always_check(!TypeTraits::TIsFundamental::Value); + always_check(TypeTraits::TIsFundamental::Value); + always_check(TypeTraits::TIsFundamental::Value); + always_check(!TypeTraits::TIsFundamental::Value); + always_check(TypeTraits::TIsFundamental::Value); + + always_check(!TypeTraits::TIsArithmetic::Value); + always_check(TypeTraits::TIsArithmetic::Value); + always_check(TypeTraits::TIsArithmetic::Value); + always_check(!TypeTraits::TIsArithmetic::Value); + always_check(!TypeTraits::TIsArithmetic::Value); + + always_check(!TypeTraits::TIsScalar::Value); + always_check(TypeTraits::TIsScalar::Value); + always_check(TypeTraits::TIsScalar::Value); + always_check(TypeTraits::TIsScalar::Value); + always_check(!TypeTraits::TIsScalar::Value); + + always_check(TypeTraits::TIsObject::Value); + always_check(!TypeTraits::TIsObject::Value); + always_check(TypeTraits::TIsObject::Value); + always_check(TypeTraits::TIsObject::Value); + always_check(!TypeTraits::TIsObject::Value); + + always_check(TypeTraits::TIsCompound::Value); + always_check(TypeTraits::TIsCompound::Value); + always_check(!TypeTraits::TIsCompound::Value); + always_check(TypeTraits::TIsCompound::Value); + always_check(TypeTraits::TIsCompound::Value); + + always_check(!TypeTraits::TIsReference::Value); + always_check(!TypeTraits::TIsReference::Value); + always_check(TypeTraits::TIsReference::Value); + always_check(TypeTraits::TIsReference::Value); + + always_check(!TypeTraits::TIsMemberPointer::Value); + always_check(TypeTraits::TIsMemberPointer::Value); } NAMESPACE_MODULE_END(Utility) diff --git a/Redcraft.Utility/Source/Public/TypeTraits/CompositeType.h b/Redcraft.Utility/Source/Public/TypeTraits/CompositeType.h new file mode 100644 index 0000000..cf02b3d --- /dev/null +++ b/Redcraft.Utility/Source/Public/TypeTraits/CompositeType.h @@ -0,0 +1,24 @@ +#pragma once + +#include "CoreTypes.h" +#include "TypeTraits/HelperClasses.h" + +#include + +NAMESPACE_REDCRAFT_BEGIN +NAMESPACE_MODULE_BEGIN(Redcraft) +NAMESPACE_MODULE_BEGIN(Utility) +NAMESPACE_BEGIN(TypeTraits) + +template struct TIsReference : TBoolConstant> { }; +template struct TIsArithmetic : TBoolConstant> { }; +template struct TIsFundamental : TBoolConstant> { }; +template struct TIsObject : TBoolConstant> { }; +template struct TIsScalar : TBoolConstant> { }; +template struct TIsCompound : TBoolConstant> { }; +template struct TIsMemberPointer : TBoolConstant> { }; + +NAMESPACE_END(TypeTraits) +NAMESPACE_MODULE_END(Utility) +NAMESPACE_MODULE_END(Redcraft) +NAMESPACE_REDCRAFT_END