This page is a snapshot from the LWG issues list, see the Library Active Issues List for more information and the meaning of CD1 status.

260. Inconsistent return type of istream_iterator::operator++(int)

Section: [istream.iterator.ops] Status: CD1 Submitter: Martin Sebor Opened: 2000-08-27 Last modified: 2016-01-28

Priority: Not Prioritized

View all other issues in [istream.iterator.ops].

View all issues with CD1 status.


The synopsis of istream_iterator::operator++(int) in 24.5.1 shows it as returning the iterator by value., p5 shows the same operator as returning the iterator by reference. That's incorrect given the Effects clause below (since a temporary is returned). The `&' is probably just a typo.

Proposed resolution:

Change the declaration in, p5 from

 istream_iterator<T,charT,traits,Distance>& operator++(int);


 istream_iterator<T,charT,traits,Distance> operator++(int);

(that is, remove the `&').