Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorAlex Zolotarev <alex@maps.me>2015-06-24 15:47:00 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 02:52:33 +0300
commita2bbe7a4e180b996e73e183d53bc05f22618fa21 (patch)
tree3806d15f3450d9bfc8425991d17f5061bbc29c58 /base
parentd8eebb597792cc47564bb18d188be35232260506 (diff)
boost::hash -> std::hash
TODO: Should we improve current hash implementation/review do we really need unordered sets/maps?
Diffstat (limited to 'base')
-rw-r--r--base/math.hpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/base/math.hpp b/base/math.hpp
index 1015825082..a508dcb102 100644
--- a/base/math.hpp
+++ b/base/math.hpp
@@ -1,10 +1,11 @@
#pragma once
#include "base/assert.hpp"
+#include "std/algorithm.hpp"
#include "std/cmath.hpp"
+#include "std/functional.hpp"
#include "std/limits.hpp"
#include "std/type_traits.hpp"
-#include "std/algorithm.hpp"
#include <boost/integer.hpp>
@@ -207,4 +208,10 @@ template <typename T> T GCD(T a, T b)
return multiplier * gcd;
}
+template <typename T1, typename T2>
+size_t Hash(T1 t1, T2 t2)
+{
+ return (hash<T1>()(t1) ^ (hash<T2>()(t2) << 1));
+}
+
}