Tools.h++ Class Reference

Table Of Contents
main() {
RWTPtrVector<RWDate> week(7);
RWDate begin; // Today's date
for (int i=0; i<7; i++)
week[i] = new RWDate(begin++);
for (i=0; i<7; i++)
{
cout << *week[i] << endl;
delete week[i];
}
return 0;
}
Program output:
March 16, 1996
March 17, 1996
March 18, 1996
March 19, 1996
March 20, 1996
March 21, 1996
March 22, 1996
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 are 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 pointing to the item *ival.
RWTPtrVector<T>(const RWTPtrVector& v);
Constructs self as a shallow copy of v. After construction, pointers held by the two
vectors point to the same items.