# Juliet\include\Core\Container\Vector

## Source Files
- Header: `Juliet\include\Core\Container\Vector.h`
- Source: `Juliet\src\Core\Container\Vector.cpp`

## AI Description
The `VectorArena` class in the Juliet library is designed to manage a dynamic array of elements within an arena, which is a memory pool that allocates contiguous blocks of memory. This approach helps in reducing fragmentation and improving performance by minimizing the overhead associated with allocating and deallocating individual memory blocks.

**Main Purpose:**
- **Memory Management:** The `VectorArena` class provides a flexible way to manage arrays of elements without worrying about memory allocation and deallocation, which can be time-consuming and resource-intensive.
- **Efficiency:** By using an arena, the `VectorArena` minimizes the overhead associated with each memory allocation and deallocation, resulting in faster execution times.
- **Resource Efficiency:** The use of an arena helps in reducing the number of system calls made during memory management operations, which can lead to improved system performance.

**Design:**
The `VectorArena` class is a template that allows for customization through template parameters such as `Type`, `ReserveSize`, and `AllowRealloc`. It includes methods for creating, destroying, resizing, pushing elements, removing elements, and accessing elements. The class also provides accessors for loop support and index-based access.

**Key Features:**
- **Arena Management:** The `VectorArena` uses an arena to allocate memory blocks, which helps in reducing fragmentation.
- **Dynamic Resizing:** The `Reserve` method allows for dynamic resizing of the array, ensuring that it can handle varying amounts of data efficiently.
- **Fast Removal:** The `RemoveAtFast` method provides a fast way to remove elements from the array without shifting elements, which is particularly useful in scenarios where performance is critical.

**Usage:**
To use the `VectorArena`, you can include the header file and create an instance of the class. For example:
```cpp
#include "Juliet/Core/Container/Vector.h"

int main()
{
    Juliet::Vector?int? vec;
    vec.Create();

    for (int i = 0; i ? 10; ++i)
    {
        vec.PushBack(i);
    }

    // Access elements using index-based access
    int firstElement = vec[0];

    // Remove an element from the array
    vec.RemoveAtFast(2);

    return 0;
}
```

This example demonstrates how to create a `VectorArena`, push elements onto it, and remove an element. The use of the arena ensures that memory management is efficient and resource-friendly.

## Symbols

### Namespace `Juliet`

#### Classes, Structs & Unions
- `struct VectorArena`

### Namespace `Juliet::anonymous`

#### Functions & Methods
- `Arena         = VectorArena::ArenaAllocate(params JULIET_DEBUG_PARAM(Name))`
- `Arena                = arena. VectorArena::Get()`

