search map using both 1 index and 2 index

Is there any avaliable class support this?
xxmap m;
findmap(key1, key2);
How would this work? What is the difference using one key compared to using two?
I guess you could add an operator= for the key type of a standard map that takes in argument a type composed of key1+key2

Or if by that you mean that you want the second member of the pair of a map element to be a key, then you should probably use a set with an element type of pair<key1,key2>
perhaps map<key1, {multi}map<key2, value>> would do what you need? findmap(key1) would return all values from the begin() to end() of the multimap you find by that lookup, and findmap(key1, key2) would return only what's found by the key2 lookup?
Last edited on
Topic archived. No new replies allowed.