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
You are missing a hash function for std::pair. For example,
struct bad_hash
{
std::size_t operator()(const std::pair& p) const
{
return 42;
}
};
....
std::unordered_set< std::pair, bad_hash> u_edge_;
You can also specialize std::hash for std::hash, in which case you can omit the second template parameter.