Which << is my overloaded operator in this statement?
<p>I have an overloaded &lt;&lt; operator from my reckful class implemented as follows:</p>

<pre><code>ostream&amp; operator &lt;&lt; (ostream&amp; os, const reckful&amp; p)
{
    os &lt;&lt; p.PrintStuff();

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

<p>PrintStuff() just being a member function of reckful that returns a string.</p>

<p>The way I understand things, if I were to write something like <code>cout &lt;&lt; reckobject &lt;&lt; endl;</code> in main(), <code>cout &lt;&lt; reckobject</code> would take precedence and my overloaded &lt;&lt; (using cout as the left operand and reckobject as the right operand) would return the ostream object <code>os</code>, leaving the expression <code>os &lt;&lt; endl;</code> to be evaluated which would output the string and then end the line. So, the first &lt;&lt; is the one I declared and the second is the standard &lt;&lt; right?</p>

<p>However, my main question is... what is the sequence of events, which are the left and right operands, and which &lt;&lt; operators are which when I run a statement like this:</p>

<pre><code>cout &lt;&lt; "reckful object = " &lt;&lt; reckobject &lt;&lt; "!" &lt;&lt; endl;
</code></pre>

<p>Why does this work if there isn't an ostream object and a reckful object on either side of one &lt;&lt; ?</p>

<p>Thanks.</p>
