Use a KeyEqual and Hash where any odd unsigned number 'x' is equal to 'x-1'. Make sure that KeyEqual is called (and not ==).
| 1478 | // Use a KeyEqual and Hash where any odd unsigned number 'x' is equal to |
| 1479 | // 'x-1'. Make sure that KeyEqual is called (and not ==). |
| 1480 | struct hash { |
| 1481 | std::size_t operator()(std::uint64_t v) const { |
| 1482 | if (v % 2u == 1u) { |
| 1483 | return std::hash<std::uint64_t>()(v - 1); |
| 1484 | } else { |
| 1485 | return std::hash<std::uint64_t>()(v); |
| 1486 | } |
| 1487 | } |
| 1488 | }; |
| 1489 | |
| 1490 | struct key_equal { |
| 1491 | bool operator()(std::uint64_t lhs, std::uint64_t rhs) const { |
nothing calls this directly
no outgoing calls
no test coverage detected