std::copy with a lazy range as a source
| 80 | |
| 81 | // std::copy with a lazy range as a source |
| 82 | void lazy_copy(benchmark::State& state) { |
| 83 | auto source = generate_junk(kSize); |
| 84 | std::vector<int> target(kSize); |
| 85 | auto lazy_range = internal::MakeLazyRange( |
| 86 | [&source](int64_t index) { return source[index]; }, source.size()); |
| 87 | |
| 88 | for (auto _ : state) { |
| 89 | std::copy(lazy_range.begin(), lazy_range.end(), target.begin()); |
| 90 | } |
| 91 | state.SetItemsProcessed(state.iterations() * kSize); |
| 92 | } |
| 93 | |
| 94 | BENCHMARK(lazy_copy); |
| 95 |
nothing calls this directly
no test coverage detected