71 lines
2.8 KiB
Markdown
71 lines
2.8 KiB
Markdown
[range.istream.iterator]
|
||
|
||
# 25 Ranges library [[ranges]](./#ranges)
|
||
|
||
## 25.6 Range factories [[range.factories]](range.factories#range.istream.iterator)
|
||
|
||
### 25.6.6 Istream view [[range.istream]](range.istream#iterator)
|
||
|
||
#### 25.6.6.3 Class basic_istream_view::*iterator* [range.istream.iterator]
|
||
|
||
[ð](#lib:basic_istream_view::iterator)
|
||
|
||
namespace std::ranges {template<[movable](concepts.object#concept:movable "18.6 Object concepts [concepts.object]") Val, class CharT, class Traits>requires [default_initializable](concept.default.init#concept:default_initializable "18.4.12 Concept default_initializable [concept.default.init]")<Val> &&[*stream-extractable*](range.istream.view#concept:stream-extractable "25.6.6.2 Class template basic_istream_view [range.istream.view]")<Val, CharT, Traits>class basic_istream_view<Val, CharT, Traits>::*iterator* {public:using iterator_concept = input_iterator_tag; using difference_type = ptrdiff_t; using value_type = Val; constexpr explicit *iterator*(basic_istream_view& parent) noexcept; *iterator*(const *iterator*&) = delete; *iterator*(*iterator*&&) = default; *iterator*& operator=(const *iterator*&) = delete; *iterator*& operator=(*iterator*&&) = default; *iterator*& operator++(); void operator++(int);
|
||
|
||
Val& operator*() const; friend bool operator==(const *iterator*& x, default_sentinel_t); private: basic_istream_view* *parent_*; // *exposition only*};}
|
||
|
||
[ð](#lib:basic_istream_view::iterator,constructor)
|
||
|
||
`constexpr explicit iterator(basic_istream_view& parent) noexcept;
|
||
`
|
||
|
||
[1](#1)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L4120)
|
||
|
||
*Effects*: Initializes *parent_* with addressof(parent)[.](#1.sentence-1)
|
||
|
||
[ð](#lib:operator++,basic_istream_view::iterator)
|
||
|
||
`iterator& operator++();
|
||
`
|
||
|
||
[2](#2)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L4131)
|
||
|
||
*Effects*: Equivalent to:**parent_*->*stream_* >> *parent_*->*value_*;return *this;
|
||
|
||
[ð](#lib:operator++,basic_istream_view::iterator_)
|
||
|
||
`void operator++(int);
|
||
`
|
||
|
||
[3](#3)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L4146)
|
||
|
||
*Effects*: Equivalent to ++*this[.](#3.sentence-1)
|
||
|
||
[ð](#lib:operator*,basic_istream_view::iterator)
|
||
|
||
`Val& operator*() const;
|
||
`
|
||
|
||
[4](#4)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L4157)
|
||
|
||
*Effects*: Equivalent to: return *parent_*->*value_*;
|
||
|
||
[ð](#lib:operator==,basic_istream_view::iterator)
|
||
|
||
`friend bool operator==(const iterator& x, default_sentinel_t);
|
||
`
|
||
|
||
[5](#5)
|
||
|
||
[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/ranges.tex#L4168)
|
||
|
||
*Effects*: Equivalent to: return !*x.*parent_*->*stream_*;
|