what's wrong with my code?
i still don't know how can i use template in class. #include<iostream> using namespace std; template < typename E > class node { E elem; node < E > *next; friend class list < E >; }; template < typename E > class list { private: node < E > *head; public: list () { head = NULL; } ~list () { while (!empty ()) removefront (); } bool empty () { return (head == NULL); } const E & front () const { return head->elem; } void addfront (const E & n) { node < E > *v = new node < E >; v->elem = n; v->next = head; head = v; } void addend (const E & n) { node < E > *v = new node < E >; v->elem = n; v->next = NULL; node < E > *cur = head; while (cur != NULL) { cur = cur->next; } cur->next = v; } void insertionafter (E & x, const E & n) { node < E > *cur = head; while (cur->elem != x) { cur = cur->next; } node < E > *newnode = new node < E >; newnode->elem = n; node < E > *aftercur = new node < E >; aftercur = cur->next; cur->next = newnode; newnode->next = aftercur; delete aftercur; } void deletionafter (E & x) { node < E > *cur = head; while (cur->elem != x) { cur = cur->elem; } node < E > *aftercur = new node < E >; aftercur = cur->next; cur->next = aftercur->next; delete aftercur; } void removefront () { if (!empty ()) node < E > *old = new node < E >; old = head; head = old->next; delete old; } void reverse (node < E > *x, node < E