When do you define the ostream operator << for an class?
<p>The question could be subjective, so the syntax of </p>

<pre><code>std::ostream&amp; operator &lt;&lt; (std::ostream &amp; o, const SomeClass &amp;a) {
    return o &lt;&lt; a.accessor().. ; 
}
</code></pre>

<p>When do you normally define this for the classes that you write, when do you avoid writing this friend function for your class.</p>
