Boost C++ Libraries: Ticket #10989: strided breaks on impure traversal tags https://svn.boost.org/trac10/ticket/10989 <p> From <a class="ext-link" href="http://stackoverflow.com/questions/28280553/boostadaptorsstrided-cannot-be-used-after-boostadaptorstransformed"><span class="icon">​</span>http://stackoverflow.com/questions/28280553/boostadaptorsstrided-cannot-be-used-after-boostadaptorstransformed</a> </p> <p> [...]/boost/1.57.0/include/boost/range/iterator_range_core.hpp:216:20: error: no matching function for call to ‘boost::range_detail::strided_iterator&lt;boost::iterators::transform_iterator&lt;TrivialTrafo, __gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int&gt; &gt;, boost::iterators::use_default, boost::iterators::use_default&gt;, boost::iterators::detail::iterator_category_with_traversal&lt;std::input_iterator_tag, boost::iterators::random_access_traversal_tag&gt; &gt;::strided_iterator(boost::range_detail::strided_iterator&lt;boost::iterators::transform_iterator&lt;TrivialTrafo, __gnu_cxx::__normal_iterator&lt;int*, std::vector&lt;int&gt; &gt;, boost::iterators::use_default, boost::iterators::use_default&gt;, boost::iterators::random_access_traversal_tag&gt;&amp;)’ </p> <blockquote> <p> , m_End(End) </p> </blockquote> <p> Problem is that make_begin_strided_iterator et al coerce the returned iterator traversal category/tag to a pure traversal tag, which doesn't necessarily agree with the Category passed to iterator_range for the base type. Fix is to use iterators::pure_iterator_traversal. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10989 Trac 1.4.3 Edward Catmur <ed@…> Mon, 02 Feb 2015 17:33:01 GMT <link>https://svn.boost.org/trac10/ticket/10989#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10989#comment:1</guid> <description> <p> Fix: </p> <p> --- a/include/boost/range/adaptor/strided.hpp +++ b/include/boost/range/adaptor/strided.hpp @@ -603,7 +603,7 @@ namespace boost </p> <blockquote> <p> template&lt; </p> <blockquote> <p> class Rng, class Category = </p> </blockquote> </blockquote> <ul><li> typename iterator_traversal&lt; </li></ul><p> + typename iterators::pure_iterator_traversal&lt; </p> <blockquote> <p> typename range_iterator&lt;Rng&gt;::type </p> <blockquote class="citation"> <p> ::type </p> </blockquote> </blockquote> </description> <category>Ticket</category> </item> <item> <author>Edward Catmur <ed@…></author> <pubDate>Mon, 02 Feb 2015 17:34:47 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/10989#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10989#comment:2</guid> <description> <p> Let's try that again. </p> <p> Fix: </p> <pre class="wiki">--- a/include/boost/range/adaptor/strided.hpp +++ b/include/boost/range/adaptor/strided.hpp @@ -603,7 +603,7 @@ namespace boost template&lt; class Rng, class Category = - typename iterator_traversal&lt; + typename iterators::pure_iterator_traversal&lt; typename range_iterator&lt;Rng&gt;::type &gt;::type &gt; </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Neil Groves</dc:creator> <pubDate>Mon, 02 Feb 2015 20:19:32 GMT</pubDate> <title>status, milestone changed https://svn.boost.org/trac10/ticket/10989#comment:3 https://svn.boost.org/trac10/ticket/10989#comment:3 <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> <p> Thank you very much for your excellent ticket. This was superb. I've applied the change to the develop branch. Once this cycles a few times through the tests I shall merge to master ready for the 1.58 release. </p> Ticket