using namespace std;
friend ostream& operator<<(ostream &,SomeClass
ostream& operator<<(ostream &os, const SomeClass
os<<"( " << some.member <<") ";
int main(int argc, char* argv)
cout << sc; // Problem????
It reported that operator << was not found.
The problem is that in the class definition, a friend was declared as a function, not a template function. To make the code link properly, the friend declaration should be changed to:
friend ostream& operator<< <>(ostream &,SomeClass
Just another little C++ twist.