fork download
  1. #include <iostream>
  2. #include <boost/range/iterator_range.hpp>
  3.  
  4. int main()
  5. {
  6. const int array[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
  7.  
  8. // Just process the first element separately. No checks required in the loop
  9. std::cout << *std::begin(array);
  10.  
  11. for (const auto& item : boost::make_iterator_range(array, 1, 0))
  12. {
  13. std::cout << ", " << item;
  14. }
  15. }
  16.  
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
1, 2, 3, 4, 5, 6, 7, 8, 9, 10