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: ostringstream buffers



Nathan Myers wrote:
+ > + >           ostringstream  o;
+ > + >           o << stuff << more stuff << stuff << ends;
+ > + >           return o.str();
+ > +
+ > + ... even if it seems to have been overlooked in the standard?
+ 
+ What is this thread about?  Of course stringbuf is supposed to
+ extend its buffer when you put more text into it.  If it doesn't,
+ that's just a bug.

One would think so.  'Course, I've made a number of "this is obvious"
statements that were roundly refuted because of interesting Standard
interpretations, so I don't take chances anymore.  :-)

(For example, I just re-discovered that -O2 -finline-functions are not
happy arguments to use with <iostream>.  It's a funny old world.)

At any rate, my message never made it onto comp.std.c++, because I
suspect my newsserver is a FPOS.  Oh well.


So, what's the consensus?  My take is that std_stringbuf should just
feed a few more operations to string and not try to worry about buffer 
sizes as much as it is doing.  There's a lot of general management stuff
inherited from std_streambuf that seems to defeat the work that could
be done by string.  (But for all I know, this may be in the middle of
changes already.)


Phil
(If you reply to the list, please don't cc another copy to me.  Thanks.)

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