2 ms·
For the majority of iterators doesn't make a difference. For something like std::regexp iterator, which holds a shared pointer to the regexp object, it can make
by gpderetta 10y ago
For the majority of iterators doesn't make a difference. For something like std::regexp iterator, which holds a shared pointer to the regexp object, it can make a big difference. Optimizing that copy away is hard as it requires the intimate knowledge of the iterator semantics.
Anyway, using ++i is today idiomatic in C++.