cpp/src/arrow/util/range_benchmark.cc
void lazy_copy_converting(benchmark::State& state) {
  auto source = generate_junk<int64_t>(kSize);
  std::vector<int32_t> target(kSize);
  auto lazy_range = internal::MakeLazyRange(
      [&source](int64_t index) { return static_cast<int32_t>(source[index]); },
      source.size());

  for (auto _ : state) {
    std::copy(lazy_range.begin(), lazy_range.end(), target.begin());
  }
}
// std::copy with a lazy range which does static cast.
// Should be the same performance as std::copy with differently typed iterators
:copy with a lazy range which does static cast.
Should be the same performance as std::copy with differently typed iterators
: copy with a lazy range which does static cast . Should be the same performance as std :: copy with differently typed iterators
void lazy_copy_converting(benchmark::State& state) {
  auto source = generate_junk<int64_t>(kSize);
  std::vector<int32_t> target(kSize);
  auto lazy_range = internal::MakeLazyRange(
      [&source](int64_t index) { return static_cast<int32_t>(source[index]); },
      source.size());
  for (auto _ : state) {
    std::copy(lazy_range.begin(), lazy_range.end(), target.begin());
  }
}
void lazy_copy_converting ( benchmark :: State & state ) { auto source = generate_junk < int64_t > ( kSize ) ; std :: vector < int32_t > target ( kSize ) ; auto lazy_range = internal :: MakeLazyRange ( [ & source ] ( int64_t index ) { return static_cast < int32_t > ( source [ index ] ) ; } , source . size ( ) ) ; for ( auto _ : state ) { std :: copy ( lazy_range . begin ( ) , lazy_range . end ( ) , target . begin ( ) ) ; } }
std::copy with a lazy range which does static cast.
std :: copy with a lazy range which does static cast .