| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | ** EPITECH PROJECT, 2024 | ||
| 3 | ** zappy/ai/hash | ||
| 4 | ** File description: | ||
| 5 | ** Pairhash.hpp | ||
| 6 | */ | ||
| 7 | |||
| 8 | #ifndef PAIRHASH_HPP_ | ||
| 9 | #define PAIRHASH_HPP_ | ||
| 10 | |||
| 11 | #include <iostream> | ||
| 12 | |||
| 13 | class PairHash | ||
| 14 | { | ||
| 15 | public: | ||
| 16 | std::size_t operator()(const std::pair<int, int> &p) const | ||
| 17 | { | ||
| 18 | ✗ | auto hash1 = std::hash<int>{}(p.first); | |
| 19 | ✗ | auto hash2 = std::hash<int>{}(p.second); | |
| 20 | ✗ | return hash1 ^ (hash2 << 1); | |
| 21 | } | ||
| 22 | }; | ||
| 23 | |||
| 24 | #endif // PAIRHASH_HPP_ | ||
| 25 |