
It's not a legal random access (or even forward) iterator if it visits the same *element* more than once in a traversal. That's why I said the above about the iterator category.
Ooops! I would agree that for non-const values it wouldn't be a random-access but as an read iterator with const values you can't notice it's returning the same value unless you unconst it. The random access tag is in my opinion a strongest point of the iterator, you can get a performance boost in many applications (specially when implementing containers). I'm out of ideas about how to solve this. Can't we live breaking the law? Should we create new categories? Just let it as a "poor" input iterator?
Whoops, "constant iterator" is already overloaded with a different meaning. Something else, maybe... "repeat iterator?"
constant_iterator is also very similar to const_iterator. Regards, Ion