boost::bind and insert of a boost::unordered_map
问题 I want to use boost::bind to create a boost::function inserting a new key-value pair into a boost::unoredered_map but I got few compilation errors. typedef boost::unordered_map< std::string, std::string > dict_type; inline void insert( const std::string& key, const std::string& value ){ typedef std::pair<dict_type::iterator, bool> out_type; dict_type::value_type to_insert(key,value); boost::function<void()> f = boost::bind<out_type>( &dict_type::insert ,obj_ ,boost::cref(to_insert) ); } The