Step 6 of 6
Erase with a condition
Removing elements that match a condition used to need the "erase-remove idiom". C++20 made it one call:
std::erase_if(v, [](int x) { return x < 0; }); // C++20
// old way:
v.erase(std::remove_if(v.begin(), v.end(), pred), v.end());
Your turn: write void drop_dead(std::vector<std::pair<std::string, int>>& players) that removes players whose hp (the int) is 0 or less.