Skip to content

Instantly share code, notes, and snippets.

@danlark1
Created April 15, 2022 12:35
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 danlark1/ce8c5d634204e792299581591e07eda6 to your computer and use it in GitHub Desktop.
Save danlark1/ce8c5d634204e792299581591e07eda6 to your computer and use it in GitHub Desktop.
struct Data {
bool has_property;
// ...
};
std::vector<Data> data(FillData());
std::sort(data.begin(), data.end(), [](const Data& lhs, const Data& rhs) {
return lhs.has_property < rhs.has_property;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment