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 (was Re: stringstream status)


"Edwards, Phil" wrote:
> 
> + Well, could we please go with the sane:
> +
> + >           ostringstream  o;
> + >           o << stuff << more stuff << stuff << ends;
> + >           return o.str();
> +
> + ... even if it seems to have been overlooked in the standard?
> 
> Let me toss out an idea:  I'll post this problem to comp.std.c++ and
> we'll get some feedback before anything gets decided?  The more I think
> about it, the more I become convinced that Stroustrup's example above
> is the sane way to go -- which makes me wonder even more what was the
> rationale behind the committee's decision (i.e., what am I missing).
> 
> Phil
> "...the road to good intentions must always be paved with hell."
>      - Igor Stravinsky

I've implemented stringbuf, and the way I read it is
that the first time overflow is called, a string (or
some buffer) should be allocated in the stringbuf.
See 27.7.1.3/8.  Also the example at 22.2.8/9 sure
seems to imply this behavior.



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