
14 Apr
2009
14 Apr
'09
11:54 p.m.
Noah Roberts:
// won't compile: std::transform(m.begin(), m.end(), keys.begin(), boost::bind(&std::pair<std::string,Test>::first, _1));
The value type of the map m is pair<string const, Test> - note the const. Use the value_type typedef: typedef std::map<std::string, Test> map_type; std::transform( m.begin(), m.end(), keys.begin(), boost::bind(&map_type::value_type::first, _1) ); ...
1> T=std::pair<std::string,Test>, 1> U=std::pair<const std::string,Test>