In case you haven't heard of it, std::remove() can be useful in these situations.  There's a bit of a gotcha, however, in that you need to combine it with std::erase() to get rid of unneeded items at the end of the list.