The following program does not compile an unordered set of pairs of integers, but it does for integers. Can unordered_set and its member functions be used on us
OK here is a simple solution with guaranteed non collisions. Simply reduce your problem to an existing solution i.e. convert your pair of int to string like so:
auto stringify = [](const pair& p, string sep = "-")-> string{
return to_string(p.first) + sep + to_string(p.second);
}
unordered_set myset;
myset.insert(stringify(make_pair(1, 2)));
myset.insert(stringify(make_pair(3, 4)));
myset.insert(stringify(make_pair(5, 6)));
Enjoy!