Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-11 09:08:24

----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>
of enabling pointer arithmetic for shared_array somewhat
> questionable, but...
> shared_array in
> can be trivially extended to support it by adding
> shared_array & operator+= (std::ptrdiff_t i)
> {
> px += i;
> return *this;
> }

I dunno; what about the destructor?

> Of course the BOOST_ASSERT(i >= 0); in operator[] will need to be removed.

you can replace it with (lower) bounds checking if the array's base is also
held in the count object. You need something like that in order support
addition anyway.


Boost list run by bdawes at, gregod at, cpdaniel at, john at