#include #include #include #include int main() { auto input = std::istringstream{"0 1 2 3 4 5 6 7 8 9"}; auto below_5 = std::ranges::istream_view(input) | std::views::take_while([](auto x) { return x < 5; }); for (auto e : below_5) std::cout << e << ' '; }