22.6 Setting Behavior Using Template Arguments
(cont.)
- CompareByName and CompareBySalary are types
- Represent two different orderings
- We can use the max function in either sense:
Employee alice("Alice Smith", 45000);
Employee fred("Fred Jones", 38500);
Employee one = max(alice, fred, CompareBySalary());
Employee two = max(alice, fred, CompareByName());
prev
|top
|next