|
[
Permlink
| « Hide
]
Martin Sebor added a comment - 29/Aug/07 09:54 PM
Scheduled for 4.2.1.
This affects all released versions.
The problem is that operator==(istream_iterator<>&, istream_iterator<>&) calls basic_istream::operator!(), but basic_istream::operator!() is defined in <istream> header file.
So <istream> should be included in rw/_streamiter.h. The similar problem in I'm not sure #including all of <istream> in <iterator> is a good idea. But see
We could change the operator==(istream_iterator<>&, istream_iterator<>&) to just compare the pointers _C_strm, but anyway the basic_istream::operator!(), is used in istream_iterator::operator++() and the following example also would fail:
#include <iterator>
int main ()
{
std::istream_iterator<char, char> i;
++i;
i++;
}
The Dinkumware STL doesn't #includes <istream> in <iterator> and the example with incrementing of the iterator is also fail to compile (the example with operator==() doesn't fail because operator==() implementation compares the pointers only).
The STLport #includes basic_istream definitions before definitions of the istream_iterator. I've been working on
Fundamentally, this is LWG issue 343 Reassigning to self since this depends on
The original issue has been fixed – see the patch committed in r618883
The original test case has been committed to our regression test suite in r619099 The test case from Farid's comment above still doesn't compile but since that one has undefined behavior I'm not concerned. Merged in 4.2.x branch thus: http://svn.apache.org/viewvc?view=rev&revision=648752
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||