Quantcast
Channel: User HolyBlackCat - Stack Overflow
Viewing all articles
Browse latest Browse all 946

Answer by HolyBlackCat for Is a std:.span::iterator considered an iterator into the underlying container?

$
0
0

This is UB.

The point of this rule is that the vector might reallocate the buffer and/or move the elements around before dereferencing your iterator.

This is equally problematic for vector iterators, pointers into it, span iterators, etc.


Viewing all articles
Browse latest Browse all 946

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>