mirror of
https://github.com/Milxnor/Project-Reboot-3.0.git
synced 2026-01-13 10:52:22 +01:00
29 lines
587 B
C++
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;
|
|
};
|
|
}; |