diff options
Diffstat (limited to '9p33.cpp')
-rw-r--r-- | 9p33.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
@@ -1,4 +1,4 @@ -#include <iostream> +#include <vector> /* * @@ -9,6 +9,17 @@ int main () { - + /* + Iterator invalid. Undefined behavior. + */ + + std::vector<int> v{1, 2, 3, 4, 5}; + + auto begin = v.begin(); + while (begin != v.end()) { + ++begin; + v.insert(begin, 42); + ++begin; + } return 0; } |