/* vector.C This is the file vector.cpp from the Weiss text. The only changes made are to change the name from vector.cpp to vector.C and to modify the include file names appropriately. Modified by T. Anastasio on 13 August 1999 20 September 1999 Edit: 11 Feb 2001 DLF for g++, don't include .H file */ template const vector & vector::operator=( const vector & rhs ) { if( this != &rhs ) { delete [ ] objects; currentSize = rhs.size( ); objects = new Object[ currentSize ]; for( int k = 0; k < currentSize; k++ ) objects[ k ] = rhs.objects[ k ]; } return *this; } template void vector::resize( int newSize ) { Object *oldArray = objects; int numToCopy = newSize < currentSize ? newSize : currentSize; objects = new Object[ newSize ]; currentSize = newSize; for( int k = 0; k < numToCopy; k++ ) objects[ k ] = oldArray[ k ]; delete [ ] oldArray; }