Title
app for string streams
Status
nad
Section
[stringstream.cons]
Submitter
Nicolai Josuttis

Created on 2012-01-15.00:00:00 last changed 78 months ago

Messages

Date: 2018-06-07.21:31:22

[ 2018-06; Rapperswil Wednesday evening ]

MC: shouldn't this be Open?
BO: I think we changed it to do the same thing as gcc
JM: NAD - gcc is right
ACTION close as NAD, noting that gcc is right

Date: 2012-01-15.00:00:00

This issue was raised while discussing issue 1448.

Note the following program:

string s("s1: 123456789");
ostringstream s1(s, ios_base::out|ios_base::app);
s1 << "hello";
cout << s1.str() << endl;

With g++4.x it prints:

s1: 123456789hello

With VisualC++10 it prints:

hello23456789

From my intuitive understanding the flag "app" should result in the output of g++4.x. I also would read that from [ios::openmode] claiming:

app   seek to end before each write

However in issue 1448 P.J.Plauger comments:

I think we should say nothing special about app at construction time (thus leaving the write pointer at the beginning of the buffer). Leave implementers wiggle room to ensure subsequent append writes as they see fit, but don't change existing rules for initial seek position.

Note that the flag ate on both platforms appends "hello" to s.

History
Date User Action Args
2018-06-07 21:31:22adminsetmessages: + msg9877
2018-06-07 21:31:22adminsetstatus: new -> nad
2012-01-15 00:00:00admincreate