Tools.h++ Manual

104011 Tandem Computers Incorporated 22-121
22
Program output:
March 16, 1992
March 17, 1992
March 18, 1992
March 19, 1992
March 20, 1992
March 21, 1992
March 22, 1992
Public constructors
RWTValVector<T>();
Constructs an empty vector of length zero.
RWTValVector<T>(size_t n);
Constructs a vector of length
n
. The values of the elements will be set by the
default constructor of class
T
. For a built in type this can (and probably will)
be garbage.
RWTValVector<T>(size_t n, const T& ival);
Constructs a vector of length
n
, with each element initialized to the value
ival
.
RWTValVector<T>(const RWTValVector& v);
Constructs self as a copy of
v
. Each element in v will be copied into self.
~RWTValVector<T>();
Calls the destructor for every element in self.
Public operators
RWTValVector<T>& operator=(const
RWTValVector<T>& v);
Sets self to the same length as
v
and then copies all elements of
v
into self.
RWTValVector<T>& operator=(const T& ival);
Sets all elements in self to the value
ival
.
T operator()(size_t i) const;
T& operator()(size_t i);
Return the
i
'th value in the vector. The index
i
must be between 0 and the
length of the vector less one. No bounds checking is performed.