gnzlbg / static_vector

A dynamically-resizable vector with fixed capacity and embedded storage
https://gnzlbg.github.io/static_vector
167 stars 21 forks source link

Fix mistake in iterator invalidation section #22

Closed gnzlbg closed 7 years ago

gnzlbg commented 7 years ago

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".