#pragma once class VectorError {}; class VectorAlocError : public VectorError { int tam; // Tam que nao foi possivel alocar !!! public : VectorAlocError( int t ) { tam = t; } int get() { return tam; }; }; class VectorRangeError : public VectorError { int ind; public : VectorRangeError( int i ) { ind = i; } int get() { return ind; }; }; template class Vector { private: TPELEM *elems; int size; public: Vector(int s) { size=s; if( (elems = new TPELEM[size]) == NULL ) throw VectorAlocError( size ); } TPELEM& operator[]( int i ); }; template TPELEM& Vector::operator[]( int i ) { if( i>=0 && i