gnzlbg / static_vector

A dynamically-resizable vector with fixed capacity and embedded storage

Home Page:https://gnzlbg.github.io/static_vector

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fix mistake in iterator invalidation section

gnzlbg opened this issue · comments

Zach Laine commented:

Iterator invalidation

The iterator invalidation rules are different than those for std::vector, since:

moving an embedded_vector invalidates all iterators,
swapping two embedded_vectors invalidates all iterators, and
inserting elements into an embedded_vector never invalidates iterators.

That last one is not true -- if I insert a T before the first element, I've invalidated all iterators into the vector, no? Did you meant push_back() never invalidates?

The last one should be "inserting elements at the end of an embedded_vector never invalidates iterators".