You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stdcxx.apache.org by "Mark Brown (JIRA)" <ji...@apache.org> on 2007/02/02 21:46:05 UTC

[jira] Created: (STDCXX-332) ostringstream::tellp() returns -1 when the stream is empty

ostringstream::tellp() returns -1 when the stream is empty
----------------------------------------------------------

                 Key: STDCXX-332
                 URL: https://issues.apache.org/jira/browse/STDCXX-332
             Project: C++ Standard Library
          Issue Type: Bug
          Components: 27. Input/Output
    Affects Versions: 4.1.3
            Reporter: Mark Brown


When I call tellp() on an empty stringstream I get -1 instead of 0.

#include <cassert>
#include <sstream>

main()
{
    std::ostringstream out;
    std::ios::pos_type pos = out .tellp () ;

    assert (pos == 0);

    return 0;
}

test: test.cpp:9: int main(): Assertion `pos == 0' failed.
Aborted


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


[jira] Commented: (STDCXX-332) ostringstream::tellp() returns -1 when the stream is empty

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/STDCXX-332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12469903 ] 

Martin Sebor commented on STDCXX-332:
-------------------------------------

Looks like this is caused by the fact that we don't yet implement the accepted resolution of LWG issue 453 (now in DR status): http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#453

> ostringstream::tellp() returns -1 when the stream is empty
> ----------------------------------------------------------
>
>                 Key: STDCXX-332
>                 URL: https://issues.apache.org/jira/browse/STDCXX-332
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 27. Input/Output
>    Affects Versions: 4.1.3
>            Reporter: Mark Brown
>
> When I call tellp() on an empty stringstream I get -1 instead of 0.
> #include <cassert>
> #include <sstream>
> main()
> {
>     std::ostringstream out;
>     std::ios::pos_type pos = out .tellp () ;
>     assert (pos == 0);
>     return 0;
> }
> test: test.cpp:9: int main(): Assertion `pos == 0' failed.
> Aborted

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


[jira] Updated: (STDCXX-332) [LWG #453] ostringstream::tellp() returns -1 when the stream is empty

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor updated STDCXX-332:
--------------------------------

    Summary: [LWG #453] ostringstream::tellp() returns -1 when the stream is empty  (was: ostringstream::tellp() returns -1 when the stream is empty)

> [LWG #453] ostringstream::tellp() returns -1 when the stream is empty
> ---------------------------------------------------------------------
>
>                 Key: STDCXX-332
>                 URL: https://issues.apache.org/jira/browse/STDCXX-332
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 27. Input/Output
>    Affects Versions: 4.1.3
>            Reporter: Mark Brown
>
> When I call tellp() on an empty stringstream I get -1 instead of 0.
> #include <cassert>
> #include <sstream>
> main()
> {
>     std::ostringstream out;
>     std::ios::pos_type pos = out .tellp () ;
>     assert (pos == 0);
>     return 0;
> }
> test: test.cpp:9: int main(): Assertion `pos == 0' failed.
> Aborted

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


[jira] Closed: (STDCXX-332) [LWG #453] ostringstream::tellp() returns -1 when the stream is empty

Posted by "Martin Sebor (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/STDCXX-332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Martin Sebor closed STDCXX-332.
-------------------------------

    Resolution: Duplicate

Closed as a dupe.

> [LWG #453] ostringstream::tellp() returns -1 when the stream is empty
> ---------------------------------------------------------------------
>
>                 Key: STDCXX-332
>                 URL: https://issues.apache.org/jira/browse/STDCXX-332
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 27. Input/Output
>    Affects Versions: 4.1.3
>            Reporter: Mark Brown
>
> When I call tellp() on an empty stringstream I get -1 instead of 0.
> #include <cassert>
> #include <sstream>
> main()
> {
>     std::ostringstream out;
>     std::ios::pos_type pos = out .tellp () ;
>     assert (pos == 0);
>     return 0;
> }
> test: test.cpp:9: int main(): Assertion `pos == 0' failed.
> Aborted

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