incubator-stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Sebor (JIRA)" <j...@apache.org>
Subject [jira] Closed: (STDCXX-230) arithmetic extractors affect gcount()
Date Tue, 06 Feb 2007 02:32:05 GMT

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

Martin Sebor closed STDCXX-230.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 4.2

Fixed by the referenced patch. Exercised by the 27.istream.fmat.arith.cpp test:
http://svn.apache.org/repos/asf/incubator/stdcxx/trunk/tests/iostream/27.istream.fmat.arith.cpp

> arithmetic extractors affect gcount()
> -------------------------------------
>
>                 Key: STDCXX-230
>                 URL: https://issues.apache.org/jira/browse/STDCXX-230
>             Project: C++ Standard Library
>          Issue Type: Bug
>          Components: 27. Input/Output
>    Affects Versions: 4.1.3, 4.1.2
>         Environment: all
>            Reporter: Martin Sebor
>         Assigned To: Martin Sebor
>             Fix For: 4.2
>
>
> Moved from the Rogue Wave bug tracking database:
> ****Created By: pedretti @ Apr 18, 2001 03:51:32 PM****
> basic_istream<>::gcount() is not ignoring characters consumed in formatted extraction
operations. 
> [ example program: ]
> #include <sstream>
> #include <iostream>
> using namespace std;
> int main () {
>     stringstream ss;
>     string s;
>     int i;
>     char c;
>     
>     ss << "12345 5678 hello world" << ends;
>     cout << "gcount() before extraction : " << ss.gcount() << endl;
>     ss >> i;
>     cout << "gcount() after formatted extraction of int: "
>          << ss.gcount() << endl;
>     ss >> i;
>     cout << "gcount() after 2nd formatted extraction of int: "
>          << ss.gcount() << endl;
>     
>     ss >> s;
>     cout << "gcount() after formatted extraction of string: " << ss.gcount()
<< endl;
>     
>     while (ss) {
>         ss >> c;
>         cout << "gcount() after formatted  extraction of char: " << ss.gcount()
<< endl;
>         
>     }
> }
> [output:]
> gcount() before extraction : 0
> gcount() after formatted extraction of int: 0
> gcount() after 2nd formatted extraction of int: 1
> gcount() after formatted extraction of string: 1
> gcount() after formatted extraction of char: 2
> gcount() after formatted extraction of char: 1
> gcount() after formatted extraction of char: 1
> gcount() after formatted extraction of char: 1
> gcount() after formatted extraction of char: 1
> gcount() after formatted extraction of char: 1
> gcount() after formatted extraction of char: 0

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