Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-01-12 07:25:21

From: "Andrei Alexandrescu" <andrewalex_at_[hidden]>
> > I find the whole idea of adding pointer arithmetic to shared_array
> > questionable at best and nonsensical at worst.
> Cool, but operator[] is kind of closely related to pointer arithmetic,
> it?

For random access iterators, a[k] is *(a + k) (conceptually if not legally);
but for vector, deque, map, a[k] accesses the element identified by k, and
no arithmetic enters the picture.

C arrays are a strange hybrid between the two since they are a container
that is implicitly convertible to its begin() iterator.

I don't know what is shared_array supposed to model: a container, a managed
C array, or a random access iterator. In fact I don't think that it models
anything. ;-) To me, it looks like it was added for "completeness" and does
not address a real need.

Peter Dimov
Multi Media Ltd.

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