summaryrefslogblamecommitdiffstats
path: root/src/common/hash.h
blob: 2989307029797af1121c1f365437d05e87e9ad78 (plain) (tree)
1
2
3
4
5
6
7
8
9





                                            
                  

                                    


                  

                                 
                                                                          





                                                                
                     
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.

#pragma once

#include <cstddef>
#include <utility>
#include <boost/functional/hash.hpp>

namespace Common {

struct PairHash {
    template <class T1, class T2>
    std::size_t operator()(const std::pair<T1, T2>& pair) const noexcept {
        std::size_t seed = std::hash<T1>()(pair.first);
        boost::hash_combine(seed, std::hash<T2>()(pair.second));
        return seed;
    }
};

} // namespace Common