For a C++ class I am taking, I am creating a Vector Library. We are not allowed to use the built in vector library, of course, and I have decided to use arrays in my 'myvector' class.

I am currently trying to test my code and I am not sure how to create an object of class myvector. 

The error I get is `Incomplete type is not allowed.`

main.cpp:

```
#include "my_vectorHeader.h"

using namespace std;

int main(){

myvector<int> vector = new myvector<int>(3);
}

```

my\_vectorLib.cpp:

```
#include "my_vectorHeader.h"
#include iostream
#include exception

using namespace std;

template<typename T> class myvector {

private:

    int vector_size, //holds current size
        vector_capacity; //holds current capacity

public:

    //constructors
    myvector<T>(int length){
        T vector[length];
        vector_size = length;
        vector_capacity = length;
    }

    myvector<T>(const T& doppelganger){
        T vector = doppelganger;

        while(vector[vector_size] != NULL)
            vector_size++;
    }

    myvector<T>(const T& dat_arr, int arr_size){

        vector_size = arr_size;
        vector_capacity = arr_size;

        for(int i = 0; i < arr_size; i++)
            vector[i] = dat_arr[i];
    } 

    ~myvector(){ //destructor
        delete [] vector;
        delete myvector;
    }

    myvector& myvector::operator[](int index){ //override []
        try{
            throw vector[index];
        } catch(exception e){
            cout << e.what() << endl;
        }
        return vector[index];
    }

    T at(int index){
        return vector[index];
    }

    int size(){
        return vector_size;
    }

    int capacity(){
        return vector_capacity;
    }

    bool empty(){
        if(size() > 0)
            return false;
        else 
            return true;
    }

    void resize(int new_size){
        T vector_copy[new_size];

        for(int i = 0; i < new_size; i++){

            if(i >= vector_size)
                vector_copy[i] = NULL;
            else
                vector_copy[i] = vector[i];

            if(new_size > capacity)
                capacity = new_size;
        }

        vector_size = new_size;

        delete [] vector;

        T *vector;
        vector = vector_copy;

        for(int i = 0; i < vector_size; i++)
            vector[i] = vector_copy[i];

        delete [] vector_copy;
    }

    void reserve(int new_capacity){
        if(new_capacity < vector_size){
            cout << "Error. Newly provided vector capacity is smaller than the current vector size. The capacity is " << vector_capacity << " and has not been changed.";
        } else {
            vector_capacity = new_capacity;
        }
    }

    T pop_back(){
        T return_val = vector[size() - 1];
        resize(size() - 1);
        return return_val;
    }

    void push_back(T new_val){
        resize(size() + 1);
        vector[size() - 1] = new_val;
    }

    void assign(int position, T new_val){
        vector[position] = new_val;
    }

    void clear(){
        for(int i = 0; i < size(); i++)
            vector[i] = NULL;
    }

    void erase(int position){
        vector[position] = NULL;
        do{
            vector[position] = vector[position + 1];
        }while(position != NULL);
        resize(size() - 1);
    }

    void erase(int in, int between){
        int i = in + 1, j = between;
        while(i < between){
            vector[i] = vector[j];
            vector[j] = NULL;
            i++, j++;
        }
        resize(between);
    }

    void insert(int index, T new_val){
        for(int i = size + 1; i > index; i--)
            vector[i] = vector[i - 1];
        vector[index] = new_val;
    }

};

```