Creating an array with templates
Hello,
I'm trying to create a temporary array inside a member function. It used to be restricted to an int type, but now I want to add templates to the class so what used to be:
Code:
int *a = new int[size];
Is changed to:
Code:
T *a = new T [size];
Is it possible to use this method for T? Or do I need to call the constructor here? I get this error message, which I think might be related to this, what do you think?
Code:
error: expected initializer before ‘*’ token