Unordered-MultiMap of Pairs
问题 I'm struggling to efficiently store information in pairs: For instance I have two structs that represent (x,y) coords that i wish to calculate and store the distance between. Currently I am store all the values twice in a unordered_map<pair<Struct1*,Struct2*,double> My problem is that when searching I want the result <Struct1*,Struct2*> to turn up the same value as <Struct2*,Struct1*> that way I do not have to store information twice. I've thought about using a multimap but I think that std: