4
Contributors
3
Replies
25
Views
3 Years
Discussion Span
Last Post by Moschops
1

Pointers are iterators (random access iterators to be specific) and they are in fact commonly used as such. For example std::vector<T> uses T* in most (possibly all) implementations (except in the case of vector<bool>, which is a special case).

On the other hand there are many iterators that aren't pointers. For example std::list<T>::iterator could not possibly be a pointer type.

Edited by sepp2k

0

Iterators were designed based off of pointers, so a pointer is a form of iterator, but an iterator isn't necessarily a pointer.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.