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

struct Foo
{
    bool comp(const Foo& a)
    {
    	std::cout << "a = " << a.s << std::endl;
    	return a.s == s;
    }
    
    std::string s;
	
};

struct Bar
{
    int a;
};


template <class F, class T>
void execute (F f, T a)
{
    std::cout << "Result: " << f (a) << std::endl;

}

int main()
{
    Foo* f1 = new Foo;
    f1->s = "Hello";
    
    Foo f2;
    f2.s = "Bla";
    
    Bar b;
    b.a = 100;
    
    execute (std::bind2nd (std::mem_fun(&Foo::comp), b), f1);
    
    
    return 0;
}