This is the mail archive of the
libstdc++@sourceware.cygnus.com
mailing list for the libstdc++ project.
ostringstream stdlibc++-2.90.8pre1
- To: libstdc++ at sourceware dot cygnus dot com
- Subject: ostringstream stdlibc++-2.90.8pre1
- From: Bill Thompson <billt at toast dot net>
- Date: Wed, 15 Mar 2000 01:42:42 -0500
I don't know if I'm hacking around where I'm not supposed to
but here it goes...... It's a small change to such great work
you guys are doing, probably a typo at that :).
//-Problem-------------------------------------------------------
#include <iostream>
#include <sstream>
int main()
{
std::ostringstream Bill("Some Day Will Come");
std::cout << Bill.str() << std::endl; // OK "not"
Bill << " Tomorrow"; // overwrites first part of buffer ?
std::cout << Bill.str() << std::endl;
Bill << " Won't"; // appends to second string ?
std::cout << Bill.str();
}
//-------------------------------------------------------------
std_sstream.h changed the following noted below
void
_M_init_stringbuf(ios_base::openmode __mode)
{
_M_buf_size = _M_string.size();
_M_mode = __mode;
_M_really_sync(0,_M_buf_size); // <--changed here Bill T
}