diff --git a/Juliet/include/Core/Container/Vector.h b/Juliet/include/Core/Container/Vector.h index 081d65f..ba529be 100644 --- a/Juliet/include/Core/Container/Vector.h +++ b/Juliet/include/Core/Container/Vector.h @@ -12,6 +12,7 @@ namespace Juliet void Create() { Assert(!Arena); + static_assert(AllowRealloc == false); DataFirst = DataLast = nullptr; Count = 0; @@ -25,7 +26,6 @@ namespace Juliet void Create(NonNullPtr arena) { Assert(!Arena); - static_assert(AllowRealloc == false); DataFirst = DataLast = nullptr; Count = 0; @@ -72,6 +72,12 @@ namespace Juliet { Assert(Arena); + if (Count + 1 == Capacity) + { + Assert(AllowRealloc); + Reserve(Capacity * 2); + } + Type* entry = Data + Count; *entry = value; @@ -87,6 +93,12 @@ namespace Juliet { Assert(Arena); + if (Count + 1 == Capacity) + { + Assert(AllowRealloc); + Reserve(Capacity * 2); + } + Type* entry = Data + Count; *entry = std::move(value);