Use of iterators for vectors