Iterator arithmetic

c++, iterator, stl

Solution

Yes, it is, and it is true for all RA iterators.

Problem

In c++ STL, if I have an iterator `it` into a vector `v`, is `it - v.begin()` guaranteed to give me the index into the vector, so that `*it == v[it - v.begin()]`? If so, is this true for all random access iterators?

Original source