如何在到达时将其插入已满的动态阵列?

I'm implementing a dynamic array; the main issue is that when I call the insertBack() function control will never reach inside because the condition is met i.e. since Capacity is 0 and n (which is the size) is also 0; it can never go inside the code block. How would I go about fixing this issue? I tried making an overloaded constructor and passing a certain Capacity--it didn't work out.

#include <iostream>

template<typename T>
class container
{
    template <typename T2>
    friend std::ostream& operator<<(std::ostream& out, const container<T2> &cobj);
public:
    container();
    ~container();
    bool isEmpty() const;
    bool isFull();
    int size() const;
    int capacity() const;
    bool insertBack(const T& val);
private:
    void allocate(T* &temp);
    T *arr;
    int Capacity;
    int n;  
};

template<typename T2>
std::ostream& operator<<(std::ostream& out, const container<T2> &cobj)
{
    std::cout << "Currently it contains " << cobj.size() << " value(s)" << std::endl
        << "Container storage capacity = " << cobj.capacity() << std::endl
        << "The contents of the container:" << std::endl;

    if (cobj.isEmpty())
    {
        std::cout << "*** Container is currently empty!" << std::endl;
    }
    else
    {
        for (int i=0; i<cobj.size(); ++i)
        {
            std::cout << cobj.arr[i] << " ";
        }
    }

    return out;
}

template<typename T>
container<T>::container()
{
    arr = new T[Capacity];
    n = 0;
}

template<typename T>
container<T>::~container()
{
    delete []arr;
    arr = nullptr;
    std::cout << "Destructor called! (this line is normally not displayed)" << std::endl;
}

template<typename T>
bool container<T>::isEmpty() const
{
    return n==0;
}

template<typename T>
bool container<T>::isFull()
{
    return n==Capacity;
}

template<typename T>
int container<T>::capacity() const
{
    return Capacity;
}

template<typename T>
int container<T>::size() const
{
    return n;
}

template<typename T>
bool container<T>::insertBack(const T& val)
{
    if (!isFull())
    {
        T* old_array = arr; 
        for (int i=0; i<n; ++i)
        {
            arr[i] = old_array[i];
        }

        arr[n] = val;
        n++;
        delete[] old_array;

        return true;
    }
    else
    {
        allocate(arr);
        return false;
    }
}

template<typename T>
void container<T>::allocate(T* &temp)
{
    if (Capacity==0)
    {
        temp = new T;
    }
    else
    {
        temp = new T[Capacity <<= 1];
    }
}

int main()
{
    container<int> a1;
    std::cout << a1 << std::endl; 
    std::cout << "Currently, the container object contains 0 element(s) or 0 value(s)" << std::endl;

    std::cout << "\nWe now insert 5 values at the back of the array, one at a time:" << std::endl;

    const int num = 5;
    for (int i=1, c=10; i<=num; ++i, c+=10)
    {
        a1.insertBack(c);
        std::cout << a1 << std::endl << std::endl;
    }
}