![]() |
• Utility Library | ||||||||||||||||||||
|
API Links
Developer Links
|
class ArrayDefined in:
The C4Array.hArray class represents a dynamically resizable array of objects for which any entry can be accessed in constant time.
Definition
Member Functions
Template Parameters
Constructor
Parameters
Description
The Array class represents a homogeneous array of objects whose type is given by the type template parameter. Upon construction, the initial size of the array is zero, but space is reserved for the number of objects given by the count parameter. The array is stored contiguously in memory, allowing constant-time random access to its elements.As elements are added to the array (using the Array::AddElement function), the storage size is automatically increased to a size somewhat larger than that needed to store the new element. The cost of adding an element is thus amortized linear time.An Array object can be implicitly converted to a pointer to its first element. This allows the use of the [] operator to access individual elements of the array.
|