Next: Constructors
Up: ResizeArray
Previous: ResizeArray
A template class which implements a dynamically-growing, automatically
resizing array of data of a given type. Elements in the array may be
accessed via the [] operator. When new data is added to the end of an
array, the size of the array is automatically increased if necessary.
A ResizeArray has two sizes that are important:
- The internal size, which is currently allocated size of the
array. This is almost always larger than the total number of items
stored in the array. A larger-than-necessary buffer is kept so that
data may be easily put at the end of the array without having to always
reallocate and copy the existing array storage.
- The external size, which is the largest index in the array
which has been accessed by the user (either by reading from that index,
or writing a value at that index. This is what the user would consider
the `size' of the array.
Justin Gullingsrud
Tue Apr 6 09:26:48 CDT 1999