#include <iostream>#include <unordered_map>#include <boost/bind.hpp>usingnamespace std;struct A {void print(int x){ cout << x << endl;}void print2(int x){ cout <<"2 "<< x << endl;}};struct B {void print(longlong x){ cout << x << endl;}};struct C {void print(int x){ cout << x << endl;}int sth;};int main(){ unordered_map<int,decltype(boost::bind(&A::print, A(),int()))> ma; A a;int x =2333;auto f =boost::bind(&A::print, a, x);//ma[1] = f; ma.insert(make_pair(2, f)); x =0;auto it = ma.find(2);if(it != ma.end()){ it->second();}else{ cout <<"not found\n";}longlong llx =23333; B b;auto g =boost::bind(&B::print, b, llx); llx =0;//ma.insert(make_pair(3, g)); x =2333; C c;auto h =boost::bind(&C::print, c, x); x =0;//ma.insert(make_pair(4, h)); x =23332;auto f2 =boost::bind(&A::print2, a, x); ma.insert(make_pair(5, f2)); ma.find(5)->second();return0;}