[istream.iterator.ops]

# 24 Iterators library [[iterators]](./#iterators)

## 24.6 Stream iterators [[stream.iterators]](stream.iterators#istream.iterator.ops)

### 24.6.2 Class template istream_iterator [[istream.iterator]](istream.iterator#ops)

#### 24.6.2.3 Operations [istream.iterator.ops]

[ð](#lib:operator*,istream_iterator)

`const T& operator*() const;
`

[1](#1)

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

*Preconditions*: in_stream != nullptr is true[.](#1.sentence-1)

[2](#2)

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

*Returns*: value[.](#2.sentence-1)

[ð](#lib:operator-%3e,istream_iterator)

`const T* operator->() const;
`

[3](#3)

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

*Preconditions*: in_stream != nullptr is true[.](#3.sentence-1)

[4](#4)

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

*Returns*: addressof(value)[.](#4.sentence-1)

[ð](#lib:operator++,istream_iterator)

`istream_iterator& operator++();
`

[5](#5)

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

*Preconditions*: in_stream != nullptr is true[.](#5.sentence-1)

[6](#6)

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

*Effects*: Equivalent to:if (!(*in_stream >> value)) in_stream = nullptr;

[7](#7)

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

*Returns*: *this[.](#7.sentence-1)

[ð](#lib:operator++,istream_iterator_)

`istream_iterator operator++(int);
`

[8](#8)

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

*Preconditions*: in_stream != nullptr is true[.](#8.sentence-1)

[9](#9)

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

*Effects*: Equivalent to:istream_iterator tmp = *this;++*this;return tmp;

[ð](#lib:operator==,istream_iterator)

`template<class T, class charT, class traits, class Distance>
  bool operator==(const istream_iterator<T,charT,traits,Distance>& x,
                  const istream_iterator<T,charT,traits,Distance>& y);
`

[10](#10)

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

*Returns*: x.in_stream == y.in_stream[.](#10.sentence-1)

[ð](#lib:operator==,istream_iterator_)

`friend bool operator==(const istream_iterator& i, default_sentinel_t);
`

[11](#11)

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

*Returns*: !i.in_stream[.](#11.sentence-1)
