Boost C++ Libraries: Ticket #10483: boost::is_sorted docs incorrectly describe predicate https://svn.boost.org/trac10/ticket/10483 <p> From the documentation </p> <blockquote> <p> For the non-predicate version the return value is true if and only if for each adjacent elements [x,y] the expression x &lt; y is true </p> </blockquote> <p> and similarly for the predicate version. This isn't the case however. </p> <p> From the standard [alg.sorting] </p> <blockquote> <p> A sequence is sorted with respect to a comparator comp if for any iterator i pointing to the sequence and any non-negative integer n such that i + n is a valid iterator pointing to an element of the sequence, comp(*(i + n), *i) == false. </p> </blockquote> <p> So the docs should say </p> <blockquote> <p> the expression y &lt; x is false </p> </blockquote> <p> I get the following with g++'s underlying is_sorted(): </p> <pre class="wiki"> std::vector&lt;int&gt; v{1, 1}; std::cout &lt;&lt; boost::is_sorted(v) &lt;&lt; std::endl; // prints 1 </pre><p> Reference for is_sorted at cplusplus.com [sorry not allowed to post a link] backs this up. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10483 Trac 1.4.3 Neil Groves Mon, 02 Feb 2015 01:20:47 GMT status, milestone changed https://svn.boost.org/trac10/ticket/10483#comment:1 https://svn.boost.org/trac10/ticket/10483#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.58.0</span> </li> </ul> Ticket