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

// Deleting xth element from start

// Deleting from the last

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