Listing 1
struct employee { int id; std::string name; int age; employee(int id, const std::string & name, int age): id(id), name(name), age(age) {} // comparison is based on ID, as these must be unique across employees bool operator<(const employee& e) const { return id < e.id; } }; typedef std::set<employee> company;