3 ms·
As others mentioned, it's unlikely to different code as long as the iterator is internally a simple pointer and the increment operators are inline. It could be
by bodyfour 10y ago
As others mentioned, it's unlikely to different code as long as the iterator is internally a simple pointer and the increment operators are inline.
It could be a bit more costly if, say, you're using a library that does something like added runtime checks for iterator validity. Or maybe you're using an STLish type that has a more complicated iterator.
So, no, it's unlikely that there will be a difference 99% of the time. On the other hand, the pre-increment is never slower so it's a good habit to have anyway... and it's more idiomatic C++ as well.