https://en.wikipedia.org/wiki/Copy_elision
I used to wonder the same thing, but C++ is just weird in that way.
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).