Large file iostreams

Pétur Runólfsson peturr02@ru.is
Mon Sep 1 09:42:00 GMT 2003


Martin Sebor wrote:
> > 27.4.3.1 p2: The initial value of state() is not specified.
> 
> That's not necessarily a defect, is it?

Probably not, it's just annoying.

> The default ctor is
> unspecified, so if stateT is a POD, the initial value of a
> default-constructed fpos object is also unspecified.

This doesn't just apply to the default constructor - also to the
conversions from streamoff and int.

> > 27.4.3.2 p1: The sentence "Operations specified in Table 88 are
> permitted."
> > is ambiguous. It's not clear if this means "Users are permitted to use
> > the operations in table 88" or "Implementations are permitted to provide
> > the operations in table 88".
> 
> It could probably be worded better but the intent is clear from
> the note below the table:

There have been a number of DRs that fix bad wording (364 for example).

>      [Note: Every implementation is required to supply overloaded
>      operators on fpos objects to satisfy the requirements of 27.4.3.2.

Why would anybody add a note like that if the normative wording were
already clear?

> > 27.4.3.2: The operations q = p + o, p += o, q = p - o, p -= o, o = p - q
> > are specified on objects of type fpos and streamoff. Objects of type
> > const fpos and const streamoff should also be allowed on the right hand
> > side.
> 
> What about volatile? Or const volatile? ;-)

Probably not, most operators and functions in the standard take their
arguments by const non-volatile reference or by value.

This seems to be a problem in clause 23 as well - the container
requirements don't seem to require that size() and empty() can be
applied to const objects.

> > 27.4.3.2: The return value of state() on the objects returned by q = p +
> o,
> > p += o, q = p - o and p -= o is not specified.
> 
> But what should the value be? It's perfectly fine to increment
> a position into a stream operating on a subsequence encoded in
> a fixed-width encoding but the effects are undefined otherwise.

The effects are always undefined.

Regards,
Petur



More information about the Libstdc++ mailing list