
Hello, I'm using the Boost.Range library (Version:1.55.0). When I use any_range with sliced adaptor, slicing operation doesn't return. Is my code something wrong? If it is a bug, I will create a ticket. Here is the minimized code that reproduces the situation: #include <vector> #include <iostream> #include <cassert> #include <boost/range/any_range.hpp> #include <boost/range/adaptor/sliced.hpp> typedef boost::any_range<int, boost::random_access_traversal_tag, int, std::ptrdiff_t> int_range; int main() { std::vector<int> v; v.push_back(0); v.push_back(1); v.push_back(2); { // works fine std::cout << "slice vector" << std::endl; int_range ir1 = v | boost::adaptors::sliced(0,2); std::cout << "slice vector finished" << std::endl; assert(ir1[0] == 0); assert(ir1[1] == 1); assert(ir1.size() == 2); } { int_range ir2(v); std::cout << "slice any_range" << std::endl; int_range ir3 = ir2 | boost::adaptors::sliced(0,2); // never return... std::cout << "slice any_range finished" << std::endl; assert(ir3[0] == 0); assert(ir3[1] == 1); assert(ir3.size() == 2); } } Takatoshi Kondo