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
Mark Brown made changes - 03/Nov/07 04:11 PM
Field Original Value New Value
Patch Info [Patch Available]
Martin Sebor made changes - 19/Nov/07 05:55 AM
Link This issue blocks STDCXX-321 [ STDCXX-321 ]
Martin Sebor made changes - 01/Feb/08 05:07 PM
Assignee Martin Sebor [ sebor ]
Martin Sebor made changes - 06/Feb/08 04:22 AM
Description 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));
}
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:

{code}
#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));
}
{code}
Fix Version/s 4.2.1 [ 12312690 ]
Remaining Estimate 2h [ 7200 ]
Original Estimate 2h [ 7200 ]
Martin Sebor made changes - 06/Feb/08 04:22 AM
Patch Info [Patch Available]
Martin Sebor made changes - 06/Feb/08 04:36 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Martin Sebor made changes - 06/Feb/08 04:38 AM
Time Spent 4h [ 14400 ]
Remaining Estimate 2h [ 7200 ] 0h [ 0 ]
Martin Sebor made changes - 06/Feb/08 04:39 AM
Time Spent 4h [ 14400 ] 6h [ 21600 ]
Martin Sebor made changes - 06/Feb/08 04:42 AM
Attachment c++std-lib-20221.eml [ 12374841 ]
Martin Sebor made changes - 06/Feb/08 10:56 PM
Status Resolved [ 5 ] Reopened [ 4 ]
Resolution Fixed [ 1 ]
Martin Sebor made changes - 07/Feb/08 12:20 AM
Time Spent 6h [ 21600 ] 8h [ 28800 ]
Martin Sebor made changes - 07/Feb/08 12:21 AM
Resolution Fixed [ 1 ]
Status Reopened [ 4 ] Resolved [ 5 ]
Martin Sebor made changes - 22/Apr/08 03:55 AM
Status Resolved [ 5 ] Closed [ 6 ]