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

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

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 `&').