seekg and failbit

35 views
Skip to first unread message

Jean-Marc Bourguet

unread,
Feb 26, 2015, 2:22:58 PM2/26/15
to std-dis...@isocpp.org
Hi all,

basic_istream::seekg has two versions, one taking a pos_type, the other taking a off_type and a seekdir.

The first is defined to clear the eofbit before constructing the sentry. The second isn't.  Does someone knows
why?

AFAIK, the discrepancy has been added when fixing library issue 60, which refers to n1219. But if I've missed the rationale
for the difference if it was present at one of those places.

Yours,

--
Jean-Marc

Bo Persson

unread,
Feb 26, 2015, 4:13:39 PM2/26/15
to std-dis...@isocpp.org
A likely reason is that the change was applied only once, instead of for
both versions of seekg.

There is a new library issue #2244 proposing that this should be fixed:

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-active.html#2244


Bo Persson



Jean-Marc Bourguet

unread,
Feb 27, 2015, 4:33:09 AM2/27/15
to std-dis...@isocpp.org, b...@gmb.dk


Le jeudi 26 février 2015 22:13:39 UTC+1, Bo Persson a écrit :
On 2015-02-26 20:22, Jean-Marc Bourguet wrote:
> Hi all,
>
> basic_istream::seekg has two versions, one taking a pos_type, the other
> taking a off_type and a seekdir.
>
> The first is defined to clear the eofbit before constructing the sentry.
> The second isn't.  Does someone knows
> why?
>
> AFAIK, the discrepancy has been added when fixing library issue 60,
> which refers to n1219. But if I've missed the rationale
> for the difference if it was present at one of those places.
>

A likely reason is that the change was applied only once, instead of for
both versions of seekg.

There is a new library issue #2244 proposing that this should be fixed:

Thanks.  I looked for a rationale and forgot to look if somebody else had brought it up as an issue.

-- 
Jean-Marc
Reply all
Reply to author
Forward
0 new messages