[RFC] libstdc++/14252, aka ++streamoff
Pétur Runólfsson
peturr02@ru.is
Wed Feb 25 11:14:00 GMT 2004
Paolo Carlini wrote:
> this is an interesting bug.
Yes :-(
> Now, for an istreambuf_iterator, difference_type is _Traits::off_type
> and the latter is by default streamoff. In positypes.h we promised to
> provide:
I completely missed this one when I wrote streamoff :-( Thanks for
pointing this out.
> It seems to me that, since difference_type is modeled after ptrdiff_t,
> an user of the type is supposed to have available those operators (besides
> += and -= which are already there, I mean).
In fact the standard requires that difference_type provides those
operators [24.1]:
For every iterator type X for which equality is defined, there is a
corresponding signed integral type called the difference type of the
iterator.
Bummer.
The "good" news is that this seems like a defect: It not only forbids
large file support on systems with 32-bit long, it forbids *any*
iterator range that contains more than LONG_MAX elements.
Regards,
Petur
More information about the Libstdc++
mailing list