Title
basic_stringbuf::seekoff need not always fail for an empty stream
Status
cd1
Section
[stringbuf.virtuals]
Submitter
Bill Plauger

Created on 2004-01-30.00:00:00 last changed 171 months ago

Messages

Date: 2010-10-21.18:28:33

Proposed resolution:

Change the sentence from:

For a sequence to be positioned, if its next pointer (either gptr() or pptr()) is a null pointer, the positioning operation fails.

to:

For a sequence to be positioned, if its next pointer (either gptr() or pptr()) is a null pointer and the new offset newoff is nonzero, the positioning operation fails.

Date: 2010-10-21.18:28:33

[ Sydney: Agreed that this is an annoying problem: seeking to zero should be legal. Bill will provide wording. ]

Date: 2004-01-30.00:00:00
  pos_type basic_stringbuf::seekoff(off_type, ios_base::seekdir,
                                    ios_base::openmode);

is obliged to fail if nothing has been inserted into the stream. This is unnecessary and undesirable. It should be permissible to seek to an effective offset of zero.

History
Date User Action Args
2010-10-21 18:28:33adminsetmessages: + msg2684
2010-10-21 18:28:33adminsetmessages: + msg2683
2004-01-30 00:00:00admincreate