Tools.h++ Class Reference

Table Of Contents
Last
Public Constructors
RWGOrderedVector(val)(size_t capac=RWDEFAULT_CAPACITY);
Construct an ordered vector of elements of val val. The initial capacity of the vector will be
capac whose default value is RWDEFAULT_CAPACITY. The capacity will be
automatically increased as necessary should too many items be inserted, a relatively
expensive process because each item must be copied into the new storage.
Public Member Functions
val
operator()(size_t i) const;
val&
operator()(size_t i);
Return the ith value in the vector. The index i must be between 0 and one less than the
number of items in the vector. No bounds checking is performed. The second variant can be
used as an lvalue, the first cannot.
val
operator[](size_t i) const;
val&
operator[](size_t i);
Return the ith value in the vector. The index i must be between 0 and one less than the
number of items in the vector. Bounds checking will be performed. The second variant can be
used as an lvalue, the first cannot.
void
clear();
Remove all items from the collection.
const val*
data() const;
Returns a pointer to the raw data of self. Should be used with care.
size_t
entries() const;
Return the number of items currently in the collection.
size_t
index(val item) const;
Perform a linear search of the collection returning the index of the first item that isEqual to
the argument item. If no item is found, then it returns RW_NPOS.
void
insert(val item);