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]

Re: aug-2001 libstdc++ outstanding


On Tue, Sep 04, 2001 at 11:10:51AM -0700, Nathan Myers wrote:
> On Tue, Sep 04, 2001 at 10:41:26AM -0700, Benjamin Kosnik wrote:
> > I'm pretty sure that this patch is wrong. I remember talking to Nathan 
> > about this when I first started on the stringstream code, and distinctly 
> > remember the current behavior as being what was intended. (I believe 
> > other vendors also implement similar semantics.)
> 
> The initial position has been discussed a couple of times in the 
> Library Working Group.

Are we talking about the same thing?  I'm not suggesting changing the
initial position in the default case.  Weird as it may be, it's what the
standard says.


> I don't recall any discussion about openmode == app behavior.
> It seems to me that it would imply that the pointer starts in
> the standard place, but jumps to the end if you do a write, but
> I haven't scoured the standard recently.

That is what I'm proposing, more or less.  The standard doesn't address app
or ate in the case of ostringbuf.  We start at the end in the ate case,
but not in the app case.  The patch would make us start at the end in
the app case as well.

Currently, the user can specify "append" but we still overwrite from
the beginning.  /That/ just seems outright wrong.

With this patch, the "nonintuitive" behavior can become a lot easier to
deal with, because we can advise users, "if you give an initial string,
and you want to append to it, you must also pass app as the openmode."
That makes sense.  Right now it's untrue.


Phil

-- 
Would I had phrases that are not known, utterances that are strange, in
new language that has not been used, free from repetition, not an utterance
which has grown stale, which men of old have spoken.
                                     - anonymous Egyptian scribe, c.1700 BC


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