I have a map like this (both of first and second parameters are unique):
std::map<DWORD, DWORD> mapTest;
mapTest.insert(make_pair(1, 101));
mapTest.insert(make_pair(2, 102));
mapTest.insert(make_pair(3, 103));
And I have a searcher, which is work perfectly for the first values of the map:
bool SearchInMap(DWORD firstmap, DWORD * secondmap)
{
if (mapTest.end() == mapTest.find(firstmap))
return false;
*secondmap = mapTest[firstmap];
return true;
}
But I need another method, which could search in the second parameters and looks like what I showed. If possible I don't want to use for or while cycles. As I know I probably need a find_if search, but I can't handle it.
Thanks in advance you're help!