title: Equality evaluation in associative containers (STL)
body: <p>I'm aware that STL associative containers (and other containers being sorted I would guess) use the sorting criterion to test for equality.</p>
  
  <p>The sorting criterion for containers defaults to st::less, so that would make the equality test for a container:</p>
  
  <pre><code>if (! (lhs &lt; rhs || rhs &lt; lhs))
  </code></pre>
  
  <p>or something similar.  I had a couple questions about this...</p>
  
  <p>First of all, it seems like a strangely inefficient way to compare for equality - why does the STL do it like this?  I would have expected STL containers to just take an extra default parameter for equality instead.</p>
  
  <p>My second question is more about the evaluation of the if statement above in general.  In C++, how much of that statement would be evaluated (lhs > rhs) was true?  Would it stop trying after evaluating the side that failed thus saving some efficiency?  If so, which part of the expression is evaluated first?</p>