
Hi Maxim, Maxim Yanchenko wrote:
Am I doing anything wrong, or range::stride is broken?
I think it's a bug of strided_range. Could you please create a ticket for this at https://svn.boost.org/trac/boost? (It would be better to provide a minimal test case.) Quick hack to fix this is changing the strided_range's constructor // boost/range/adaptor/strided.hpp Line 89 public: template< typename Difference > strided_range(Difference stride, Rng& rng) : super_t(make_strided_iterator(boost::begin(rng), stride), make_strided_iterator(boost::end(rng), stride)) { } to public: template< typename Difference > strided_range(Difference stride, Rng& rng) : super_t( make_strided_iterator(boost::begin(rng), stride) , make_strided_iterator(boost::begin(rng) + (boost::size(rng) + stride - 1) / stride * stride, stride) ) { } Regards, Michel