[range.istream.view]

# 25 Ranges library [[ranges]](./#ranges)

## 25.6 Range factories [[range.factories]](range.factories#range.istream.view)

### 25.6.6 Istream view [[range.istream]](range.istream#view)

#### 25.6.6.2 Class template basic_istream_view [range.istream.view]

[ð](#lib:basic_istream_view)

namespace std::ranges {template<class Val, class CharT, class Traits>concept [*stream-extractable*](#concept:stream-extractable "25.6.6.2 Class template basic_­istream_­view [range.istream.view]") = // *exposition only*requires(basic_istream<CharT, Traits>& is, Val& t) { is >> t; }; template<[movable](concepts.object#concept:movable "18.6 Object concepts [concepts.object]") Val, class CharT, class Traits = char_traits<CharT>>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_­initializable [concept.default.init]")<Val> &&[*stream-extractable*](#concept:stream-extractable "25.6.6.2 Class template basic_­istream_­view [range.istream.view]")<Val, CharT, Traits>class basic_istream_view : public view_interface<basic_istream_view<Val, CharT, Traits>> {public:constexpr explicit basic_istream_view(basic_istream<CharT, Traits>& stream); constexpr auto begin() {**stream_* >> *value_*; return *iterator*{*this}; }constexpr default_sentinel_t end() const noexcept; private:// [[range.istream.iterator]](range.istream.iterator "25.6.6.3 Class basic_­istream_­view​::​iterator"), class basic_istream_view​::​*iterator*struct *iterator*; // *exposition only* basic_istream<CharT, Traits>* *stream_*; // *exposition only* Val *value_* = Val(); // *exposition only*};}

[ð](#lib:basic_istream_view,constructor)

`constexpr explicit basic_istream_view(basic_istream<CharT, Traits>& stream);
`

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L4063)

*Effects*: Initializes *stream_* with addressof(stream)[.](#1.sentence-1)

[ð](#lib:end,basic_istream_view)

`constexpr default_sentinel_t end() const noexcept;
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L4074)

*Effects*: Equivalent to: return default_sentinel;
