> My only issue with STL's iterator design is that the pointer-style
> based algorithms make it a lot tougher for the compiler to optimize the
> resulting code, taking advantage of cpu pipelining and parallel
> execution units - especially without having the 'restrict' keyword to
> tell the compiler that the dereferenced iterators are not aliasing
> other variables used within the loop. ie, with array indexing the
> compiler can easily tell that certain lines of code can be
> parallelized, but changing a pointer in the loop makes it very hard on
> the compiler designers to track what optimizations can happen. In my
> code on one platform, I've found I could optimize the loop time from
> 170 clock cycles per iteration down to 10 just by using array indexing
> instead of pointer increments! (TMSC6701 DSP, VLIW)
I had many reasons to avoid iterators, but this one is new to me )