Tools.h++ Manual

104011 Tandem Computers Incorporated 22-67
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
RWTPtrVector<T>();
Constructs an empty vector of length zero.
RWTPtrVector<T>(size_t n);
Constructs a vector of length
n
. The initial values of the elements is undefined.
Hence, they can (and probably will) be garbage.
RWTPtrVector<T>(size_t n, T* ival);
Constructs a vector of length
n
, with each element initialized to the value
ival
.
RWTPtrVector<T>(const RWTPtrVector& v);
Constructs self as a shallow copy of
v
. After construction, pointers will be
shared between the two vectors.
Public operators
RWTPtrVector<T>& operator=(const
RWTPtrVector<T>& v);
Sets self to a shallow copy of
v
. Afterwards, the two vectors will have the same
length and pointers will be shared between them.
RWTPtrVector<T>& operator=(T* p);
Sets all elements in self to the value
p
.
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
length of the vector, less one. No bounds checking is performed.