set::find() doesn't find
<p>I have a problem with this code (cubeBoxData is a set of cubeBox):</p>

<pre><code>cubeBox temp(bx,by,bz);
cubeBoxData.insert(temp);
set&lt;cubeBox&gt;::iterator i = cubeBoxData.find(temp);
const_cast&lt;cubeBox&amp;&gt;(*i).addCube(x,y,z);
</code></pre>

<p>The problem is that cubeBoxData.find(temp); doesn't find temp, then the program fails trying to call addCube(), and I don`t know why, because this code works fine (just change the third line):</p>

<pre><code>cubeBox temp(bx,by,bz);
cubeBoxData.insert(temp);
set&lt;cubeBox&gt;::iterator i = find(cubeBoxData.begin(),cubeBoxData.end(),temp);
const_cast&lt;cubeBox&amp;&gt;(*i).addCube(x,y,z);
</code></pre>

<p>The operator &lt; for cubeBox is:</p>

<pre><code>bool operator&lt;(const cubeBox&amp; c) const {
    return x&lt;c.x ? true : y&lt;c.y ? true : z&lt;c.z ? true : false;
}
</code></pre>

<p>And addCube doesn't change x, y or z.</p>

<p>I think my operator&lt; is wrong and I'm missing something silly, but i can´t figure what is it.</p>
