What happens when you re-order/delete the vector you're iterating through?

Pages: 12
given the cited source on Stackoverflow, it seems that if I want to insert into a container while iterating through it, I need to use std::list.

That does not say that "one has to use list". It says which iterators you need to revalidate, if you insert to a container. In case of std::list that list is just shorter.
Topic archived. No new replies allowed.
Pages: 12