这是我写的函数代码,请问编写容器插入元素函数时使用迭代器,这里为什么会触发断点
不要用迭代器的自减操作。如果要从后向前遍历,请使用rbegin,rend。 你这个地方直接用insert函数即可。
void myinsert(CPt point int pos) { Line.insert(Line.begin() + pos, point); }
提问的时候,别贴图,贴代码。