cpp/src/arrow/util/range_benchmark.cc
// For loop with a post-increment of a lazy operator
For loop with a post-increment of a lazy operator
For loop with a post - increment of a lazy operator
void lazy_postinc(benchmark::State& state) {
  auto source = generate_junk(kSize);
  std::vector<int> target(kSize);
  auto lazy_range = internal::MakeLazyRange(
      [&source](int64_t index) { return source[index]; }, source.size());
  for (auto _ : state) {
    auto lazy_iter = lazy_range.begin();
    auto lazy_end = lazy_range.end();
    auto target_iter = target.begin();
    while (lazy_iter != lazy_end) *(target_iter++) = *(lazy_iter++);
  }
}
void lazy_postinc ( benchmark :: State & state ) { auto source = generate_junk ( kSize ) ; std :: vector < int > target ( kSize ) ; auto lazy_range = internal :: MakeLazyRange ( [ & source ] ( int64_t index ) { return source [ index ] ; } , source . size ( ) ) ; for ( auto _ : state ) { auto lazy_iter = lazy_range . begin ( ) ; auto lazy_end = lazy_range . end ( ) ; auto target_iter = target . begin ( ) ; while ( lazy_iter != lazy_end ) * ( target_iter ++ ) = * ( lazy_iter ++ ) ; } }
For loop with a post-increment of a lazy operator
For loop with a post - increment of a lazy operator