Chained equal operator overloading
<p>I would like to add an option to make a chained comparison on objects of <code>MyClass</code>. For example:</p>

<pre><code>MyClass one;
MyClass two;
MyClass three;
/*....*/
if (one == two == three){
    /*....*/
}
</code></pre>

<p>So that if all are equal it will return <code>true</code>, else it will return <code>false</code>.
I currently have this operator overload that works fine when comparing only two instances of <code>MyClass</code>:  </p>

<pre><code>bool operator==(const MyClass &amp;other);
</code></pre>

<p>I understand that <code>one==two==three</code> is equal to <code>((one==two)==three)</code> so I guess that should change my <code>operator==</code> to be something like:</p>

<pre><code>MyClass&amp; operator==(const MyClass &amp;other);
</code></pre>

<p>But I couldn't manage to understand how to complete this in order to be able to compare more than two instances in a row (chained).</p>