Which of the following method is better?
vector<int> vecInts;
// initialize vecInts;
// method ONE
for( vector<int>::size_type szInd = 0; szInd < vecInts.size(); ++szInd )
{
// process vecInts[szInd]
}
// method TWO
for( vector<int>::iterator iter = vecInts.begin(); iter != vecInts.end(); ++iter )
{
// process *iter
}
During code review, I am always suggested by one person that I should replace the method one with iterator version and I argue that it doesn't matter. Am I right? Thank you