Array iteration ensure fail


LogOutputDevice: Error: Array has changed during ranged-for iteration!

If you want to modify the container during iteration (which is usually bad practice), use standard for-loop or iterators explicitly and manually update current index/iterator after add/remove element.

2 Likes