stdcxx-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Updated: (STDCXX-645) stream iterators into different streams compare equal
Date Wed, 06 Feb 2008 04:23:07 GMT

     [ https://issues.apache.org/jira/browse/STDCXX-645?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Martin Sebor updated STDCXX-645:
--------------------------------

           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:

{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}

  was:
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));
} 


         Fix Version/s: 4.2.1
    Remaining Estimate: 2h
     Original Estimate: 2h

Scheduled for 4.2.1, added my initial [under]estimate and enabled code formatting for test
case in Description.

> stream iterators into different streams compare equal
> -----------------------------------------------------
>
>                 Key: STDCXX-645
>                 URL: https://issues.apache.org/jira/browse/STDCXX-645
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 24. Iterators
>    Affects Versions: 4.1.3, 4.2.0
>            Reporter: Mark Brown
>            Assignee: Martin Sebor
>             Fix For: 4.2.1
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> 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}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message