A
Allan Bruce
I have had a look through the FAQ and found that if I am using a class
template then I need an argument list. I have tried to add this but it is
not quite working - i.e. it doesnt compile. My code is below, could
somebody please point me in the right direction?
Thanks
Allan
#include <iostream>
template<typename generic>
class Node
{
public:
Node();
Node(char xiType);
virtual ~Node();
void SetNextLink(Node *xiNode){NextNode = xiNode;}
void SetPrevLink(Node *xiNode){PrevNode = xiNode;}
Node *GetPrevLink(){return PrevNode;}
Node *GetNextLink(){return NextNode;}
void SetData(generic *xiData){Data = xiData;}
generic *GetData(){return Data;}
private:
Node *NextNode;
Node *PrevNode;
generic *Data;
bool Tail;
bool Head;
};
Node<int> NodeInt;
Node<float> NodeFloat;
Node<double> NodeDouble;
Node<char> NodeChar;
template then I need an argument list. I have tried to add this but it is
not quite working - i.e. it doesnt compile. My code is below, could
somebody please point me in the right direction?
Thanks
Allan
#include <iostream>
template<typename generic>
class Node
{
public:
Node();
Node(char xiType);
virtual ~Node();
void SetNextLink(Node *xiNode){NextNode = xiNode;}
void SetPrevLink(Node *xiNode){PrevNode = xiNode;}
Node *GetPrevLink(){return PrevNode;}
Node *GetNextLink(){return NextNode;}
void SetData(generic *xiData){Data = xiData;}
generic *GetData(){return Data;}
private:
Node *NextNode;
Node *PrevNode;
generic *Data;
bool Tail;
bool Head;
};
Node<int> NodeInt;
Node<float> NodeFloat;
Node<double> NodeDouble;
Node<char> NodeChar;