Boost logo

Boost :

From: Andrew Koenig (ark_at_[hidden])
Date: 2002-08-23 14:50:14


David> I don't think that's the real question at all.

David> The problem is that the return type of operator[] can't be relied on to be
David> a reference, and in particular you can't do

David> p[n] = x;

David> with a generic random-access iterator.

David> *(p + n) = x;

David> always works (for sufficiently correct values of n and x).

Interesting -- I wonder why I never noticed that?

One would think that p[n] should be equivalent to *(p+n) -- in particular
it should be required to have the same type.

-- 
Andrew Koenig, ark_at_[hidden], http://www.research.att.com/info/ark

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk