Title
Bad efficiency of overflow() mandated
Status
tc1
Section
[stringbuf.virtuals]
Submitter
Dietmar Kühl

Created on 1999-07-20.00:00:00 last changed 164 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

In [stringbuf.virtuals] paragraph 8, Notes, insert the words "at least" as in the following:

To make a write position available, the function reallocates (or initially allocates) an array object with a sufficient number of elements to hold the current array object (if any), plus at least one additional write position.

Date: 1999-07-20.00:00:00

Paragraph 8, Notes, of this section seems to mandate an extremely inefficient way of buffer handling for basic_stringbuf, especially in view of the restriction that basic_ostream member functions are not allowed to use xsputn() (see [ostream]): For each character to be inserted, a new buffer is to be created.

Of course, the resolution below requires some handling of simultaneous input and output since it is no longer possible to update egptr() whenever epptr() is changed. A possible solution is to handle this in underflow().

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg1740
1999-07-20 00:00:00admincreate