3 ms·
This is not going to save you either. To have this be efficient, the compiler needs to prove many things: for example, that the end iterator and the current ite
by bollu 8y ago
This is not going to save you either. To have this be efficient, the compiler needs to prove many things: for example, that the end iterator and the current iterator come from the same base object. Compilers don't do this, because comparing iterators from two different objects is UB.