This is a simple implementation of vector in C++. Please offer your reviews to improve the code.#ifndef VECTOR_HPP#define VECTOR_HPPtemplate <typename T> class vector{    int size;//size allocated on the memory    int index;//current number of elements    T* arr;    void resize(){        T* temp = new T[size];        for (int i = 0; i <index ; ++i) {            temp[i] = arr[i];        }        delete[] arr;        T* arr = new T[size*2];        for (int i = 0; i < index ; ++i) {           arr[i] = temp[i];        }        size = size*2;        delete[] temp;    }public:    vector(){        size = 50;        index = 0;        T* arr = new T[size];    }    vector(int sz){        size = sz;        index = 0;        T* arr = new T[size];    }    ~vector(){        delete[] arr;    }    typedef T* iterator;    iterator begin(){        return arr;    }    iterator end(){        return arr + index;    }    T* front(){        return arr[0];    }    T* back(){        return arr[index];    }    void push_back(const T& t){        if((size - index) == 1){            resize();        }        arr[index+1] = t;        index++;    }    void pop_back(){        index--;    }    void insert(iterator pos, const T& t){        if((size -index) < 1) resize();        int npos = pos - arr;        for (int i = index; i > npos ; i--) {            arr[i+1] = arr[i];        }        arr[npos] = t;        index++;    }    void erase(iterator pos){        int npos = arr - pos;        if((size - index) < 1) resize();        for (int i = npos; i <index-1 ; ++i) {            arr[i] = arr[i+1];        }        index--;    }    T& operator[](int){    }    int length(){        return index;    }    bool empty(){        return index == 0;    }};#endif //VECTOR_HPP
Implementation of Vector in C++
c++;iterator;vectors