Dynamic array for general types.
Dynamic array for general types. Template class DArray<TYPE> implements an array of elements of type TYPE. Each element is identified by an integer subscript. The valid subscripts range is defined by dynamically adjustable lower- and upper-bounds. Besides accessing and setting elements, member functions are provided to insert or delete elements at specified positions.This template class must be able to access
- a null constructor TYPE::TYPE(),
- a copy constructor TYPE::TYPE(const TYPE &),
- and a copy operator TYPE & operator=(const TYPE &).
The class offers "copy-on-demand" policy, which means that when you copy the array object, array elements will stay intact as long as you don't try to modify them. As soon as you make an attempt to change array contents, the copying is done automatically and transparently for you - the procedure that we call "copy-on-demand". This is the main difference between this class and GArray (now obsolete)
Please note that most of the methods are implemented in the base classes ArrayBase and ArrayBaseT.
DArray(int hibound)
DArray(int lobound, int hibound)
hibound - upper bound of the initial subscript range.
Alphabetic index HTML hierarchy of classes or Java