Files
Project-Reboot-3.0/Project Reboot 3.0/ContainerAllocationPolicies.h
2023-03-05 01:03:51 -05:00

29 lines
587 B
C++

#pragma once
template <int NumElements>
class TInlineAllocator
{
private:
template <int Size, int Alignment>
struct alignas(Alignment) TAlignedBytes
{
unsigned char Pad[Size];
};
template <typename ElementType>
struct TTypeCompatibleBytes : public TAlignedBytes<sizeof(ElementType), alignof(ElementType)>
{
};
public:
template <typename ElementType>
class ForElementType
{
friend class TBitArray;
private:
TTypeCompatibleBytes<ElementType> InlineData[NumElements];
ElementType* SecondaryData;
};
};