Im working on a template class which represents a managed Array.
E (*data)[];
data is my array.
data = new E[size];
And this, it doesn’t like. it throws me;
cannot convert Component* to Component (*)[] in assignment
What gives?
Also can anyone explain why E is denoted with a * even though I didn’t pass a pointer type into my template type?
Just make your
datamember anE*. You will still be able to index array-style aladata[i](that notation, when used with a pointer and integral value, basically means add the pointer and i times the size of the pointed-to objects).EDIT: