Title
Inconsistent return type of istream_iterator::operator++(int)
Status
cd1
Section
[istream.iterator.ops]
Submitter
Martin Sebor

Created on 2000-08-27.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

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

Date: 2000-08-27.00:00:00

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.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2037
2000-08-27 00:00:00admincreate