Files
2025-10-25 03:02:53 +03:00

1.7 KiB
Raw Permalink Blame History

[range.istream.overview]

25 Ranges library [ranges]

25.6 Range factories [range.factories]

25.6.6 Istream view [range.istream]

25.6.6.1 Overview [range.istream.overview]

1

#

basic_istream_view models input_range and reads (using operator>>) successive elements from its corresponding input stream.

2

#

The name views::istream denotes a customization point object ([customization.point.object]).

Given a type T and a subexpression E of type U, if U modelsderived_from<basic_istream<typename U::char_type,typename U::traits_type>>, then the expression views::istream(E) is expression-equivalent tobasic_istream_view<T, typename U::char_type,typename U::traits_type>(E); otherwise, views::istream(E) is ill-formed.

3

#

[Example 1: auto ints = istringstream{"0 1 2 3 4"}; ranges::copy(views::istream(ints), ostream_iterator{cout, "-"});// prints 0-1-2-3-4- — end example]