stringbuf
seekpos underspecifiedSection: 31.8.2.5 [stringbuf.virtuals] Status: C++11 Submitter: Martin Sebor Opened: 2006-02-23 Last modified: 2016-01-28
Priority: Not Prioritized
View other active issues in [stringbuf.virtuals].
View all other issues in [stringbuf.virtuals].
View all issues with C++11 status.
Discussion:
The effects of the seekpos()
member function of
basic_stringbuf
simply say that the function positions
the input and/or output sequences but fail to spell out exactly
how. This is in contrast to the detail in which seekoff()
is described.
[ 2009-07 Frankfurt ]
Move to Ready.
Proposed resolution:
Change 27.7.1.3, p13 to read:
-13- Effects: Equivalent to
seekoff(off_type(sp), ios_base::beg, which)
.Alters the stream position within the controlled sequences, if possible, to correspond to the stream position stored insp
(as described below).
If(which & ios_base::in) != 0
, positions the input sequence.If(which & ios_base::out) != 0
, positions the output sequence.Ifsp
is an invalid stream position, or if the function positions neither sequence, the positioning operation fails. Ifsp
has not been obtained by a previous successful call to one of the positioning functions (seekoff
,seekpos
,tellg
,tellp
) the effect is undefined.
[
Kona (2007): A pos_type
is a position in a stream by
definition, so there is no ambiguity as to what it means. Proposed
Disposition: NAD
]
[
Post-Kona Martin adds:
I'm afraid I disagree
with the Kona '07 rationale for marking it NAD. The only text
that describes precisely what it means to position the input
or output sequence is in seekoff()
. The seekpos()
Effects
clause is inadequate in comparison and the proposed resolution
plugs the hole by specifying seekpos()
in terms of seekoff()
.
]