29 Sep
2014
29 Sep
'14
6:47 p.m.
Ovanes Markarian
Hello Joaquin, I just came up with a slightly different question in more or less same direction. Can I safely erase data from the index view in a range based for loop. The index container contains only ordered indices (no random access).
No: the definition of range-based for given in [stmt.ranged] actually *guarantees* that you'd produce undefined behavior (the iterator is post-incremented). Joaquín M López Muñoz Telefónica