This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: seek bug in stringstream?
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: Re: seek bug in stringstream?
- From: Benjamin Kosnik <bkoz at cygnus dot com>
- Date: Sat, 25 Mar 2000 11:15:16 -0800
ostringstream ost;
cout << ost.tellp() << endl;
Take a look at 27.7.1.3, in particular the bits about seekoff.
p 11: "for a sequence to be positioned, if it's next pointer is a null
pinter the position operation fails." This is effectively true for a
stringstream object that is constructed by default, ie, all that have
_M_buf_size == 0.
p 13: "if the position operation fails, ..., the object stores an
invalid stream position"
27.4.3.2 fpos requirements, p 2
"stream operations that return a value of traits::pos_type return
P(O(-1)) as an invalid value to signal an error."
Nathan, your patch looks fine. Thanks!
-benjamin