Check out example codes for "delete from front in vector c++". It will help you in understanding the concepts better.

Code Example 1

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

Code Example 2

// Deleting first element
vector_name.erase(vector_name.begin());

// Deleting xth element from start
vector_name.erase(vector_name.begin()+(x-1));

// Deleting from the last
vector_name.pop_back();

Code Example 3

carVec.erase(std::remove_if(carVec.begin(), carVec.end(), [&id_to_delete](const Car& ele)->bool
            {
                return ele.getnewId() == id_to_delete;
            }), carVec.end());

Learn ReactJs, React Native from akashmittal.com