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]

ostringstream stdlibc++-2.90.8pre1



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
      }

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