I would like to see something along the lines of this:
Code:
template<typename Type> class CLinkedList
{
public:
//CLinkedList(): pNext(NULL), pPrevious(NULL), pObject(NULL), pBeginOrEnd(NULL) { }
CLinkedList(CLinkedListBeginOrEnd<Type>* pBeginOrEnd): pNext(NULL), pPrevious(NULL), pObject(NULL), pBeginOrEnd(pBeginOrEnd) { }
//CLinkedList(const CLinkedList<Type, Allocator>& rCopy);
void InsertAfter(CLinkedList<Type>* pAfter);
void InsertBefore(CLinkedList<Type>* pBefore);
void InsertAtBeginning();
void InsertAtEnd();
void Remove();
//void Initialize(CLinkedListBeginOrEnd<Type, Allocator>* pBeginOrEnd);
//CLinkedList& operator = (const CLinkedList<Type, Allocator>& rCopy);
Type* pObject;
private:
CLinkedList* pNext;
CLinkedList* pPrevious;
CLinkedListBeginOrEnd<Type>* pBeginOrEnd;
};
CLinkedListBeginOrEnd is optional, but is useful is you want your lists to have a head and tail pointer.
Implementation is missing on purpose.
Perhaps you might get an idea of what is possible via linked lists in C++...