Looks like a usecase for `std::remove` (http://en.cppreference.com/w/cpp/algorithm/remove)