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)



> + There are two ctors for [io]stringstreams: one requires a string (which is
> + cloned and used as the internal buffer) and one defaults to a null string.
> + I believe this is exactly as the standard specifies. 
> 
> The behavior (including the changes from yesterday) is thus:
> 
> (with-string ctor)
>    - The length of the initial string determines the maximum size of the
>      buffer.  Inserting additional chars (with <<) only uses that much of
>      the string.  Subsequent insertions fail (more below).
>    - The contents of the initial string don't matter.  Stroustrup mentions
>      this on his "open issues" web page; that in order to append to the
>      initial string, one must create the ostringstream with ios_base::ate.
>      At the moment, this has no effect in v3; the initial string's contents
>      are /always/ overwritten.  (His intentions were for ios_base::ate to
>      be unnecessary and understood).

I'll look into this, thanks for the example.

> So far I haven't been able to get a testsuite-style program to work with
> mkcheck.  I write small testbeds, but I always have to just run them
> manually
> and look at the output.

Just write some foo.cc file, and stick it in
libstdc++/testsuite/27_io/foo.cc

then, go to your build directory and type

"make check"

or, if you have things installed, type

"make check-install"

It's a lot easier to run the testsuite now and I suggest everybody check
it out. Results wil be in

/build_directory/testsuite/990527-mkcheck.txt

-Benjamin


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