News for hackers. Stuff that matters.
Re:You can't make C++ not ugly, but you can't not try (2010) by leetcrew on Thursday February 27, 2020 @07:36AM (#22432675)
how do small vectors break iterator guarantees?
Re:You can't make C++ not ugly, but you can't not try (2010) by mehrdadn on Thursday February 27, 2020 @08:03AM (#22432830)
By invalidating iterators (and pointers and references) when swapping: https://stackoverflow.com/a/8191356
Re:You can't make C++ not ugly, but you can't not try (2010) by gpderetta on Thursday February 27, 2020 @07:58AM (#22432797)
Not sure about iterators, but they do break reference guarantees. Moving a vector doesn't invalidate pointers to the contained elements.