Boost logo

Boost :

From: AlisdairM (alisdair.meredith_at_[hidden])
Date: 2006-03-16 03:07:45


Sean Huang wrote:

> Maybe I misunderstood you. Could you care to explain why const char *
> is NOT a valid random access iterator. 24.3.1.2 clearly states
> otherwise.

const char * is not a random access iterator because it is not an
output iterator, therfore not a forward iterator, therefore not a
bidirectional iterator and therefore not a random access iterator - 24.1

The iterator categories are defined in 24.1, iterator traits is simply
an aid to deducing that category for a given iterator. As it happens,
you have found a defect in the standard, that itetarator_traits< const
T * > reports the wrong category. Of course my preferred fix would be
to find a better category definition so that 24.3.1.2 was correct <g>

-- 
AlisdairM

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