Topic: Defect report: basic_stringbuf::seekoff semantics
Author: Ray Lischner <dontspamme@spam.you>
Date: 14 Aug 2002 20:09:01 GMT Raw View
[moderator's note: Forwarded to C++ committee. -sdc]
In Section 27.7.1.3 [lib.stringbuf.virtuals], Table 90, the implication is
that the four conditions should be mutually exclusive, but they are not.
The first two cases, as written, are subcases of the third. I think it
would be clearer if the conditions were rewritten as follows:
(which & (ios_base::in|ios_base::out)) == ios_base::in
(which & (ios_base::in|ios_base::out)) == ios_base::out
(which & (ios_base::in|ios_base::out)) == (ios_base::in|ios_base::out)
and way == either ios_base::beg or ios_base::end
Otherwise
As written, it is unclear what should be the result if cases 1 & 2 are true,
but case 3 is false, e.g.,
seekoff(0, ios_base::cur, ios_base::in | ios_base::out)
--
Ray Lischner, author of C++ in a Nutshell (forthcoming)
http://www.tempest-sw.com/cpp/
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.jamesd.demon.co.uk/csc/faq.html ]