Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.2.0
-
None
-
All
-
Incorrect Behavior
Description
From http://www.mail-archive.com/user@stdcxx.apache.org/msg00014.html
The test below asserts on i = 513
test.cpp
#include <sstream> #include <string> #include <cassert> int main () { std::ostringstream strm; std::string s; for (size_t i = 1; i <= 1024; ++i) { const char c = char (i); strm << c; s.push_back (c); assert (strm.str () == s); } return 0; }
The test output:
test: test.cpp:14: int main (): Assertion `strm.str () == s' failed. Aborted
Attachments
Issue Links
- is related to
-
STDCXX-515 std::basic_streambuf<>::xsputn() writes characters at the end, but not at the current position if reallocation of internal buffer occurs
- Closed