Boost C++ Libraries: Ticket #12374: doku bug boost::adaptors::sliced https://svn.boost.org/trac10/ticket/12374 <blockquote> <p> Precondition: 0 &lt;= n &amp;&amp; n &lt;= m &amp;&amp; m &lt; distance(rng) </p> </blockquote> <p> must be </p> <blockquote> <p> Precondition: 0 &lt;= n &amp;&amp; n &lt;= m &amp;&amp; m =&lt; distance(rng) </p> </blockquote> <p> example: </p> <p> std::vector&lt;int&gt; vec; vec.push_back(3); auto wholeVectorSlice=boost::adaptors::slice(vec,0,vec.size()); <em>distance(rng)==1 </em></p> <p> Otherwise it woudln't be possible to include the last element of the input range in the slice. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12374 Trac 1.4.3 Michel Morin Wed, 03 Aug 2016 14:08:23 GMT owner, component changed https://svn.boost.org/trac10/ticket/12374#comment:1 https://svn.boost.org/trac10/ticket/12374#comment:1 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Matias Capeletto</span> to <span class="trac-author">Neil Groves</span> </li> <li><strong>component</strong> <span class="trac-field-old">Documentation</span> → <span class="trac-field-new">range</span> </li> </ul> Ticket joakimas@… Sat, 24 Sep 2016 14:42:22 GMT cc set https://svn.boost.org/trac10/ticket/12374#comment:2 https://svn.boost.org/trac10/ticket/12374#comment:2 <ul> <li><strong>cc</strong> <span class="trac-author">joakimas@…</span> added </li> </ul> <p> I noticed this too when looking at the documentation. Why shouldn't we be allowed to include the last element when slicing? I guess this might be a problem only with the documentation. </p> <p> It seems like a more useful precondition would be </p> <pre class="wiki">0 &lt;= n &amp;&amp; n &lt;= m &amp;&amp; m &lt;= distance(rng) </pre><p> In addition, the "returns" part of the text says the result is "make_range(rng, n, m)" but I fail to find any useful documentation on what "make_range" is. </p> <p> For reference, I have been looking at this page: <a href="http://www.boost.org/doc/libs/1_61_0/libs/range/doc/html/range/reference/adaptors/reference/sliced.html">http://www.boost.org/doc/libs/1_61_0/libs/range/doc/html/range/reference/adaptors/reference/sliced.html</a> </p> Ticket