Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CPP

c++ erase remove

std::vector<int> v = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
v.erase(std::remove(v.begin(), v.end(), 5), v.end());
// v will be {0 1 2 3 4 6 7 8 9}
 
PREVIOUS NEXT
Tagged: #erase #remove
ADD COMMENT
Topic
Name
3+2 =