Skip to content

Instantly share code, notes, and snippets.

@yashihei
Created June 26, 2015 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yashihei/6497f8bb32da962aa9a2 to your computer and use it in GitHub Desktop.
Save yashihei/6497f8bb32da962aa9a2 to your computer and use it in GitHub Desktop.
vectorでpush_backするとイテレータ破壊される

されるのだけど、これで困るのがイテレータを回してる時にpush_backしたいとき。

解決法としては

  1. 別のvectorコンテナに入れてあとでmergeする
  2. std::listを使う
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment