Possible duplicate:
comparing iterators from different containers
In practice, std::vector<T>::iterator is probably implemented as a wrapped T* for most STL implementations, so each iterator is associated with a unique memory address (if the iterator comes from a non-empty vector).
However, this implementation detail. Is there a real guarantee from the C ++ standard that every vector iterator is somehow unique? In particular, can the end() tetra of one nonempty vector ever equal the end() iterator of another nonempty vector?
For instance:
std::vector<int> v1; std::vector<int> v2; assert(v1.end() != v2.end());
source share