stable_sort(flags.begin(), flags.end(),
[](const shared_ptr<Flag> &a, const shared_ptr<Flag> &b) {
return a->time() < b->time();
stable_sort(flags.begin(), flags.end(),
[](const shared_ptr<Flag> &a, const shared_ptr<Flag> &b) {
return a->time() < b->time();