Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
custom_hash.hpp
Go to the documentation of this file.
1#pragma once
2#include <boost/functional/hash.hpp>
3
4// Based on: https://www.boost.org/doc/libs/1_61_0/doc/html/hash/combine.html
5// https://stackoverflow.com/questions/39370214/how-to-properly-hash-a-pair-of-pointers
6struct pair_hash {
7 template<typename T>
8 std::size_t operator()(std::pair<T, T> const& p) const {
9 std::size_t seed = 0;
10 boost::hash_combine(seed, p.first);
11 boost::hash_combine(seed, p.second);
12
13 return seed;
14 }
15};
Definition: custom_hash.hpp:6
std::size_t operator()(std::pair< T, T > const &p) const
Definition: custom_hash.hpp:8