I have an STL set of type:
std::set< std::pair< double, std::pair< unsigned, vector< unsigned > > > > X
I know I could make things simpler by changing my data structure but that's not an option here for me.
How can I search for an element of type unsigned
only in the first elements of the inner pair in my set?
I tried the following approach, but doesn't work.
auto it = std::find_if(X.begin(), X.end(), [value_searching]
(const std::pair<double, std::pair< unsigned, vector< unsigned > >& elem) {
return elem->second.first == value_searching
});