Question:
I’m trying to create anstd::unordered_map
that takes a std::pair
as key, and returns a size_t
as value. The tricky part for me is that I want custom hash function for my map to disregard the order of the members of the key std::pair
. I.e:Answer:
Using a custom class for equality testing:Then your map would be declared like that :
If you have better answer, please add a comment about this, thank you!