http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59267

--- Comment #2 from James <troomps01 at gmail dot com> ---
If that is the case, then I am also getting interesting behavior in another
place. Once I read a value from the stream, the current location in said stream
should be updated, correct?

With the following program:
#include <iostream>
#include <string>
#include <sstream>

using namespace std;

int main(void)
{
    string s = "3.14159";
    stringstream is(s);
    double val = 0;
    is >> val;
    cout << "Read value " << val << ", number of characters: " <<
is.str().size() << ", input string " << s << ", resultant string: " << is.str()
<< endl;
    if(val == 0)
    {
        cout << "Val is 0" << endl;
    }
    return 0;
}



I am getting the following output:
Read value 3.14159, number of characters: 7, input string 3.14159, resultant
string: 3.14159

Reply via email to