i need help with an error im recieving.
i have a template linked list class
template <class LT>
class LList
{
private:
class LNode
{
public:
LNode ();
LT data;
LNode * next;
};
public:
LList();
LList( const LList & other);
~LList ();
LList & operator = (const LList & other);
bool operator == (const LList & other);
int Size() const;
friend ostream & operator << <> (ostream & outs, const LList<LT> & L);
bool InsertFirst (const LT & value);
bool InsertLast (const LT & value);
bool DeleteFirst ();
bool DeleteLast ();
private:
LNode * first;
int size;
};
and the friend function is giving me an error:
template <class LT>
ostream & operator << (ostream & outs, const LList<LT> & L)
{
if (L.first == NULL)
return outs;
outs << L.first -> data;
for (LList<LT>::LNode * n = L.first -> next; n != NULL; n = n -> next)
{
outs << ' ' << n -> data;
}
return outs;
}
i get an error at the for loop... the error is :
LLIST.tmp: In function `std:

stream& operator<<(std:

stream&, const LList<LT>&)':
LLIST.tmp:111: error: `n' undeclared (first use this function)
LLIST.tmp:111: error: (Each undeclared identifier is reported only once for each function it appears in.)
LLIST.tmp:33: error: `LList<int>::LNode*LList<int>::first' is private
LLIST.tmp:106: error: within this context
LLIST.tmp:33: error: `LList<int>::LNode*LList<int>::first' is private
LLIST.tmp:109: error: within this context
application.cpp:19: instantiated from here
LLIST.tmp:33: error: `LList<int>::LNode*LList<int>::first' is private
LLIST.tmp:111: error: within this context
LLIST.tmp:111: error: dependent-name ` LList<LT>::LNode' is parsed as a non-type, but instantiation yields a type
LLIST.tmp:111: note: say `typename LList<LT>::LNode' if a type is meant
i know these all have to do with friend and being private, what do i do?!?!