From a2bbe7a4e180b996e73e183d53bc05f22618fa21 Mon Sep 17 00:00:00 2001 From: Alex Zolotarev Date: Wed, 24 Jun 2015 15:47:00 +0300 Subject: boost::hash -> std::hash TODO: Should we improve current hash implementation/review do we really need unordered sets/maps? --- geometry/point2d.hpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'geometry') diff --git a/geometry/point2d.hpp b/geometry/point2d.hpp index d4e61f2620..46d394f7ea 100644 --- a/geometry/point2d.hpp +++ b/geometry/point2d.hpp @@ -7,9 +7,10 @@ #include "std/array.hpp" #include "std/cmath.hpp" +#include "std/functional.hpp" #include "std/sstream.hpp" #include "std/typeinfo.hpp" -#include "std/unordered_map.hpp" + namespace m2 { @@ -178,6 +179,14 @@ namespace m2 x = org.x + oldX * dx.x + y * dy.x; y = org.y + oldX * dx.y + y * dy.y; } + + struct Hash + { + size_t operator()(m2::Point const & p) const + { + return my::Hash(p.x, p.y); + } + }; }; template @@ -392,16 +401,3 @@ bool AlmostEqualULPs(m2::Point const & p1, m2::Point const & p2, unsigned } } - -// hash function for unordered map realisation. -namespace boost -{ -template <> -struct hash -{ - size_t operator()(m2::PointD const & p) const - { - return (hash()(p.x) ^ (hash()(p.y) >> 1)); - } -}; -} -- cgit v1.2.3