Overloading the << operator.
I understand overloading for other operators such as +, == and so on...
but I find this code a little confusing.
Code:
friend ostream &operator <<(ostream &o, Text &t)
{
o << t.txtString;
return o;
}
I get it to work without any problem but I don't really understand the thing
about the references to ostream and why the function is supposed to
return a that ostream object. Could anyone please try to give me a detailed
explanation. I have tried google and found sites about this but those sites
didn't have any really good explanations of what's really going on with that code.