That is a very strange piece of code for a double linked list. A good start to make a double linked list might be to look over some stl implementations. I would suggest this sort of structure...
Code:
template<typename T>
class List
{
public:
// usual list functions
class Iterator
{
public:
// usual iterator funcs
private:
Node* currentnode;
};
class Const_Iterator
{
public:
// usual iterator funcs
private:
Node* currentnode;
};
private:
struct Node // i like struct here cos its only POD(plain old data)but feel free to prefer class
{
T Data;
Node* next;
Node* prev;
};
Node* Head;
Node* Tail;
};
As others have said there is no point in not storing data in head and tail nodes. Head and tail pointers will change as the list gets nodes inserted but thats what linked lists are designed to do.