SyntaxFix
Write A Post
Hire A Developer
Questions
How about std::remove() instead:
std::remove()
#include <algorithm> ... vec.erase(std::remove(vec.begin(), vec.end(), 8), vec.end());
This combination is also known as the erase-remove idiom.