Does vector::erase not work with reverse iterators?

Viewed 1434

The following code won't compile

some_vector.erase(some_vector.rbegin(), some_vector.rbegin()+1);

This is just an example, I know there's better option for deleting the last n elements. GCC tells me that there is no matching function for erase. Did I do something wrong or does erase not work with reverse iterators ? It works fine with a forward iterator, though

1 Answers
Related