Overloading << for my class
I'm making a general "logger" class, and for this i am using the c++ ostream class, because of the ease of << use. I will need to overload the << operator, so that people outside the class can use "logger_obj << "Hello" << endl;". I was reading about this, and the site i am reading says that something has to be a "friend" to be able to use this operator when it is overloaded. What does this mean, and why is it, or is ut untrue?
Example given:
Code:
__friend ostream& operator << ( ostream& s, ED& d);_
_
__ostream& operator << (ostream& s, ED& d ) {_
___s << d.feet << "\'=" << d.inches << '\"';_
___return s;_
__}
~Inquirer