template class and its members?
Hi, I'm having a bit of strange problem that I can't seem to figure out, or maybe my eyes are just too tired from looking at this code, anyway...
The compiler, I think is trying to say that perhaps a syntax error of some sort exists somewhere in that area...???
I have a class template within i overload the '<<' by writing the follwing:
Code:
//in List.h file...
friend ostream& operator <<(ostream& outs, const List<ItemType>& the_list);
// Overloads the operator '<<' so that the contents of the List can
// be outputed
and inside the implementation file i write the following:
Code:
template<class ItemType>
ostream& operator <<(ostream& outs, const List<ItemType>& the_list)
{
for(int i = 0; i < the_list.length(); i++)
outs << the_list.item[i] << endl;
return outs;
}
the compiler directs me to the declaration of that function as the source of the problem, I have been looking at this for a while but i can't find the problem...
it's telling me some stupid stuff about putting ';' in front of '&'
weird...
any ideas???
thanx
matheo917
(if you guys need me to post more code then let me know)