This is the mail archive of the libstdc++@gcc.gnu.org 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]
Other format: [Raw text]

Re: [libstdc++ PATCH] Reminder: PR 3955



> The bug is that when an ostringstream is opened in "append" mode, we don't
> append to it, we overwrite from the beginning.  We were/are already checking
> for "at end" but with this patch we'll check for either mode.

Ok. This is cool for mainline and gcc-3_1-branch. I was testing with this, 
which makes it clearer to me, at least:

#include <sstream>

bool test04()
{
  bool test = true;
  
  std::ostringstream os("Maya");
  os << " Ying";
  os << " Lin";
  test = os.str() == " Ying Lin";
  
  return test;
}

bool test05()
{
  bool test = true;
  
  std::ostringstream os("Maya", std::ios::app);
  os << " Ying";
  os << " Lin";
  test = os.str() == "Maya Ying Lin";
  
  return test;
}


int main()
{
  test04();
  test05();
  return 0;
}


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