The C++20 standard added another way to iterate over homogenous streams, the istream view.
The std::views::istream is the view version of std::istream_iterator, providing the expected view interface and the associated compatibility with other views.
Compiler Explorer link: https://compiler-explorer.com/z/cjfxYzzhT