4 ms·
how do small vectors break iterator guarantees?
by leetcrew 7y ago
how do small vectors break iterator guarantees?
- gpderetta 7y agoNot sure about iterators, but they do break reference guarantees. Moving a vector doesn't invalidate pointers to the contained elements.
- mehrdadn 7y agoBy invalidating iterators (and pointers and references) when swapping: https://stackoverflow.com/a/8191356 https://stackoverflow.com/a/8191356