But since the copy won't be used, the compiler should omit it even for class types, since it can assume the copy constructor has no side-effects (if the copy constructor is not trivial in the first place).
I think the compiler should prove that constructing and destroying the object doesn't have side effects before skipping those steps.
I used to wonder the same thing, but C++ is just weird in that way.
However, as was said before, any performant iterators ought to be header-only implementations, and if they have no side effects, I don't see why a compiler might not do away with the copy altogether.
Personally I always use the prefix increment (unless the other behaviour is needed).