Boost logo

Boost :

From: Kevlin Henney (kevlin_at_[hidden])
Date: 2001-08-20 01:58:34

> From: John Max Skaller <skaller_at_[hidden]>
> I agree. My main contention is that
> a) we should drop shared_array
> b) we should use
> shared_ptr< array<T> >
> shared_ptr< fixed_array<T,n> >
>instead of
> shared_ptr< T[] >
> shared_ptr< T[n] >
>I.e.: I agree with removing shared_array and using shared_ptr,
>but suggest that instead of a specialisation, to use first class
>array types.

This seems to be a better idea in theory than in practice:

        shared_ptr< array<T> > p;
        (*p)[i] = ...;

Whereas a shared (or scoped) array that was specialised as such would
support operator[] directly. Adding operator[] to the general share_ptr
class would be a bad idea, reintroducing many of the fun and games that
the current separate interfaces prevent, when compared with raw arrays.

So, dropping the idea of a separate shared array implementation is not
really appropriate. It becomes a question of whether to support it as a
specialisation or as a separately named class template.


  Kevlin Henney phone: +44 117 942 2990
  mailto:kevlin_at_[hidden] mobile: +44 7801 073 508 fax: +44 870 052 2289
  Curbralan: Consultancy + Training + Development + Review

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