
16 Mar
2006
16 Mar
'06
8:07 a.m.
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