std::sort(entries.begin(), entries.end(), [&last] (const auto &a, const auto &b) { if (last && last->getID() == a.id) { return true; } return a.time < b.time; });
1. std::find last
2. std::iter_swap(first, found)
3. std::sort(front + 1, back)