| 7 | #include <vector> |
| 8 | |
| 9 | int main() |
| 10 | { |
| 11 | auto v = std::vector{3, 5, 6, 7, 9}; |
| 12 | auto rng = v | |
| 13 | std::views::take_while([](int x) { return x > 5; }) |
| 14 | // #A View with harmonized iterator types |
| 15 | | std::views::common; |
| 16 | |
| 17 | auto res = std::accumulate(rng.begin(), rng.end(), 0); |
| 18 | std::cout << res << '\n'; |
| 19 | } |