Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ vector remove element by value

carVec.erase(std::remove_if(carVec.begin(), carVec.end(), [&id_to_delete](const Car& ele)->bool
            {
                return ele.getnewId() == id_to_delete;
            }), carVec.end());
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #vector #remove #element
ADD COMMENT
Topic
Name
3+9 =