What is wrong with my overloaded operator<< function?
<pre><code>ostream &amp; operator&lt;&lt;(ostream &amp;out, const IntList &amp;rhs)
{
    IntNode *i = rhs.head;
    out &lt;&lt; rhs.head;
    while (rhs.head != 0)
    {
        out &lt;&lt; " " &lt;&lt; i;
        i = rhs.head-&gt;next;
    }

    return out;
}
</code></pre>

<p>The program compiles successfully but does not print anything out. What could be the problem?</p>