This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
RE: [RFC] libstdc++/14252, aka ++streamoff
- From: Pétur Runólfsson <peturr02 at ru dot is>
- To: "Paolo Carlini" <pcarlini at suse dot de>,"libstdc++" <libstdc++ at gcc dot gnu dot org>
- Date: Wed, 25 Feb 2004 10:48:15 -0000
- Subject: RE: [RFC] libstdc++/14252, aka ++streamoff
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