title: Why will std::sort crash if the comparison function is not as operator <?
body: <p>The following program is compiled with VC++ 2012.</p>
  
  <pre><code>#include &lt;algorithm&gt;
  
  struct A
  {
      A()
          : a()
      {}
  
      bool operator &lt;(const A&amp; other) const
      {
          return a &lt;= other.a;
      }
  
      int a;
  };
  
  int main()
  {
      A coll[8];
      std::sort(&amp;coll[0], &amp;coll[8]); // Crash!!!
  }
  </code></pre>
  
  <p>If I change <code>return a &lt;= other.a;</code> to <code>return a &lt; other.a;</code> then the program runs as expected with no exception.</p>
  
  <p>Why?</p>