ska::sort
is an in-place radix sort, implemented as a C++14 header-only
library using templates.
For a vector of a basic type, just pass two iterators:
ska::sort(durations.begin(), durations.end());
For a more complicated situation, provide a lambda that returns a key to sort on:
ska::sort(enemies.begin(), enemies.end(), [](const Enemey & enemy)
{
return std::make_tuple(!is_in_combat(enemy), distance_to_player(enemy));
});
Check references for more examples.
Boost Software License - Version 1.0