feat(templates): improve Swap functions and peripheral tools
This commit is contained in:
@ -179,7 +179,7 @@ void TestConcepts()
|
||||
always_check(CSwappable<int32>);
|
||||
always_check(CSwappable<FTestStructG>);
|
||||
always_check(CSwappable<FTestStructN>);
|
||||
// always_check(!CSwappable<FSingleton>);
|
||||
always_check(!CSwappable<FSingleton>);
|
||||
|
||||
always_check((CSwappableWith<int32&, int32&>));
|
||||
|
||||
|
@ -1,6 +1,7 @@
|
||||
#include "Testing/TypeTraitsTesting.h"
|
||||
#include "Misc/AssertionMacros.h"
|
||||
#include "TypeTraits/TypeTraits.h"
|
||||
#include "Templates/Templates.h"
|
||||
|
||||
NAMESPACE_REDCRAFT_BEGIN
|
||||
NAMESPACE_MODULE_BEGIN(Redcraft)
|
||||
@ -435,6 +436,15 @@ void TestTypeTraits()
|
||||
always_check((TIsSame<int64, TCommonReference<int8, int32, int64>::Type>::Value));
|
||||
always_check((TIsSame<double, TCommonReference<float, double>::Type>::Value));
|
||||
|
||||
// Swappable.h
|
||||
|
||||
always_check(TIsSwappable<int32>::Value);
|
||||
always_check(TIsSwappable<FTestStructG>::Value);
|
||||
always_check(TIsSwappable<FTestStructN>::Value);
|
||||
always_check(!TIsSwappable<FSingleton>::Value);
|
||||
|
||||
always_check((TIsSwappableWith<int32&, int32&>::Value));
|
||||
|
||||
}
|
||||
|
||||
NAMESPACE_MODULE_END(Utility)
|
||||
|
Reference in New Issue
Block a user