diff --git a/include/boost/geometry/policies/compare.hpp b/include/boost/geometry/policies/compare.hpp index 8538fdfa9..047beafba 100644 --- a/include/boost/geometry/policies/compare.hpp +++ b/include/boost/geometry/policies/compare.hpp @@ -42,7 +42,7 @@ template < typename Point = void, int Dimension = -1, - typename Strategy = void + typename StrategyOrTag = void > struct less { @@ -96,6 +96,160 @@ struct less } }; +// for backward compatibility + +template +struct less +{ + typedef Point first_argument_type; + typedef Point second_argument_type; + typedef bool result_type; + + inline bool operator()(Point const& left, Point const& right) const + { + typedef typename strategy::compare::services::default_strategy + < + strategy::compare::less, + strategy::compare::equals_epsilon, + Point, Point, + Dimension, + boost::geometry::cartesian_tag, boost::geometry::cartesian_tag + >::type strategy_type; + + return strategy_type::apply(left, right); + } +}; + +template +struct less +{ + typedef Point first_argument_type; + typedef Point second_argument_type; + typedef bool result_type; + + inline bool operator()(Point const& left, Point const& right) const + { + typedef typename strategy::compare::services::default_strategy + < + strategy::compare::less, + strategy::compare::equals_epsilon, + Point, Point, + Dimension, + boost::geometry::spherical_tag, boost::geometry::spherical_tag + >::type strategy_type; + + return strategy_type::apply(left, right); + } +}; + +template +struct less +{ + typedef Point first_argument_type; + typedef Point second_argument_type; + typedef bool result_type; + + inline bool operator()(Point const& left, Point const& right) const + { + typedef typename strategy::compare::services::default_strategy + < + strategy::compare::less, + strategy::compare::equals_epsilon, + Point, Point, + Dimension, + boost::geometry::geographic_tag, boost::geometry::geographic_tag + >::type strategy_type; + + return strategy_type::apply(left, right); + } +}; + +template +struct less +{ + typedef bool result_type; + + template + inline bool operator()(Point1 const& left, Point2 const& right) const + { + typedef typename strategy::compare::services::default_strategy + < + strategy::compare::less, + strategy::compare::equals_epsilon, + Point1, Point2, + Dimension, + boost::geometry::cartesian_tag, boost::geometry::cartesian_tag + >::type strategy_type; + + return strategy_type::apply(left, right); + } +}; + +template +struct less +{ + typedef bool result_type; + + template + inline bool operator()(Point1 const& left, Point2 const& right) const + { + typedef typename strategy::compare::services::default_strategy + < + strategy::compare::less, + strategy::compare::equals_epsilon, + Point1, Point2, + Dimension, + boost::geometry::spherical_tag, boost::geometry::spherical_tag + >::type strategy_type; + + return strategy_type::apply(left, right); + } +}; + +template +struct less +{ + typedef bool result_type; + + template + inline bool operator()(Point1 const& left, Point2 const& right) const + { + typedef typename strategy::compare::services::default_strategy + < + strategy::compare::less, + strategy::compare::equals_epsilon, + Point1, Point2, + Dimension, + boost::geometry::geographic_tag, boost::geometry::geographic_tag + >::type strategy_type; + + return strategy_type::apply(left, right); + } +}; + + +template +struct less +{ + typedef bool result_type; + + template + inline bool operator()(Point1 const& left, Point2 const& right) const + { + typedef typename strategy::compare::services::default_strategy + < + strategy::compare::less, + strategy::compare::equals_epsilon, + Point1, Point2, + Dimension + >::type strategy_type; + + return strategy_type::apply(left, right); + } +}; + + + /*! \brief Greater functor