Boost C++ Libraries: Ticket #9519: wrong results for strided, reversed range https://svn.boost.org/trac10/ticket/9519 <p> The following code: </p> <pre class="wiki">#include &lt;vector&gt; #include &lt;numeric&gt; #include &lt;iostream&gt; #include &lt;boost/range/adaptor/strided.hpp&gt; #include &lt;boost/range/adaptor/reversed.hpp&gt; int main() { std::vector&lt;int&gt; vi(50); std::iota(vi.begin(), vi.end(), 0); using namespace boost::adaptors; for(int i : vi | strided(3) | reversed) std::cout &lt;&lt; i &lt;&lt; ' '; std::cout &lt;&lt; '\n'; } </pre><p> Yields the following output for me: </p> <pre class="wiki">13 10 7 4 1 0 </pre><p> That's whack. I don't understand it at all. I would expect it to count down from 50 by steps of 3. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/9519 Trac 1.4.3 rednaks Thu, 26 Dec 2013 13:09:02 GMT attachment set https://svn.boost.org/trac10/ticket/9519 https://svn.boost.org/trac10/ticket/9519 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">reversed_range.cpp</span> </li> </ul> <p> Correct bevhavior </p> Ticket rednaks Thu, 26 Dec 2013 13:10:16 GMT <link>https://svn.boost.org/trac10/ticket/9519#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9519#comment:1</guid> <description> <p> Did you tried to reverse then stride ? see attachement </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Eric Niebler</dc:creator> <pubDate>Sat, 28 Dec 2013 01:23:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/9519#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/9519#comment:2</guid> <description> <p> I don't see the point you're trying to make. Are you saying there isn't a bug? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Neil Groves</dc:creator> <pubDate>Fri, 21 Feb 2014 20:30:52 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/9519#comment:3 https://svn.boost.org/trac10/ticket/9519#comment:3 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket Neil Groves Wed, 26 Feb 2014 21:23:26 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/9519#comment:4 https://svn.boost.org/trac10/ticket/9519#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> There clearly is a bug, and this particular adaptor has been problematic and suffering an unacceptable defect density. I have rewritten the adaptor and used Eric's example as a basis for a unit test. The changes are committed to the develop branch. </p> Ticket