I\'d like to use std::find_if to search for the first element in my map that has a certain value in a specific element of its value structure. I\'m a little confus
std::find_if
You can use a lambda function
int val = ...; auto it = std::find_if(myMap.begin(), myMap.end(), [val](const std::pair & t) -> bool { return t.second.x == val; } );
But as Kirill V. Lyadvinsky answer suggests the "first" element may not be what you expect.