refactor(templates): refactor FAny to a non-template class

This commit is contained in:
2022-12-15 23:38:51 +08:00
parent 6b42dbdc05
commit a8e1852b34
3 changed files with 311 additions and 300 deletions

View File

@ -321,15 +321,6 @@ public:
private:
union
{
uint8 InternalStorage[64 - sizeof(uintptr) - sizeof(uintptr)];
void* ExternalStorage;
};
uintptr RTTI;
uintptr Callable;
struct FMovableRTTI
{
const size_t TypeSize;
@ -390,6 +381,15 @@ private:
Small = 2, // InternalStorage
Big = 3, // ExternalStorage
};
union
{
uint8 InternalStorage[64 - sizeof(uintptr) - sizeof(uintptr)];
void* ExternalStorage;
};
uintptr RTTI;
uintptr Callable;
FORCEINLINE constexpr ERepresentation GetRepresentation() const { return static_cast<ERepresentation>(RTTI & RepresentationMask); }
FORCEINLINE constexpr const FRTTI& GetRTTI() const { return *reinterpret_cast<const FRTTI*>(RTTI & ~RepresentationMask); }