Tools.h++ Class Reference

Table Of Contents
The class T must have:
well-defined copy semantics (T::T(const T&) or equivalent);
well-defined assignment semantics (T::operator=(const T&) or equivalent);
well-defined equality semantics (T::operator==(const T&));
a default constructor.
Note that an ordered vector has a length (the number of items returned by length() or entries()) and a
capacity. Necessarily, the capacity is always greater than or equal to the length. Although elements
beyond the collection's length are not used, nevertheless, in a value-based collection, they are occupied.
If each instance of class T requires considerable resources, then you should ensure that the collection's
capacity is not much greater than its length, otherwise unnecessary resources will be tied up.
Persistence
Isomorphic
Example
#include <rw/tvordvec.h>
#include <rw/rstream.h>
main() {
RWTValOrderedVector<double> vec;
vec.insert(22.0);
vec.insert(5.3);
vec.insert(-102.5);
vec.insert(15.0);
vec.insert(5.3);
cout << vec.entries() << " entries\n" << endl; // Prints "5"
for (int i=0; i<vec.length(); i++)
cout << vec[i] << endl;
return 0;
}
Program output:
5 entries
22
5.3
-102.5
15
5.3