Skip to content

Instantly share code, notes, and snippets.

@danlark1
Last active April 18, 2022 22:09
Embed
What would you like to do?
// We only care about the n entities with the highest scores.
std::partial_sort(vector.begin(),
vector.begin() + n,
vector.end(),
HasHigherScore());
vector.resize(n);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment