I found in a post how to delete elements from a container using an iterator. While iterating:
for(auto it = translationEvents.begin(); it != translationEvents.end();)
{
auto next = it;
++next; // get the next element
it->second(this); // process (and maybe delete) the current element
it = next; // skip to the next element
}
Why is auto
used without the type in auto next = it;
?
I use VS10,not C++11 !