Files
cpp-utils/PairHash.h
2026-01-24 16:10:02 -05:00

15 lines
311 B
C++

#ifndef PAIRHASH_H
#define PAIRHASH_H
#include <unordered_map>
// Custom hash function for std::pair
template <typename T> struct pair_hash {
std::size_t operator()(const std::pair<T, T> &p) const {
return std::hash<T>()(p.first) ^ (std::hash<T>()(p.second) << 1);
}
};
#endif // PAIRHASH_H