Boost logo

Boost Users :

Subject: Re: [Boost-users] [lambda] Defining a predicate for std::find_if if the key to a std::map is std::pair
From: Ryan McConnehey (mccorywork_at_[hidden])
Date: 2009-09-24 12:06:10



Note that you can use std::map::find instead:

cMap::const_iterator itor = myMap.find(givenName);
std::map::find expects to be passed the key.  This means that I would have to pass myMap.find(std::make_pair(givenName, ???));

Since the second parameter is compared this needs to be some value that std::map::find knows to ignore.  If I could do this I wouldn't be trying to code my own comparison.

Ryan

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net