My program is based around a set of pairs, namely
typedef std::pair<int,int> innerPair;
typedef std::pair<innerPair,int> setElement;
std::set<setElement> Foo;
The innerPair
element is what really defines the setElement, but I need to attach a group ID to every element, hence the latter setElement
definition.
In the remainder of the program, I need to find innerPair
regardless of their group ID so I basically need a function
std::set<setElement>::iterator find(innePair);
that will find the innerPair regardless of its group ID. As it stands I could simply cycle through all available group ID and do multiple find() calls, but it is far from efficient.
Is there a concise way of defining a find( ... )
member function that perform some sort of wildcarded search, or do I need to overload it with my own definition?