dbremner / mili

Automatically exported from code.google.com/p/mili
Boost Software License 1.0
0 stars 0 forks source link

UniqueRanker #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Please add a UniqueRanker class to the Ranker library.

The UniqueRanker should warrant uniqueness based on some policy, something like:

UniqueRanker<T, UniqueLT, ScoreLT>

For example:

struct Player
{
    string name;
    float  score;
};

struct PlayerUniqueLT
{
    static bool compare(const Player& p1, const Player& p2)
    { return p1.name < p2.name; }
};

struct PlayerRankingLT
{
    static bool compare(const Player& p1, const Player& p2)
    { return p1.score < p2.score; }
};

typedef UniqueRanker<Player, PlayerUniqueLT, PlayerRankingLT> PlayersRanking;

Original issue reported on code.google.com by danielgutson@gmail.com on 7 Oct 2010 at 5:44

GoogleCodeExporter commented 9 years ago

Original comment by e.s.velez@gmail.com on 19 Jan 2011 at 3:38