Even more interesting. The Microsoft C++ implementation of STL iterators is definitely slower than the GCC version.
The const_iterator returns a const reference to the value stored in the vector. This guarantees to the compiler that the caller will not modify the value and thus might allow it to generate more optimized (i.e. faster) code than using the non-const iterator.
Bookmarks