Reference no: EM132313908
Create a templated vector class and compare it with the std::vector class. Copy this vector.hpp file and try_vector.cpp file.
You need to finish implementing the Big Three, since the vector has dynamic memory.
Copy Constructor:
vector(vector &other){ ... }
Assignment Operator Overload:
void operator=(vector &other){ ... }
To begin, implement the following functions:
T operator[](int); //Only perform address arithmetic
T at(int); //Check to make sure not out of bounds In addition, throw an exception from the at() function in the vector template class you created. This function should throw an out_of_range exception, when the user tries to access an element outside the bounds of the vector. You need to add the statement below to at().
throw std::out_of_range("out of my vector bounds");