vector<T>::erase std=c++11

Today, i refer to vector<T>::erase (c++11) in cplusplus.com and it gives me the two results:
iterator erase (const_iterator position);
iterator erase (const_iterator first, const_iterator last);
as for c++98, the results are:
iterator erase (iterator position);
iterator erase (iterator first, iterator last);

I think the results of the c++11 version in cplusplus.com are wrong because of the const_iterator.

I am a novice if i am wrong please criticize.Thank you.
You can't call .erase() on a const vector, so it's perfectly fine to accept const iterators.

Cross-reference: http://en.cppreference.com/w/cpp/container/vector/erase
Last edited on
Requiring iterators to modifiable values was C++98 defect which was corrected in C++11. Now most of the unnessesary requirements are relaxed, so const_iterators are now really can be used and should be preferred for const correctness.
Topic archived. No new replies allowed.