#include template class Vector { private: Type* array; int length; public: const int limit; Vector(int len); Vector(const Vector& v); ~Vector(); bool add(const Type& t); bool get(int index, Type& t); int size() const; }; template Vector::Vector(int len): limit (len) { length = 0; array = new Type[len]; } template Vector::Vector(const Vector& v) { delete [] array; array = new Type[v.limit]; for (int x = 0; x < v.limit; x++) array[x] = v.array[x]; } template Vector::~Vector() { delete [] array; } template bool Vector::add(const Type& t) { if (length >= limit) return false; ++length; array[length - 1] = t; return true; } template bool Vector::get(int index, Type& t) { if (length != 0 || limit >= index|| 0 > index) return false; t = array[index]; return true; } template int Vector::size() const { return length; }