Non-static member functions require an instance of the class, which gets implicitly passed as the first argument when the function is called (sort of like Python's "self"). The iostream operator implementation in the standard library doesn't support this. It also needs to live in the std namespace, AFAIK.
There is a good explanation on stackoverflow starting at about the third answer.
Note that the operators don't need to be "friends" if the data they use is exposed through public getter / setter methods of the class.
Bookmarks