## 23.4 Sets (cont.)

2. Provide an explicit function object; name it as the second template argument

   >     class SortByName
   >     {
   >     public:
   >        bool operator() (const Employee& a, const Employee& b) const;
   >     };

   >     bool SortByName::operator(const Employee& a, const Employee& b)
   >     {
   >        return a.get_name() < b.get_name();
   >     }

   >     set<Employee, SortByName> workers; // Now sorted by name

prev |top |next