I built a doubly linkedlist using a template class, The class i built contain innter public class linkedListNode which contain private field next and previous. For encapsulation issues i wanted to define a method that return the next node
template <class T>
MyLinkedList<T>::MyLinkedListNode* MyLinkedList<T>::MyLinkedListNode::getNext()
{
return this -> next;
}
but it is a compilation error. I also tryed to use typename and it also a compilation error
The compliation error is :
need ‘typename’ before ‘MyLinkedList::MyLinkedListNode’ because ‘MyLinkedList’ is a dependent scope