Hacker News new | ask | show | jobs
by leetcrew 2308 days ago
how do small vectors break iterator guarantees?
2 comments

By invalidating iterators (and pointers and references) when swapping: https://stackoverflow.com/a/8191356
Not sure about iterators, but they do break reference guarantees. Moving a vector doesn't invalidate pointers to the contained elements.