## 22.6 Setting Behavior Using Template Arguments (cont.)

- E.g., use function objects to compare `Employee`s by salary or name
- Develop these two classes:

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

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

prev |top |next