반복기를 사용하여 컨테이너에서 요소를 삭제하는 방법을 게시물에서 발견했습니다. 반복하는 동안 :자동 변수 및 유형
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;
의 유형없이 사용?
저는 C++ 11이 아닌 VS10을 사용합니다!
[C++ 11 형식 유추] 참조 (http://en.wikipedia.org/wiki/C%2B%2B11#Type_inference) – juanchopanza
VS10은 기본적으로 C++ 11을 사용합니다. 그래서 C++ 11을 사용합니다. –