diff options
Diffstat (limited to 'geometry/point2d.hpp')
-rw-r--r-- | geometry/point2d.hpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/geometry/point2d.hpp b/geometry/point2d.hpp index 1e1ab3d838..da19528268 100644 --- a/geometry/point2d.hpp +++ b/geometry/point2d.hpp @@ -4,11 +4,12 @@ #include "base/base.hpp" #include "base/math.hpp" #include "base/matrix.hpp" + +#include "std/array.hpp" #include "std/cmath.hpp" #include "std/sstream.hpp" #include "std/typeinfo.hpp" -#include "std/array.hpp" - +#include "std/unordered_map.hpp" namespace m2 { @@ -391,3 +392,15 @@ 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)); + } +}; +} |