Hi :)
I have a problem. I have a class, called Sequence, which is a template. One of it's member variables is a vector or elements of type T. I would like to create a constructor which takes as it's argument an array of elements of type T and feeds them into the vector, but I'm unsure of how to do this. I have tried many attempts but all seem to fail. Here is a snippet of the .h file
template<class T>
class Sequence
{
public:
Sequence(){}
Sequence(T[]); //constructor taking an array of elems of type T
~Sequence();
protected:
std::vector<T> terms;
};
Now including this in a simple driver file doesn't give any syntax errors, however as soon as I try to implement the Sequence(T[]) constructor my compiler starts moaning. I don't have huge experience with templates so maybe I'm missing something obvious, but any pointers (no pun intended) would be much appreciated
Cheers,
Stonehambey