Tools.h++ Manual
22-48 104011 Tandem Computers Incorporated
22
Program output:
5 entries
22
5.3
-102.5
15
5.3
Public constructors
RWTPtrOrderedVector<T>(size_t capac=RWDEFAULT_CAPACITY);
Creates an empty ordered vector with capacity
capac
. Should the number of
items exceed this value, the vector will be resized automatically.
RWTPtrOrderedVector<T>(const RWTPtrOrderedVector<T>& c);
Constructs a new ordered vector as a shallow copy of
c
. After construction,
pointers will be shared between the two collections.
Public operators
RWTPtrOrderedVector<T>& operator=(const
RWTPtrOrderedVector& c);
Sets self to a shallow copy of
c
. Afterwards, pointers will be shared between
the two collections.
T*& operator()(size_t i);
T* operator()(size_t i) const;
Returns a pointer to the
i
'th value in the vector. The first variant can be used
as an l-value, the second cannot. The index
i
must be between zero and the
number of items in the collection less one. No bounds checking is performed.
T*& operator[](size_t i);
T* operator[](size_t i) const;
Returns a pointer to the
i
'th value in the vector. The first variant can be used
as an l-value, the second cannot. The index
i
must be between zero and the
number of items in the collection less one, or an exception of type
TOOL_INDEX
will be thrown.
Public member functions
void append(T* a);
Appends the item pointed to by
a
to the end of the vector. The collection will
automatically be resized if this causes the number of items in the collection to
exceed the capacity.