News for hackers. Stuff that matters.
Re:C++ for Games: Performance, Allocations and Data Locality by bodyfour on Monday May 30, 2016 @11:34AM (#11801768)
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.

There are no comments on this comment yet.