fork download
  1. #include <iostream>
  2. #include <unordered_map>
  3. using namespace std;
  4.  
  5. struct Key {
  6. double x;
  7. double y;
  8. double z;
  9.  
  10. bool operator==(const Key& k) const{
  11. return (x == k.x && y == k.y && z == k.z);
  12. }
  13. };
  14.  
  15. namespace std {
  16. template <> struct hash<Key> {
  17. unsigned operator()(const Key& arg) const {
  18. return 0;
  19. }
  20. };
  21. }
  22.  
  23. int main() {
  24. std::unordered_map<Key, int> map = {{{1.01, 2.02, 3.03}, 333}};
  25. return 0;
  26. }
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout
Standard output is empty