id summary reporter owner description type status milestone component version severity resolution keywords cc 13094 boost::adaptors::transform fails to preserve bidirectional behavior of range Jake Cobb Neil Groves "The documentation of `boost::adaptors::transform` states the returned range type is the same as the argument range type. However, when wrapping `std::vector`, the iterators returned are not bidirectional as the `std::vector` iterators are. `std::advance` with a negative integer leaves them unchanged and `std::prev` fails to compile with them. They do work as expected with `operator-`. {{{#!c++ #include #include #include #include int main() { std::vector data{1,2,3}; auto transformed = boost::adaptors::transform(data, [](int x) { return x; }); auto iter = transformed.begin(); // auto iter = data.begin(); // swap to compare std::cout << ""begin: "" << *iter << std::endl; // prints 1 both cases std::advance(iter, 1); std::cout << ""begin+1: "" << *iter << std::endl; // prints 2 both cases std::advance(iter, -1); // prints 2 for boost adaptor, 1 for std::vector std::cout << ""begin+1-1: "" << *iter << std::endl; std::cout << ""begin+1-1 (v2): "" << *(iter - 1) << std::endl; // prints 1 both cases // std::prev(iter); // boost fails bidirectional test, won't compile return 0; } }}}" Bugs closed To Be Determined range Boost 1.64.0 Problem invalid range adaptors transform