[Bug libstdc++/14174] New: bug and workaround for stringstream tellg and operator>>
bugzilla dot 20 dot kuhfladen at spamgourmet dot com
gcc-bugzilla@gcc.gnu.org
Tue Feb 17 13:10:00 GMT 2004
There seems to be a bug in stringstream. Consider the following code segment.
It yields:
abc
xyz
But should yield:
abc
bc
The workaround is to add a white space to "abc", i.e.: s << "abc ".
Regards
Uwe Sassenberg
Science-D-Visions
--------------------------8<--------------------------
std::stringstream s;
std::string a;
s << "abc";
// here it works
s >> a;
std::cout << a << std::endl;
// set get-position to character 'b' in "abc"
s.seekg(1);
// put some other content into a
a = "xyz";
// here it doesn't work
s >> a;
std::cout << a << std::endl;
--------------------------8<--------------------------
--
Summary: bug and workaround for stringstream tellg and operator>>
Product: gcc
Version: 3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: bugzilla dot 20 dot kuhfladen at spamgourmet dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14174
More information about the Gcc-bugs
mailing list