I am writing a template Array class. I can use it to declare things like this,
Array<int> oneDimenional(5);
But not this...
Array<Array<Array<Array<Array<Array<Array< int >>>>>>> Craziness(1000);
My class starts out like this,
template <typename T>
class Array{
private:
int len;
T *arr;
public:
Array() {
int len = 0;
}
Array(int size) {
arr = new T[size];
len = size;
}
~Array() {
delete[] arr;
}
//...
};
I'm guessing I need to change my constructor?