refactor(typetraits): replaces template class type traits with concepts for TypeTraits/CompositeType.h

This commit is contained in:
2022-05-15 23:10:02 +08:00
parent 1dcd3dc3b3
commit 22fe906eda
10 changed files with 59 additions and 73 deletions

View File

@ -10,7 +10,7 @@ NAMESPACE_REDCRAFT_BEGIN
NAMESPACE_MODULE_BEGIN(Redcraft)
NAMESPACE_MODULE_BEGIN(Utility)
template <typename ReferencedType> requires (TIsObject<ReferencedType>::Value || CFunction<ReferencedType>)
template <typename ReferencedType> requires (CObject<ReferencedType> || CFunction<ReferencedType>)
struct TReferenceWrapper
{
public:
@ -61,7 +61,7 @@ private:
ReferencedType* Pointer;
template <typename T> requires (TIsObject<T>::Value || CFunction<T>) friend struct TReferenceWrapper;
template <typename T> requires (CObject<T> || CFunction<T>) friend struct TReferenceWrapper;
// Optimize TOptional with these hacking
constexpr TReferenceWrapper(FInvalid) : Pointer(nullptr) { };