Boost logo

Boost :

From: Gavin Collings (gcollings_at_[hidden])
Date: 2000-01-09 11:25:21

jsie-_at_[hidden] wrote:
original article:
> There is a close relative to the array class that is also very
> usefull: an array based on just a pointer to some memory "borrowed"
> from somewhere else, an array_ref class.

It seems like a useful service to provide, but it leaves the
responsibility for construction and destruction of array elements to
derived classes. This is easy for a derived class using a fixed array
anyway, but in general, the derived class would want to just hand over
a chunk of memory and get back an initialised (or optionally
uninitialised (?) array), and similarly have the destruction taken care
of in the array_ref destructor. IOW it seems to me that since
array_ref takes raw memory and turns it into an array, it makes more
sense for it to provide array style initialisation too.


Gavin Collings

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