This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [libstdc++ PATCH] Reminder: PR 3955
- From: Benjamin Kosnik <bkoz at redhat dot com>
- To: Phil Edwards <phil at jaj dot com>
- Cc: Craig Rodrigues <rodrigc at attbi dot com>, libstdc++ at gcc dot gnu dot org
- Date: Fri, 1 Mar 2002 17:46:40 -0800 (PST)
- Subject: 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;
}