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: 25.6.2.3 [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.

Discussion:

The synopsis of istream_iterator::operator++(int) in 24.5.1 shows it as returning the iterator by value. 24.5.1.2, 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 24.5.1.2, p5 from

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

to

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

(that is, remove the `&').