This is the mail archive of the libstdc++@sourceware.cygnus.com mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: seek bug in stringstream?



        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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]