2 ms·
This sort of UB detection requires bespoke work. The compiler probably can figure out that the begin and end iterators here are referencing different objects b
by UncleMeat 2y ago
This sort of UB detection requires bespoke work.
The compiler probably can figure out that the begin and end iterators here are referencing different objects but if you add just a bit more complexity to the code then the compiler won't be able to prove that.
- mwkaufma 2y agoThat's consistent with STL's move to use "explicit" and other narrowing annotations, as described in the article.