std::vector插入和删除进阶
【一】vector删除元素Std::vector<int> exampleVec = {1,2,3,4,5,6,7};1. iterator erase( const_iterator pos ) //移除位于 pos 的元素【注意点】:(1)迭代器 pos 必须合法且可解引用。所以不能以 end() 迭代器为 pos 的值(合法,但不可解引用),不然会抛异常。比如:exampleV...
原创
2018-06-29 11:25:11 ·
6032 阅读 ·
1 评论