This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: seek bug in stringstream?
- To: Benjamin Kosnik <bkoz at cygnus dot com>
- Subject: Re: seek bug in stringstream?
- From: larsbj at lyx dot org (Lars Gullik Bjønnes)
- Date: 26 Mar 2000 03:02:21 +0200
- Cc: libstdc++ at sourceware dot cygnus dot com
- References: <200003251915.LAA00945@haight.constant.com>
> Take a look at 27.7.1.3, in particular the bits about seekoff.
ok.
quote from standard:
> p 11: "for a sequence to be positioned, if it's next pointer is a
null
> pinter the position operation fails."
ok.
Addon by you:
> This is effectively true for a
>stringstream object that is constructed by default, ie, all that have
>_M_buf_size == 0.
This is what I fail to see.
(and I don't know what "effectively true" means)
Do we agree that the values of _M_in_* is not relevant in this case
(tellp) ?
(if not _what_ are their relevance?)
And that only _M_out_* matter?
_M_base is _M_string.data() // not null 21.3.6.3
_M_out_beg is set to _M_base
_M_out_cur is set to _M_base
_M_out_end is set to _M_base
You probably have to spoonfeed this to me, because I cannot see how
this
demands that the return value of tellp should be -1.
Next operation on the ostringstream will obviously not fail directly
so it
has to be seekoff that returns -1. And in the current implementation
seekoff
returns -1 _only_ because _M_buf_size == 0, it seems.
The standard does not require a return value of -1 for a
"stringstream object that is constructed by default" so this is then a
decision of the implementation which I think is not valid.
Lgb