Hello World Demo Test Project
struct CB {
typedef boost::variant< boost::function<void(int)> , boost::function<void(std::string)> > CallbackType ;
void fun2 ( std::string str ) {
std::cout << " Fun2 : " << str << std::endl ;
}
void init(){
boost::function<void(std::string)> f( boost::bind( &CB::fun2, this, _1 ) );
callback_["A"] = f ;
boost::get< boost::function<void(std::string)> >(callback_["A"])("Ankit");
}
std::map<std::string, CallbackType> callback_ ;
};