【发布时间】:2012-11-27 11:25:53
【问题描述】:
我在一篇文章中发现了如何使用迭代器从容器中删除元素。迭代时:
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
}
为什么auto没有auto next = it;中的类型使用?
我使用的是 VS10,而不是 C++11!
【问题讨论】:
-
VS10 默认开启 C++11。所以,你确实使用 C++11。