operator overloading

in order to overload << or >> operator, why it is good to use non-member functions rather than member functions of the class?
If you can handle writing something like:
 
string<<cout and string>>cin 

you can use member functions,but not many people will appreciate that when reading your code.Cheers.
Hello Troubled646,

I wouldn't say that has to do with good or bad. It's just when you have control of the class you can write them as members. If you don't have control (such as stl iostreams) you must use the non-member if you want to extend the functionality
+1 to coder777
Topic archived. No new replies allowed.