This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
Re: ostringstream buffers (was Re: stringstream status)
- To: "Edwards, Phil" <pedwards@ball.com>
- Subject: Re: ostringstream buffers (was Re: stringstream status)
- From: Jim Gewin <jgewin@worldnet.att.net>
- Date: Thu, 27 May 1999 19:38:09 -0400
- CC: "Lib3 (E-mail)" <libstdc++@sourceware.cygnus.com>
- References: <B7A6155A71B6D211BB2D0008C7B250B70906B7@daytonmsg.ball.com>
- Reply-To: jgewin@worldnet.att.net
"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.