fork(8) download
  1. #include <unordered_set>
  2. #include <iostream>
  3.  
  4. int main() {
  5. auto hash = [](const std::pair<int, int>& p){ return p.first * 31 + p.second; };
  6. std::unordered_set<std::pair<int, int>, decltype(hash)> u_edge_(8, hash);
  7.  
  8. u_edge_.emplace(1, 2);
  9. u_edge_.emplace(3, 4);
  10. u_edge_.emplace(5, 6);
  11.  
  12. for (auto const &p : u_edge_)
  13. std::cout << p.first << ", " << p.second << std::endl;
  14.  
  15. return 0;
  16. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
5, 6
3, 4
1, 2