#include #include namespace boost { // Define a new overload of boost::size(rng) for std::forward_list // since we are not allowed to add a new function in namespace std. template inline typename std::forward_list::difference_type size(std::forward_list const& list) { return boost::distance(list); } } #include int main (int argc, char* argv[]) { using boost::adaptors::strided; std::forward_list list; list.push_front(2); list.push_front(1); list.push_front(0); ++boost::begin(list | strided(4)); return 0; }