title: how is cmp defined in c++? with < or with <=?
body: <p>I asked me how the cmp function in std::sort and std::is_sorted is defined.</p>
  
  <p>here are two documentations for is_sorted_until how say it should be operator&lt; :</p>
  
  <p><a href="http://en.cppreference.com/w/cpp/algorithm/is_sorted_until" rel="nofollow">en.cppreference.com</a>
  <a href="http://www.cplusplus.com/reference/algorithm/is_sorted_until/" rel="nofollow">cplusplus.com</a></p>
  
  <p>But i think there should be a problem with equal elements.
  The list {1,1,1} should not be sorted because 1&lt;1==false.
  But there is an example which says:</p>
  
  <pre><code>...
  int *sorted_end = std::is_sorted_until(nums, nums + N);
  ...
  </code></pre>
  
  <p>1 1 4 9 5 3  : 4 initial sorted elements</p>
  
  <p>but that should return 1 if &lt; is used like documented.</p>
  
  <p>It would work with &lt;=, but that is not the way it is documented.</p>
  
  <p>I'm really confused. </p>