I just did some analysis of the asm code GCC produced from the same loop using iterators and indexing. It is true that the difference if any is negligible, but this really depends on what the loop body looks like. When it is a simple arithmetic operation the iterator is compiled out and the asm code is identical (besides that the iterator loop adds 4 and the index loop increments). When the loop bodies become more complex however, the difference between the loops grows. I don't know why this happens because they are semantically the same but I guess the compiler has a harder time to detect what you really want and is just playing it safe.
Maybe I should rephrase that a bit: Try to avoid using iterators when you have a complex loop body, don't need any special iterator functionality and care about every bit of performance. If using indexing makes your code 10x uglier then you really should use iterators because the performance gain isn't worth the headache every time you have to read your code
.
As for deque, actually the code for both loops are also similar and have the same amount of memory accesses. The same applies here as for vector though and it really depends on the loop body how optimized the iterators can get.
This was done on GCC 4.7.0. I suspect that there are already many loop optimization hacks built into the newer compilers that should already be mostly C++11 ready. Maybe on older compilers the difference was so big it would have even been noticeable
.