Update doxygen for istream::tellg() to reflect PR/26211?
Paolo Carlini
paolo.carlini@oracle.com
Thu Apr 14 23:03:00 GMT 2011
Hi,
> Hey, all.
>
> I recently started using gcc-4.6.0 and it seems that the behaviour of
> std::istream::tellg() has changed when (just) the eofbit is set. I
> managed to track this down to PR/26211, and I'm not debating the
> changes.
>
> It took me a while to figure out what was wrong because the doxygen
> for tellg() says:
>
> If fail() is not false, returns pos_type(-1) to indicate
> failure. Otherwise returns rdbuf()->pubseekoff(0,cur,in).
>
> That's almost word for word what Langer and Kreft says, so I'm
> presuming DR60's change to 27.6.1.3 paragraph 37 has lead to this
> change in libstdc++ behaviour.
>
> Should the libstdc++ doxygen be updated to say something about the
> fact that calling tellg() when eof() will also return pos_type(-1)
> (because of the fact that it constructs a sentry)? Are there other
> functions that also should have updated documentation as a result of
> DR60?
Actually as a result of DR 60 + the outcome of comments US 137 / US 139
per N3168 (and also note that something went slightly wrong when the
latter has been applied to the Working Paper, thus the sentence about
clearing eofbit is missing from 27.7.1.3/43, describing the second seekp
overload). Anyway, in summary, if the Doxygen comments have to be
consistent, I'm proposing to apply the below, touching the comments of
tellg and the two seekg overloads. I mean to apply it tomorrow barring
other ideas...
Paolo.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: d
URL: <http://gcc.gnu.org/pipermail/libstdc++/attachments/20110414/66df546b/attachment.ksh>
More information about the Libstdc++
mailing list