I have created a class template that acts like an array. However, every time I try to set one of it's values, I get an error: example:
ArrayTypeIDeclared[12] = Somevalue;
yeilds:
error C2106: '=' : left operand must be l-value.
Here is the code to the template:
Code:template <class T> class array { public: array(int size) { Data = new T[size]; for(int x = 0; x < size; x++) Data[x] = 0x0; } ~array() { delete [] Data; } T* Data; T operator [] (int index) { return Data[index]; } };