This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]