Hi I am tryna friend a class linkedlist in iterator but idk how to do it with templates
class Iterator{
private:
node<T>* v;
public:
Iterator(node<T>* u){
v = u;
}
T& operator*(){
return v->element;
}
friend class LinkedList;
};
template <class T>
class LinkedList{
public:
node<T>* head;
node<T>* tail;
}
I keep getting an error
doubleLinkedList.cpp: In instantiation of 'class Iterator<int>':
doubleLinkedList.cpp:214:26: required from here
doubleLinkedList.cpp:35:18: error: template argument required for 'class LinkedList'
node<T>* v;
^
I have tried alot of things like i putted a template on top of friend argument but nothing works