boost::bind
is what you look for.
boost::bind(&std::pair::second, _1); // returns the value of a pair
Example:
typedef std::map<std::string, int> map_type;
std::vector<int> values; // will contain all values
map_type map;
std::transform(map.begin(),
map.end(),
std::back_inserter(values),
boost::bind(&map_type::value_type::second, _1));
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…