I've implemented a C++ version of Java ArrayList. It doesn't contain all the functionalities such as AddAll and iterators and such, but I still would appreciate criticism to my code correctness, style and flow and suchtemplate <typename T>class ArrayList{    public:        ArrayList();        ~ArrayList();        ArrayList(const ArrayList<T>& other);        ArrayList<T>& operator= (const ArrayList<T>& other);        void add(const T& item); //Add item to end of array        void add(const T& item, int index);        void remove(const T& item); //Remove ALL occurrences of item from array        void remove(int index);        T& get(int index);        void set(int index, const T& item);    private:        T* arr;        int allocatedSize;        int actualSize;        const int INCREMENT = 10;};template<typename T>ArrayList<T>::ArrayList(){    arr = new T[INCREMENT];    allocatedSize = INCREMENT;    actualSize = 0;}template<typename T>ArrayList<T>::~ArrayList(){    delete[] arr;}template<typename T>ArrayList<T>::ArrayList(const ArrayList<T>& other){    arr = new T[other.allocatedSize];    allocatedSize = other.allocatedSize;    actualSize = other.actualSize;    for(int i = 0; i<other.actualSize; i++)        arr[i] = other.arr[i];}template<typename T>ArrayList<T>& ArrayList<T>::operator= (const ArrayList<T>& other){    delete[] arr;    arr = new T[other.allocatedSize];    allocatedSize = other.allocatedSize;    actualSize = other.actualSize;    for(int i = 0; i<other.actualSize; i++)        arr[i] = other.arr[i];    return *this;}//Add item to end of arraytemplate<typename T>void ArrayList<T>::add(const T& item){    if(actualSize < allocatedSize)    {        actualSize++;        arr[actualSize-1] = item;    }    else    {        allocatedSize += INCREMENT;        T*cpy = new T[allocatedSize];        for(int i=0; i<actualSize; i++)            cpy[i] = arr[i];        actualSize++;        cpy[actualSize-1] = item;        delete[] arr;        arr = cpy;    }}template<typename T>void ArrayList<T>::add(const T& item, int index){    if(index < actualSize - 1)        return;    allocatedSize = (actualSize < allocatedSize) ? allocatedSize : allocatedSize + INCREMENT;    T*cpy = new T[allocatedSize];    for(int i=0; i<index; i++)        cpy[i] = arr[i];    cpy[index] = item;    for(int i = index; i<actualSize; i++)        cpy[i+1] = arr[i];    actualSize++;    delete[] arr;    arr = cpy;}//Remove ALL occurrences of item from arraytemplate<typename T>void ArrayList<T>::remove(const T& item){    if(actualSize <= 0)        return;    T*cpy = new T[allocatedSize];    T*cpyStart = cpy;    T*arrStart = arr;    for(int i = 0; i<actualSize; i++)    {        if(arr[i] != item)        {            *cpy = *arr;            cpy++;        }        arr++;    }    cpy = cpyStart;    arr = arrStart;    delete[] arr;    arr = cpy;}template<typename T>void ArrayList<T>::remove(int index){    if(index > actualSize - 1)        return;    for(int i = 0; i<actualSize; i++)    {        if(i>=index)            arr[i] = arr[i+1];    }}template<typename T>T& ArrayList<T>::get(int index){    return arr[index];}template<typename T>void ArrayList<T>::set(int index, const T& item){    if(index > actualSize - 1)        return;    arr[index] = item;}
Partial ArrayList implementation in C++
c++;array;vectors