Seems to work in Visual Studio, so I can't say for sure what's the problem.
However, I've found that friend declarations involving templates can be quite tricky to declare correctly. (used to be near impossible in older versions of VS) On occasion I fixed these problems by declaring a helper class instead: That helper class would have a single public constructor with the same parameter list as the function in question, and it would be declared friend to the original templated class. In your case it would be sth. like this:
template <typename Type> class SingleList;
template <typename Type> class SingleListNode;
template <typename Type> class SingleListNodeStreamHelper {
ostream& os;
SingleListNode<Type>& node;
public:
SingleListNodeStreamHelper(ostream& s, SingleListNode& n)
: os(s), node(n) {}
ostream& operator()(); {
return os;
}
};
template <typename Type> class SingleListNode {
private:
friend SingleListNodeStreamHelper<Type>;
};
ostream& operator<< <Type>(ostream& s, SingleListNode<Type> n) {
SingleListNodeStreamHelper<Type> helper(s, n);
return helper();
}
I haven't taken the time to test this, but I hope you understand the principle anyway.