template<class T>
struct wrap {};
struct connect_f {
typedef void result_type;
template<class Producer, class Self, class T>
void operator()(Producer* producer, Self* self, const wrap<T>&) const {
producer->connect(self->get_promise<T>());
}
};
...
boost::mpl::for_each<consensus, wrap<mpl::_1> >(boost::bind(connect_f, &Producer, this, _1));