#include <iostream>
#include <vector>
#include <boost/bind.hpp>
#include <algorithm>
struct Person {
        std::string name;
        Person(const std::string& n) : name(n) {}
        std::string getName() const { return name; }
};

int main()
{
        std::vector<Person*> vec;
        vec.push_back(new Person("Arthur"));
        vec.push_back(new Person("Chad"));
        vec.push_back(new Person("Chad"));

        ptrdiff_t num_chads = std::count_if(vec.begin(), vec.end(),
                        boost::bind(&Person::getName, _1) == "Chad");

        std::cout << "There are " << num_chads << " chads\n";
        delete vec[0]; delete vec[1]; delete vec[2];
}
