I'm trying to insert into an
unordered_multimap<pair<int, int>, int>
unordered_multimap<pair<int, int>, int> tree;
auto firstPair=make_pair(firstNumber, secondNumber);
error: static_assert failed "This hash only works for enumeration types"
The STL doesn't define a hash function for
std::pair. So you need to do the same thing as you would do if
std::pair<int, int> was a type you created. You should declare your own implementation of
However, that is not what I recommend. Instead, you'll probably find it easier to use a map of maps:
unordered_map<int, unordered_multimap<int, int>>.