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

37 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[range.istream.overview]
# 25 Ranges library [[ranges]](./#ranges)
## 25.6 Range factories [[range.factories]](range.factories#range.istream.overview)
### 25.6.6 Istream view [[range.istream]](range.istream#overview)
#### 25.6.6.1 Overview [range.istream.overview]
[1](#1)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L3997)
basic_istream_view models [input_range](range.refinements#concept:input_range "25.4.6Other range refinements[range.refinements]") and
reads (using operator>>) successive elements
from its corresponding input stream[.](#1.sentence-1)
[2](#2)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L4002)
The name views::istream<T> denotes
a customization point object ([[customization.point.object]](customization.point.object "16.3.3.3.5Customization Point Object types"))[.](#2.sentence-1)
Given a type T and a subexpression E of type U,
if U models[derived_from](concept.derived#concept:derived_from "18.4.3Concept derived_­from[concept.derived]")<basic_istream<typename U::char_type,typename U::traits_type>>,
then the expression views::istream<T>(E) is expression-equivalent tobasic_istream_view<T, typename U::char_type,typename U::traits_type>(E);
otherwise, views::istream<T>(E) is ill-formed[.](#2.sentence-2)
[3](#3)
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L4014)
[*Example [1](#example-1)*: auto ints = istringstream{"0 1 2 3 4"};
ranges::copy(views::istream<int>(ints), ostream_iterator<int>{cout, "-"});// prints 0-1-2-3-4- — *end example*]