So I have this templated class called list
//List.h
#ifndef LIST_H
#define LIST_H
#include<fstream>
template <class T>
class List
{
private:
struct ListNode
{
T value;
ListNode* next;
ListNode* prev;
ListNode(T value1, ListNode* next1 = NULL, ListNode* prev1 = NULL)
{
value = value1;
next = next1;
prev = prev1;
}
};
ListNode* head;
ListNode* tail;
public:
List() {head = NULL; tail = NULL;};
~List();
void PrintForward(std::ostream &out);
void PrintBackward(std::ostream &out);
void InsertFront(const T &item);
void InsertRear(const T &item);
bool InsertAsNth(int N, const T &item);
bool DeleteFront(T &val);
bool DeleteRear(T &val);
bool DeleteNth(int N, T &val);
int DeleteAllOccur(const T &item);
std::ostream& operator<< (std::ostream &out, List::ListNode const* p);
};
#endif
Now I have been trying to get this to compile but with no success. I know it has to do with the way I have the ostream operator overloaded but unfortunately I really do not know/could not find a better way.
also this is my compiler error
warning C4346: 'List<T>::ListNode' : dependent name is not a type prefix with 'typename' to indicate a type