Title
Contradictory results of stringbuf initialization.
Status
cd1
Section
[stringbuf.cons]
Submitter
Dietmar Kühl

Created on 2000-05-11.00:00:00 last changed 172 months ago

Messages

Date: 2010-10-21.18:28:33

Rationale:

We could fix 27.7.1.1 paragraph 4, but there would be no point. If we fixed it, it would say just the same thing as text that's already in the standard.

Date: 2010-10-21.18:28:33

Proposed resolution:

Remove 27.7.1.1 paragraph 4.

Date: 2000-05-11.00:00:00

In 27.7.1.1 paragraph 4 the results of calling the constructor of 'basic_stringbuf' are said to be str() == str. This is fine that far but consider this code:

  std::basic_stringbuf<char> sbuf("hello, world", std::ios_base::openmode(0));
  std::cout << "'" << sbuf.str() << "'\n";

Paragraph 3 of 27.7.1.1 basically says that in this case neither the output sequence nor the input sequence is initialized and paragraph 2 of 27.7.1.2 basically says that str() either returns the input or the output sequence. None of them is initialized, ie. both are empty, in which case the return from str() is defined to be basic_string<cT>().

However, probably only test cases in some testsuites will detect this "problem"...

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1969
2010-10-21 18:28:33adminsetmessages: + msg1968
2000-05-11 00:00:00admincreate