So at the moment I'm trying to implement a templated InList class to keep track of various data types, but I am terrible with templates. And I don't want to use STL as I am trying to do this as an exercise.
Here is what I have so far, with T1 my data-type and T2 an allocator if I want to specialize with an Allocator class.
//the InList class
template <typename T1, class T2 = NULL>
class InList
{
private:
struct Node {
T1* data;
Node* next;
Node* prev;
};
T2* _allocator; //if I create a memory manager, this will be used
Node* _head;
Node* _tail;
public:
//a constructor and destructor
InList();
~InList();
};
//somewhere far away in a driver...
InList<int> int_list;
InList<double> double_list;
I am getting a syntax error (C2059) '<constant tree>'.
Could someone tell me what this means and where I might be going wrong?
Thanks for the help!