vector:erase iterator requirements

In the two forms of vector::erase:

iterator erase(iterator position);
iterator erase(iterator first, iterator last);

can the 'iterator' mentioned be a vector::const_iterator, vector::reverse_iterator, or vector::const_reverse_iterator as well as a vector::iterator ?
No, because you cannot construct a vector<>::iterator from a vector<>::const_iterator
or from a vector<>::reverse_iterator.

(You could have easily found this out by writing a simple test case and trying to compile
it).
I agree with jsmit It does not compile .
Why should the end user not be allowed to 'erase' in a vector using a reverse_iterator, or a first and last reverse_iterator also ? After all the vector iterators just allow one to specify a position in the vector so why can't 'erase' be specified in terms of reverse iterators too ?
That's a question for the c++ committee.
Topic archived. No new replies allowed.