template class Vec{ public: // default constructor Vec(){ m_data = new T[2]; m_size = 0; capacity = 2; } // other constructor Vec(int size, const T& val){ m_data = new T[size]; m_size = size; capacity = size; for(int i=0;i& operator=(const Vec& other){ if(this != &other){ capacity = other.capacity; m_size = other.m_size; m_data = new T[m_size]; for(unsigned int i=0;i= capacity){ capacity = capacity * 2; // allocate memory for the new array and move content of m_data to the new array. T* temp = new T[capacity]; for(unsigned int i=0;i