The behavior of streambuf::seekoff

85 views
Skip to first unread message

Sebastian Karlsson

unread,
Nov 17, 2009, 7:31:35 PM11/17/09
to
It seems like return type of this function is a tad cloudy in the case
where the last parameter is both std::ios_base::out and
std::ios_base::in . To put it simply, is the returned offset the
calculated offset of the in marker or out marker?

--
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std...@netlab.cs.rpi.edu]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html ]

Nach

unread,
Feb 14, 2014, 1:41:44 PM2/14/14
to
According to the C++ 2011 standard (and possibly prior ones as well),
seekoff is supposed to fail when the parameters passed are "cur",
"in|out".

In the case where the parameters passed are "beg" or "end" with
"in|out", the position of both of them are identical, in which case it
does not matter whether it is calculated from in or out.



--
[ comp.std.c++ is moderated. To submit articles, try posting with your ]
[ newsreader. If that fails, use mailto:std-cpp...@vandevoorde.com ]

Daniel Krügler

unread,
Feb 18, 2014, 5:36:06 PM2/18/14
to
Am 14.02.2014 19:41, schrieb Nach:
>
> According to the C++ 2011 standard (and possibly prior ones as well),


Replying to you "possibly" form: The wording that you have quoted
exists basically unmodified since the 1998 C++ Standard.

> seekoff is supposed to fail when the parameters passed are "cur",
> "in|out".
>
> In the case where the parameters passed are "beg" or "end" with
> "in|out", the position of both of them are identical, in which case it
> does not matter whether it is calculated from in or out.


>From what you describe here I'm not sure whether you are just
enumerating facts that you have deduced from the standard or whether
you are pointing to a wording problem.

Would you mind to elaborate a bit further on that, because I seem to
have missed your point?

Thanks & Greetings from Bremen,

Daniel Krügler

nac...@nissuin.org

unread,
Feb 19, 2014, 10:41:20 PM2/19/14
to
>From what you describe here I'm not sure whether you are just
enumerating facts that you have deduced from the standard or whether
you are pointing to a wording problem.

I am explaining to the poster that preceded me (or others looking for
the same information for that matter) that the definition and behavior
is NOT "a tad cloudy", it is actually well defined.

James Kuyper

unread,
Feb 19, 2014, 10:41:34 PM2/19/14
to
On 02/18/2014 05:36 PM, Daniel Krügler wrote:
> Am 14.02.2014 19:41, schrieb Nach:
>>
>> According to the C++ 2011 standard (and possibly prior ones as well),
>
>
> Replying to you "possibly" form: The wording that you have quoted
> exists basically unmodified since the 1998 C++ Standard.
>
>> seekoff is supposed to fail when the parameters passed are "cur",
>> "in|out".
>>
>> In the case where the parameters passed are "beg" or "end" with
>> "in|out", the position of both of them are identical, in which case it
>> does not matter whether it is calculated from in or out.
>
>
>>From what you describe here I'm not sure whether you are just
> enumerating facts that you have deduced from the standard or whether
> you are pointing to a wording problem.
>
> Would you mind to elaborate a bit further on that, because I seem to
> have missed your point?

He's responding to a question that was posted by Sebastian Karlsson on
2009-11-17. I've no idea why he waited nearly four years to do so, but
on the other hand, according to Google groups, no one else answered the
question before him. Also according to Google Groups, that's the only
message that Sebastian ever posted to this newsgroup, so he's unlikely
to still be monitoring it.
Reply all
Reply to author
Forward
0 new messages