// Example 13-11: Wrapping a member function as a function object
#include <algorithm>
#include <functional>
#include <list>
#include <string>

class Employee {
public:
  int         sales()      const { return sales_; }
  std::string name()       const { return name_; }
  bool        gets_bonus() const { return sales() > bonus_; }
private:
  int sales_;
  std::string name_;
  int bonus_;
};

std::list<Employee*> empptrs;
// Fill empptrs with pointers to Employee objects

int main()
{
  // Remove the employees who will NOT receive bonuses.
  std::list<Employee*>::iterator last =
    std::remove_if(empptrs.begin(), empptrs.end(),
        std::not1(std::mem_fun(&Employee::gets_bonus)));
}

