Category: sort
C++ : How to Sort a List of objects with custom Comparator or lambda function
In this example we will discuss different ways to sort a std::list of user defined data types with custom comparators or lambda functions. Suppose we have a type Player that contains Id and name. Advertisements struct Player { int id; std::string name; Player(int playerId, std::string playerName) : id(playerId), name(playerName) { } bool operator <(const Player …
C++ : How to Sort a List of objects with custom Comparator or lambda functionRead More