Skip to content
Snippets Groups Projects
Commit 321d8132 authored by Abd Errahmane Kiouche's avatar Abd Errahmane Kiouche :speech_balloon:
Browse files

Upload New File

parent 0ad77a0d
No related branches found
No related tags found
No related merge requests found
//
// Created by Kiouche on 1/20/2020.
//
#ifndef P_K_COMPRESSION_HASH_H
#define P_K_COMPRESSION_HASH_H
#include <string>
#include <vector>
namespace std {
/* Combination hash from Boost */
template <class T>
inline void hash_combine(size_t& seed, const T& v)
{
hash<T> hasher;
seed ^= hasher(v) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
template<typename S, typename T> struct hash<pair<S, T>>
{
inline size_t operator()(const pair<S, T>& v) const
{
size_t seed = 0;
hash_combine(seed, v.first);
hash_combine(seed, v.second);
return seed;
}
};
/* End combination hash from Boost */
}
#endif //P_K_COMPRESSION_HASH_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment