Using an invalidated iterator is undefined, and likely to lead to the same kinds of problems as using a dangling pointer.
使用无效迭代器是没有定义的,可能会导致与悬垂指针相同的问题。
Any use of an invalidated iterator is likely to yield a run-time error, but there is no guarantee that the program will crash or otherwise make it easy to detect the problem.
任何无效迭代器的使用都可能导致运行时错误,但程序不一定会崩溃,否则检查这种错误也许会容易些。
应用推荐