diff --git a/include/boost/geometry/algorithms/detail/convex_hull/graham_andrew.hpp b/include/boost/geometry/algorithms/detail/convex_hull/graham_andrew.hpp index 102318eeb..64d81054e 100644 --- a/include/boost/geometry/algorithms/detail/convex_hull/graham_andrew.hpp +++ b/include/boost/geometry/algorithms/detail/convex_hull/graham_andrew.hpp @@ -190,7 +190,7 @@ private: point_type most_left, most_right; - geometry::less less; + geometry::less_exact less; detail::convex_hull::get_extremes(in_proxy, most_left, most_right, less); diff --git a/include/boost/geometry/policies/compare.hpp b/include/boost/geometry/policies/compare.hpp index a5c8f0939..9dd8a694c 100644 --- a/include/boost/geometry/policies/compare.hpp +++ b/include/boost/geometry/policies/compare.hpp @@ -38,6 +38,29 @@ namespace boost { namespace geometry on equal x-es then on y, etc. If a dimension is specified, only that dimension is considered */ + +template +< + typename Point = void, + int Dimension = -1, + typename StrategyOrTag = void +> +struct less_exact +{ + using first_argument_type = Point; + using second_argument_type = Point; + using result_type = bool; + + inline bool operator()(Point const& left, Point const& right) const + { + return StrategyOrTag::template compare_type + < + strategy::compare::less, + strategy::compare::equals_exact + >::apply(left, right); + } +}; + template < typename Point = void, @@ -54,7 +77,8 @@ struct less { return StrategyOrTag::template compare_type < - strategy::compare::less + strategy::compare::less, + strategy::compare::equals_epsilon >::apply(left, right); } }; @@ -91,7 +115,8 @@ struct less { return Strategy::template compare_type < - strategy::compare::less + strategy::compare::less, + strategy::compare::equals_epsilon >::apply(left, right); } }; diff --git a/include/boost/geometry/strategies/convex_hull/cartesian.hpp b/include/boost/geometry/strategies/convex_hull/cartesian.hpp index d61ace3c2..5bf46f211 100644 --- a/include/boost/geometry/strategies/convex_hull/cartesian.hpp +++ b/include/boost/geometry/strategies/convex_hull/cartesian.hpp @@ -50,11 +50,11 @@ public: return side_strategy_type(); } - template + template using compare_type = typename strategy::compare::cartesian < ComparePolicy, - strategy::compare::equals_exact, + EqualsPolicy, -1 >; }; diff --git a/include/boost/geometry/strategies/convex_hull/geographic.hpp b/include/boost/geometry/strategies/convex_hull/geographic.hpp index 4bcb53fd6..879d75284 100644 --- a/include/boost/geometry/strategies/convex_hull/geographic.hpp +++ b/include/boost/geometry/strategies/convex_hull/geographic.hpp @@ -65,11 +65,11 @@ public: >(base_t::m_spheroid); } - template + template using compare_type = typename strategy::compare::spherical < ComparePolicy, - strategy::compare::equals_exact, + EqualsPolicy, -1 >; }; diff --git a/include/boost/geometry/strategies/convex_hull/spherical.hpp b/include/boost/geometry/strategies/convex_hull/spherical.hpp index 28262e292..6365b1c0f 100644 --- a/include/boost/geometry/strategies/convex_hull/spherical.hpp +++ b/include/boost/geometry/strategies/convex_hull/spherical.hpp @@ -47,11 +47,11 @@ public: return strategy::side::spherical_side_formula(); } - template + template using compare_type = typename strategy::compare::spherical < ComparePolicy, - strategy::compare::equals_exact, + EqualsPolicy, -1 >; }; diff --git a/include/boost/geometry/strategies/relate/cartesian.hpp b/include/boost/geometry/strategies/relate/cartesian.hpp index 4ea0d7908..2b8a9e13a 100644 --- a/include/boost/geometry/strategies/relate/cartesian.hpp +++ b/include/boost/geometry/strategies/relate/cartesian.hpp @@ -189,11 +189,11 @@ public: return strategy::within::cartesian_box_box(); } - template + template using compare_type = typename strategy::compare::cartesian < ComparePolicy, - strategy::compare::equals_epsilon, + EqualsPolicy, -1 >; }; diff --git a/include/boost/geometry/strategies/relate/geographic.hpp b/include/boost/geometry/strategies/relate/geographic.hpp index c245ae530..b756f1a16 100644 --- a/include/boost/geometry/strategies/relate/geographic.hpp +++ b/include/boost/geometry/strategies/relate/geographic.hpp @@ -211,16 +211,13 @@ public: return strategy::within::spherical_box_box(); } - template + template using compare_type = typename strategy::compare::spherical < ComparePolicy, - strategy::compare::equals_epsilon, + EqualsPolicy, -1 >; - - //template - //using compare_type = strategy::compare::spherical; }; @@ -293,12 +290,12 @@ struct strategy_converter(base_t::m_spheroid); } - template - using compare_type = typename strategy::compare::cartesian + template + using compare_type = typename strategy::compare::spherical < ComparePolicy, - strategy::compare::equals_epsilon, - -1 + EqualsPolicy, + -1 >; }; diff --git a/include/boost/geometry/strategies/relate/spherical.hpp b/include/boost/geometry/strategies/relate/spherical.hpp index 22098d9f0..7914831fe 100644 --- a/include/boost/geometry/strategies/relate/spherical.hpp +++ b/include/boost/geometry/strategies/relate/spherical.hpp @@ -195,11 +195,11 @@ public: return strategy::within::spherical_box_box(); } - template + template using compare_type = typename strategy::compare::spherical < ComparePolicy, - strategy::compare::equals_epsilon, + EqualsPolicy, -1 >; };