C++ range/xrange equivalent in STL or boost?
Boost irange should really be the answer (ThxPaul Brannan) I’m adding my answer to provide a compelling example of very valid use-cases that are not served well by manual looping: #include <boost/range/adaptors.hpp> #include <boost/range/algorithm.hpp> #include <boost/range/irange.hpp> using namespace boost::adaptors; static int mod7(int v) { return v % 7; } int main() { std::vector<int> v; boost::copy( … Read more