Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2002-08-23 09:53:25


From: "Andrew Koenig" <ark_at_[hidden]>
> Peter> FWIW, after some days of thinking, I am now convinced that the
> Peter> operator[] requirement for random access iterators is a
> Peter> defect. Iterators don't need [], containers do.
>
> Iterators don't need -> either, but experience was that users expected
> all iterators to supply it because they were accustomed to using it
> with pointers.

Agreed.

> The same argument applies to [].

A weaker version of the argument. Only random access iterators have [], so
users cannot expect all iterators to supply it.

Theory aside, do users really expect [] from iterators? I have never used
iterator::[], although I do use iterator::-> frequently.


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