#include <functional>
#include <boost/bind.hpp>

class test {
 public:
    template<class t> void jopa(t);
	void doit();
};

template<class t>
class base {
 public:
	typedef std::function<void(t)> handler;
	void send(handler h);
};

class x {};
class y {};

class derived_x: public base<x> {};
class derived_y: public base<y> {};

void test::doit()
{
	derived_x X; 
	derived_y Y;
	X.send(boost::bind(&test::jopa, this, _1));
	Y.send(boost::bind(&test::jopa, this, _1));
}