I found myself writing the following a lot:
int location =2; vector vec; vector::iterator it=vec.begin(); /..../ std::advance(it, location
Use std::advance. It is just as efficient (it uses iterator traits to just do iterator addition for random access iterators), and is more general in that it works on other kinds of iterators as well.