Supposedly:
for (vector::iterator iter = ivec.begin(); iter != ivec.end(); ++iter)
{}
I do understand the difference when it com
++iter is most likely to be faster but never slower than iter++.
Implementing the post increment operator iter++ needs to generate an additional temporary(this temporary is returned back while the original iter is incremented ++) over implementing the post increment operator ++iter, So unless the compiler can optimize(yes it can) the post increment, then ++iter will most likely be faster than iter++.
Given the above, It is always preferable to use ++iter in the looping conditions.