From 4da6143920e2b0eccc19330080827ff6b3d4b6c5 Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Mon, 4 Jun 2012 19:13:34 +0000 Subject: [PATCH] Made dispatch::disjoint more self-contained. [SVN r78809] --- .../boost/geometry/algorithms/disjoint.hpp | 105 ++++++++---------- 1 file changed, 45 insertions(+), 60 deletions(-) diff --git a/include/boost/geometry/algorithms/disjoint.hpp b/include/boost/geometry/algorithms/disjoint.hpp index f986cc24a..1bc923d43 100644 --- a/include/boost/geometry/algorithms/disjoint.hpp +++ b/include/boost/geometry/algorithms/disjoint.hpp @@ -184,68 +184,72 @@ namespace dispatch template < - typename GeometryTag1, typename GeometryTag2, typename Geometry1, typename Geometry2, - std::size_t DimensionCount + std::size_t DimensionCount = dimension::type::value, + typename Tag1 = typename tag::type, + typename Tag2 = typename tag::type, + bool Reverse = reverse_dispatch::type::value > struct disjoint : detail::disjoint::general_areal {}; -template -struct disjoint - : detail::disjoint::point_point -{}; - - -template -struct disjoint - : detail::disjoint::box_box -{}; - - -template -struct disjoint - : detail::disjoint::point_box -{}; - -template -struct disjoint - : detail::disjoint::disjoint_linear -{}; - -template -struct disjoint - : detail::disjoint::disjoint_segment -{}; - -template -struct disjoint - : detail::disjoint::disjoint_linear -{}; - - +// If reversal is needed, perform it template < - typename GeometryTag1, typename GeometryTag2, typename Geometry1, typename Geometry2, - std::size_t DimensionCount + std::size_t DimensionCount, + typename Tag1, typename Tag2 > -struct disjoint_reversed +struct disjoint + : disjoint { static inline bool apply(Geometry1 const& g1, Geometry2 const& g2) { return disjoint < - GeometryTag2, GeometryTag1, Geometry2, Geometry1, - DimensionCount + DimensionCount, + Tag2, Tag1 >::apply(g2, g1); } }; +template +struct disjoint + : detail::disjoint::point_point +{}; + + +template +struct disjoint + : detail::disjoint::box_box +{}; + + +template +struct disjoint + : detail::disjoint::point_box +{}; + +template +struct disjoint + : detail::disjoint::disjoint_linear +{}; + +template +struct disjoint + : detail::disjoint::disjoint_segment +{}; + +template +struct disjoint + : detail::disjoint::disjoint_linear +{}; + + } // namespace dispatch #endif // DOXYGEN_NO_DISPATCH @@ -272,26 +276,7 @@ inline bool disjoint(Geometry1 const& geometry1, Geometry2 const >(); - return boost::mpl::if_c - < - reverse_dispatch::type::value, - dispatch::disjoint_reversed - < - typename tag::type, - typename tag::type, - Geometry1, - Geometry2, - dimension::type::value - >, - dispatch::disjoint - < - typename tag::type, - typename tag::type, - Geometry1, - Geometry2, - dimension::type::value - > - >::type::apply(geometry1, geometry2); + return dispatch::disjoint::apply(geometry1, geometry2); }