std::istream_iterator<T,CharT,Traits,Distance>::operator++, operator++(int)

Reads a value from the underlying stream (using its operator») and stores it into the iterator object. If the read fails (the underlying stream’s fail() returns true), the iterator becomes the end-of-stream iterator.

# Declarations

istream_iterator& operator++();
istream_iterator operator++( int );

# Defect reports

DRApplied toBehavior as publishedCorrect behavior
LWG 260C++98the return type of operator++(int) was istream_iterator&corrected to istream_iterator
LWG 788C++98the underlying stream’s operator void* wasused to determine whether the read fails, but itwas removed by the resolution of LWG issue 468uses fail() instead
LWG 838C++98it was unclear whether end-of-stream iterators can be incrementedthe behavior is undefined