Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-01-11 12:46:12

----- Original Message -----
From: "Andrei Alexandrescu" <andrewalex_at_[hidden]>

> It seems like you misunderstood me.

I was sure I had ;^)

> Pointer arithmetic for T* consists of
> operator+(int), operator+=(int), operator-(int), operator-=(int),
> operator-(T*), operator-=(T*), and all relational operators between two
> pointers.

good so far...

> Of all these, the subset I think makes sense for a shared_array<T> that is
> initialized with "new T[n]" consists of: operator+(int), operator-(T*,
> shared_array<T>&) (note that the shared array is only on the right-hand
> side), and perhaps equality and inequality only.

So you'd rule out:

    10 + a
    a - -5
    (a + 10) - p
    a < a

If so, coudl you explain why?

> I find the idea of iterators that also own arrays not too cool,

Could you explain why? Is it just personal preference? It seems like a
powerful idea to me.

> but then I
> drop it. Guess I'd be gladly heckled on this group if I said the sky is
> blue.

Are you kidding? It's grey from where I sit:

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