I want to use union with a structure{int, int, string} and integer as a key for unordered_map. What are the best practices to do this? How does the hashing work, is there need for custom hashing?
struct nodeinfo {
int a;
int b;
string c;
};
union key{
nodeinfo structKey;
int intKey;
};
unordered_map<key, int> Map;
I want to stick to C++11 so cannot use variant.