This is the mail archive of the libstdc++@gcc.gnu.org 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]
Other format: [Raw text]

Re: [v3] PR 10975


Paolo Carlini writes:
 > Ok, now I see: basically, from the implementation point of view, the body of
 > basic_stringbuf::seekoff() doesn't need to be protected from capacity() 
 > == 0,
 > because it's already able to deal with that case: seeking to pos_type(0)
 > succeeds, seeking to pos_type(0) automatically fails, as should be. And in
 > this way we are consistent with basic_filebuf. Good.
 > 
 > Now, one remaining doubt: what about basic_stringbuf::seekpos? Shouldn't we
 > remove the check on _M_string.capacity() from there too?

Actually, my patch fixes seekpos as well :-)

Given that stringstreams don't provide a direct interface ala open()
to explicitly set the buffer string after construction would be an
argument to me that stringstreams should always be considered open.

And given that the standard is ambiguous about it at the moment, why
not push towards a more sensible solution?

Jerry


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