
24 Sep
2009
24 Sep
'09
4:09 a.m.
I have the following std::map signature. typedef std::pair<std::string, int> cPair; typedef std::map<cPair, std::vector<classA> > cMap; cMap myMap; When entering values into the map, the std::string is the only part of the key that needs to be unique. Upon retrieving map values both values of the key need to be compared. I've tried to define my insert comparison as follows, but am uncertain how to define the predicate with boost::lambda. std::string givenName = "some_text_value"; int givenInt = 3; cMap::const_iterator itor = std::find_if( myMap.begin(), myMap.end(), boost::lambda::bind( ??? , _1) == givenName ); What goes at the question marks? Ryan