Boost logo

Boost :

From: John Maddock (john_at_[hidden])
Date: 2006-03-16 05:23:38


> 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>

Hold your horses here: surely const char* most certainly *is* a random
access iterator, albeit an immutable one. I don't see anything in 24.1 that
requires OutputIterator semantics for anything except, well output iterators
:-)

Waiting to be shot down in flames yours, John.


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