From ff423e5a0bf153de50bf3d8a556a688a318924bd Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Sun, 3 Jun 2012 22:48:02 +0000 Subject: [PATCH] Moved Strategy template param from class to function in intersection. [SVN r78804] --- .../geometry/algorithms/intersection.hpp | 29 +++++++++---------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/include/boost/geometry/algorithms/intersection.hpp b/include/boost/geometry/algorithms/intersection.hpp index 8d3dd68b3..774a390c4 100644 --- a/include/boost/geometry/algorithms/intersection.hpp +++ b/include/boost/geometry/algorithms/intersection.hpp @@ -26,11 +26,11 @@ template < typename Box1, typename Box2, typename BoxOut, - typename Strategy, std::size_t Dimension, std::size_t DimensionCount > struct intersection_box_box { + template static inline bool apply(Box1 const& box1, Box2 const& box2, BoxOut& box_out, Strategy const& strategy) @@ -52,7 +52,7 @@ struct intersection_box_box return intersection_box_box < - Box1, Box2, BoxOut, Strategy, + Box1, Box2, BoxOut, Dimension + 1, DimensionCount >::apply(box1, box2, box_out, strategy); } @@ -62,11 +62,11 @@ template < typename Box1, typename Box2, typename BoxOut, - typename Strategy, std::size_t DimensionCount > -struct intersection_box_box +struct intersection_box_box { + template static inline bool apply(Box1 const&, Box2 const&, BoxOut&, Strategy const&) { return true; @@ -88,13 +88,13 @@ template < typename Tag1, typename Tag2, typename TagOut, typename Geometry1, typename Geometry2, - typename GeometryOut, - typename Strategy + typename GeometryOut > struct intersection { typedef std::back_insert_iterator output_iterator; + template static inline bool apply(Geometry1 const& geometry1, Geometry2 const& geometry2, GeometryOut& geometry_out, @@ -126,18 +126,15 @@ struct intersection template < typename Box1, typename Box2, - typename BoxOut, - typename Strategy + typename BoxOut > struct intersection < box_tag, box_tag, box_tag, - Box1, Box2, BoxOut, - Strategy + Box1, Box2, BoxOut > : public detail::intersection::intersection_box_box < Box1, Box2, BoxOut, - Strategy, 0, geometry::dimension::value > {}; @@ -147,11 +144,11 @@ template < typename Tag1, typename Tag2, typename TagOut, typename Geometry1, typename Geometry2, - typename GeometryOut, - typename Strategy + typename GeometryOut > struct intersection_reversed { + template static inline bool apply(Geometry1 const& geometry1, Geometry2 const& geometry2, GeometryOut& geometry_out, @@ -161,7 +158,7 @@ struct intersection_reversed < Tag2, Tag1, TagOut, Geometry2, Geometry1, - GeometryOut, Strategy + GeometryOut >::apply(geometry2, geometry1, geometry_out, strategy); } }; @@ -218,14 +215,14 @@ inline bool intersection(Geometry1 const& geometry1, typename geometry::tag::type, typename geometry::tag::type, typename geometry::tag::type, - Geometry1, Geometry2, GeometryOut, strategy + Geometry1, Geometry2, GeometryOut >, dispatch::intersection < typename geometry::tag::type, typename geometry::tag::type, typename geometry::tag::type, - Geometry1, Geometry2, GeometryOut, strategy + Geometry1, Geometry2, GeometryOut > >::type::apply(geometry1, geometry2, geometry_out, strategy()); }