Check out example codes for "vector erase specific element". It will help you in understanding the concepts better.

Code Example 1

vector.erase( vector.begin() + 3 ); // Deleting the fourth element

Code Example 2

template <typename T>
void remove(std::vector<T>& vec, size_t pos)
{
    std::vector<T>::iterator it = vec.begin();
    std::advance(it, pos);
    vec.erase(it);
}

Learn ReactJs, React Native from akashmittal.com