diff options
Diffstat (limited to 'geometry/point2d.hpp')
-rw-r--r-- | geometry/point2d.hpp | 24 |
1 files changed, 10 insertions, 14 deletions
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<T> const & p) const + { + return my::Hash(p.x, p.y); + } + }; }; template <typename T> @@ -392,16 +401,3 @@ bool AlmostEqualULPs(m2::Point<T> const & p1, m2::Point<T> const & p2, unsigned } } - -// hash function for unordered map realisation. -namespace boost -{ -template <> -struct hash<m2::PointD> -{ - size_t operator()(m2::PointD const & p) const - { - return (hash<double>()(p.x) ^ (hash<double>()(p.y) >> 1)); - } -}; -} |