array<T>
The built-in dynamic-size array type.
Instance Methods
-
uint Size() const
-
Returns the number of elements in the array.
-
void Copy(array<T> other)
-
Copies all of the elements of
otherinto this array, doing nothing to the original array.
-
void Move(array<T> other)
-
Moves all of the elements of
otherinto this array, emptying the original array completely.
-
void Append(array<T> other)
-
Appends the elements of
otherto this array, copying them.
-
uint Find(T item) const
-
Returns the index of the first element matching
item, orSizeif no matches are found.
-
uint Push(T item)
-
Inserts an element at the end of the array.
-
bool Pop()
-
Removes the last element in the array. Returns
falseif nothing was removed.
-
void Delete(uint index, int deleteCount = 1)
-
Deletes
deleteCountelements atindex, moving elements back if necessary.
-
void Insert(uint index, T item)
-
Inserts an element at
index. Ifindexis beyond the bounds of the array, it will initialize the leading elements to their null value.
-
void ShrinkToFit()
-
Shrinks the internal array to the
Sizeof the array.
-
void Grow(uint amount)
-
Grows the internal array's capacity so that it can fit at least
amountmore elements.
-
void Resize(uint amount)
-
Resizes the internal array to
amount, potentially removing elements.
-
uint Reserve(uint amount)
-
Grows the internal array's capacity by exactly
amountmore elements.
-
uint Max() const
-
Returns the size of the internal array.
-
void Clear()
-
Removes all elements in the array.
Overview of instance methods
Append, Clear, Copy, Delete, Find, Grow, Insert, Max, Move, Pop, Push, Reserve, Resize, ShrinkToFit, Size