vector<int> vi; ... for(int i : vi) cout << "i = " << i << endl;
std::vector<int>::iterator it = vector.begin();
for (auto it = begin (vector); it != end (vector); ++it) { it->doSomething (); }