#include <iostream>
#include <vector>
#include <algorithm>
 
#include <cassert>
 
int main() {
    
    using namespace std;
    
    int value = 1;
    vector<int> values;
    for( int cnt = 0; cnt != 10; ++cnt )
        values.push_back( value++ );
    
    // values = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
    assert( values.front() == 1 && values.back() == 10 );
    
    // find the position of element 5
    vector<int>::reverse_iterator found = find( values.rbegin(), values.rend(), 5 );
    // { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
    //               ^
    assert( *found == 5 );
    // { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 }
    //                  ^
    assert( *found.base() == 6 );
    // { 1, 2, 3, 4, 6, 7, 8, 9, 10 }
    values.erase( ++found.base() );
    assert( values[ 5 ] == 6 );
}