I have a vector of Student which has a field name.
I want to iterate over the vector.
void print(const vector& students) {
Use const_iterator instead. An iterator allows modification of the vector, so you can't get one from a const container.
const_iterator
iterator
vector
const
Also, the idiomatic way to write this loop uses it != students.end() instead of < (though this should work on a vector).
it != students.end()
<