I'm trying to implement a linked list in C++ but I'm having a problem with an inner class.
I'm pretty sure I'm messing up generics somehow, and the head variable is giving me a problem
Code:
template<class E>
class LinkedList: public List {
private:
Node<E> head;
class Node<E> {
private:
E data;
Node* next;
Node* prev;
friend class List;
};
public:
//constructors and stuff here
};
Code:
linkedlist.h:21: error: declaration of ‘class E’ linkedlist.h:6: error: shadows template parm ‘class E’ linkedlist.h:21: error: ‘template<class E> class 'List’ used without template parameters
Comment