Added erase_if() helper function.