diff --git a/include/boost/geometry/algorithms/detail/distance/interface.hpp b/include/boost/geometry/algorithms/detail/distance/interface.hpp index 4fc1c798a..314e62ef0 100644 --- a/include/boost/geometry/algorithms/detail/distance/interface.hpp +++ b/include/boost/geometry/algorithms/detail/distance/interface.hpp @@ -31,6 +31,7 @@ #include +#include #include #include #include @@ -97,14 +98,14 @@ namespace resolve_strategy struct distance { template - static inline typename result_of::distance::type + static inline typename distance_result::type apply(Geometry1 const& geometry1, Geometry2 const& geometry2, Strategy const& strategy) { return dispatch::distance::apply(geometry1, geometry2, strategy); } template - static inline typename result_of::distance::type + static inline typename distance_result::type apply(Geometry1 const& geometry1, Geometry2 const& geometry2, default_strategy) { typedef typename detail::distance::default_strategy @@ -114,6 +115,30 @@ struct distance return dispatch::distance::apply(geometry1, geometry2, strategy_type()); } + + template + static inline typename distance_result + < + Geometry1, Geometry2, default_comparable_strategy + >::type + apply(Geometry1 const& geometry1, + Geometry2 const& geometry2, + default_comparable_strategy) + { + + typedef typename strategy::distance::services::comparable_type + < + typename detail::distance::default_strategy + < + Geometry1, Geometry2 + >::type + >::type strategy_type; + + return dispatch::distance + < + Geometry1, Geometry2, strategy_type + >::apply(geometry1, geometry2, strategy_type()); + } }; } // namespace resolve_strategy @@ -127,7 +152,7 @@ template struct distance { template - static inline typename result_of::distance::type + static inline typename distance_result::type apply( const Geometry1& geometry1, const Geometry2& geometry2, @@ -144,7 +169,7 @@ struct distance, Geometry2> template struct visitor: static_visitor < - typename result_of::distance + typename distance_result < variant, Geometry2, @@ -162,7 +187,7 @@ struct distance, Geometry2> {} template - typename result_of::distance::type + typename distance_result::type operator()(Geometry1 const& geometry1) const { return distance @@ -177,7 +202,7 @@ struct distance, Geometry2> }; template - static inline typename result_of::distance + static inline typename distance_result < variant, Geometry2, @@ -198,7 +223,7 @@ struct distance > template struct visitor: static_visitor < - typename result_of::distance + typename distance_result < Geometry1, variant, @@ -216,7 +241,7 @@ struct distance > {} template - typename result_of::distance::type + typename distance_result::type operator()(Geometry2 const& geometry2) const { return distance @@ -231,7 +256,7 @@ struct distance > }; template - static inline typename result_of::distance + static inline typename distance_result < Geometry1, variant, @@ -253,7 +278,7 @@ struct distance, variant struct visitor: static_visitor < - typename result_of::distance + typename distance_result < variant, variant, @@ -269,7 +294,7 @@ struct distance, variant - typename result_of::distance::type + typename distance_result::type operator()(Geometry1 const& geometry1, Geometry2 const& geometry2) const { return distance @@ -284,7 +309,7 @@ struct distance, variant - static inline typename result_of::distance + static inline typename distance_result < variant, variant,