#include <functional>
#include <string>
#include <algorithm>
#include <iostream>

bool pred(const std::string& s)
{
    return s.size() % 2;
}

int main()
{
    std::string data[] = { "hello", "world!" };

    std::cout << std::count_if(data, data+2, 
            pred) << std::endl;

    std::cout << std::count_if(data, data+2, 
            std::ptr_fun(pred) ) << std::endl;

    std::cout << std::count_if(data, data+2, 
            std::not1(std::ptr_fun(pred))) << std::endl;

    return 0;
}