title: Why use “b < a ? a : b” instead of “a < b ? b : a” to implement max template?
body: <p><a href="http://www.tmplbook.com/" rel="noreferrer">C++ Templates - The Complete Guide, 2nd Edition</a> introduces the <a href="http://www.tmplbook.com/code/basics/max1.hpp.html" rel="noreferrer">max</a> template:  </p>
  
  <pre><code>template&lt;typename T&gt;
  T max (T a, T b)
  {
    // if b &lt; a then yield a else yield b
    return  b &lt; a ? a : b;
  }
  </code></pre>
  
  <p>And it explains using <code>“b &lt; a ? a : b”</code> instead of <code>“a &lt; b ? b : a”</code>:  </p>
  
  <blockquote>
    <p>Note that the max() template according to [StepanovNotes]
    intentionally returns “b &lt; a ? a : b” instead of “a &lt; b ? b : a” to
    ensure that the function behaves correctly even if the two values are
    equivalent but not equal.</p>
  </blockquote>
  
  <p>How to understand "<code>even if the two values are equivalent but not equal.</code>"? <code>“a &lt; b ? b : a”</code> seems have the same result for me.</p>