class SalaryComparator
{
public:
SalaryComparator(bool a) : ascending(a) {}
bool operator()(const Employee& a, const Employee& b)
{
if (ascending)
return a.get_salary() < b.get_salary();
else
return a.get_salary() > b.get_salary();
}
private:
bool ascending;
}