Issue Details (XML | Word | Printable)

Key: STDCXX-645
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Martin Sebor
Reporter: Mark Brown
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

stream iterators into different streams compare equal

Created: 03/Nov/07 04:07 PM   Updated: 22/Apr/08 03:55 AM
Return to search
Component/s: 24. Iterators
Affects Version/s: 4.1.3, 4.2.0
Fix Version/s: 4.2.1

Time Tracking:
Original Estimate: 2h
Original Estimate - 2h
Remaining Estimate: 0h
Time Spent - 8h
Time Spent: 8h
Time Spent - 8h

File Attachments:
  Size
File Licensed for inclusion in ASF works c++std-lib-20221.eml 2008-02-06 04:42 AM Martin Sebor 5 kB
Issue Links:
Dependants
 

Severity: Incorrect Behavior
Resolved: 06/Feb/08 04:36 AM
Resolution Date: 07/Feb/08 12:21 AM


 Description  « Hide
As Travis says in his reply to my post here:
http://www.nabble.com/stream-iterators-into-different-streams-compare-equal--tf4721505.html#a13498487:

Given 24.5.1.1 p1 and p2, it is pretty clear to me that the two iterators are both non-end-of-stream type, and they are both created on different streams. The streams are different, so the iterators should not compare equal. I guess one could claim that 24.5.1.2 p6 conflicts with 24.5 p3 because 'end-of-stream' isn't clearly defined, but in this particular case that doesn't matter.

This program aborts with stdcxx but not with gcc:

#include <assert.h>
#include <iterator>
#include <sstream>

int main ()
{
    std::istringstream a ("1");
    std::istream_iterator<int> i (a);

    std::istringstream b ("2");
    std::istream_iterator<int> j (b);

    assert (!(i == j));
}


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Sebor logged work - 10/Jan/08 07:00 AM
Time Worked: 2h
Worked on a fix and a unit test.
Martin Sebor logged work - 06/Feb/08 12:00 AM
Time Worked: 4h
Spent most of the time writing a test.
Martin Sebor logged work - 07/Feb/08 12:19 AM
Time Worked: 2h
<No comment>