## 26.5.1 Function Objects (cont.)

- `sort` works on any type that has `operator<`
- Defined on strings, uses dictionary order
- Consider sorting Employees:

  > `vector<Employee> staff;
  > sort(staff.begin(), staff.end());`

- To sort by name, supply:

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

prev |top |next