Skip to content

Instantly share code, notes, and snippets.

@saucecode
Created December 1, 2016 06:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save saucecode/67b3d674ae8e64e1b815e7aaf4a783f8 to your computer and use it in GitHub Desktop.
Save saucecode/67b3d674ae8e64e1b815e7aaf4a783f8 to your computer and use it in GitHub Desktop.
std::vector<projectile_t*> projectiles;
// ...
projectiles.erase(
std::remove_if(projectiles.begin(), projectiles.end(),
[](projectile_t *p){ return p->life <= 0.0; }),
projectiles.end()
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment