Array has changed during ranged-for iteration

TArray is contiguous. But ranged-for uses iterators, not indices. Invalidating the begin or end iterator (which adding to a container does) while iterating is undefined behaviour.

Further reading: http://stackoverflow.com/questions/17076672/add-elements-to-a-vector-during-range-based-loop-c11

(std::vector here, but the situation is still identical)

Steve