Boost logo

Boost :

From: nee Spangenberg (dsp_at_[hidden])
Date: 2004-01-22 05:18:39


Beman Dawes schrieb:

> At 10:41 AM 1/21/2004, Peter Dimov wrote:
>
> >Yes, shared_array can be extended that way. But my point was much
> simpler:
> >you can assert(i >= 0) in operator[](ptrdiff_t i) to catch s[-1], but you
> >can't if i is size_t, and s[-1] still works. :-)
>
> IIRC, that was the rationale given by Bjarne and others for the desire to
> use of a signed type in similar cases. He was complaining about some
> library code that used size_t as an array index, precluding a simple
> assert(i >= 0).

Just jumping in, because this part of the thread remembers me to the
non-compliant signature of operator[] in boost::auto_array, which I
also mentioned in another thread. Has that issue been fixed? (Here the
same arguments for ptrdiff_t apply as for other smart_array classes, which
are not aware of the actual size of the container it hosts)

Greetings,

Daniel


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk