Array::InsertElement
Defined in: C4Array.h
Inserts an object into an array.
Prototype
void InsertElement(int32 index, const type& element);
Parameters
index |
The location at which the object is to be inserted.
|
element |
The new element to insert into the array.
|
Description
The InsertElement function increases the size of an array by one, moves all of the existing elements at location index or greater up by one, and copy-constructs the new element into the array using the object referenced by the element parameter. When the existing elements are moved, they are copy-constructed to their new locations, and the old objects are destroyed.
If the index parameter is greater than or equal to the current size of the array, then the array is enlarged to the size index + 1, and the elements between the old size and new size are default-constructed.
See Also
Array::RemoveElement
Array::AddElement
Array::GetElementCount
Array::SetElementCount
|