Documented Array and Vector containers.

This commit is contained in:
2024-02-01 20:09:58 -08:00
parent 0996f16482
commit 80744abcc3
3 changed files with 15 additions and 4 deletions

View File

@@ -227,6 +227,9 @@ namespace ehs
data[b] = std::move(tmp);
}
/// Inserts a value at the specified index.
/// @param [in] index The index to insert the value at.
/// @param [in] value The value to add.
void Insert(const N index, const T value)
{
N newSize = 0;
@@ -251,6 +254,9 @@ namespace ehs
size = newSize;
}
/// Removes a value at the specified index.
/// @param [in] index The index to remove a value.
/// @returns The value that was removed.
T Remove(const N index)
{
T popped = {};
@@ -383,6 +389,7 @@ namespace ehs
return Pop();
}
/// Releases the resources of the array.
void Clear()
{
if (!data)
@@ -418,6 +425,8 @@ namespace ehs
return size;
}
/// Retrieves the index at the end of the array.
/// @returns The index.
N End() const
{
return size - 1;