From db23bb2e832ae6f460d5fc14a4395b7a887f47bf Mon Sep 17 00:00:00 2001 From: Bruno Lalande Date: Tue, 9 Oct 2012 23:19:54 +0000 Subject: [PATCH] Made dispatch::for_each able to retrieve the tag by itself. [SVN r80922] --- .../boost/geometry/algorithms/for_each.hpp | 36 ++++++++----------- .../geometry/multi/algorithms/for_each.hpp | 12 ++----- 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/include/boost/geometry/algorithms/for_each.hpp b/include/boost/geometry/algorithms/for_each.hpp index a13348b4a..0156c6371 100644 --- a/include/boost/geometry/algorithms/for_each.hpp +++ b/include/boost/geometry/algorithms/for_each.hpp @@ -148,63 +148,63 @@ namespace dispatch template < - typename Tag, - typename Geometry + typename Geometry, + typename Tag = typename tag_cast::type, multi_tag>::type > struct for_each_point {}; template -struct for_each_point +struct for_each_point : detail::for_each::fe_point_per_point {}; template -struct for_each_point +struct for_each_point : detail::for_each::fe_range_per_point {}; template -struct for_each_point +struct for_each_point : detail::for_each::fe_range_per_point {}; template -struct for_each_point +struct for_each_point : detail::for_each::fe_polygon_per_point {}; template < - typename Tag, - typename Geometry + typename Geometry, + typename Tag = typename tag_cast::type, multi_tag>::type > struct for_each_segment {}; template -struct for_each_segment +struct for_each_segment : detail::for_each::fe_point_per_segment {}; template -struct for_each_segment +struct for_each_segment : detail::for_each::fe_range_per_segment {}; template -struct for_each_segment +struct for_each_segment : detail::for_each::fe_range_per_segment {}; template -struct for_each_segment +struct for_each_segment : detail::for_each::fe_polygon_per_segment {}; @@ -232,11 +232,7 @@ inline Functor for_each_point(Geometry& geometry, Functor f) { concept::check(); - return dispatch::for_each_point - < - typename tag_cast::type, multi_tag>::type, - Geometry - >::apply(geometry, f); + return dispatch::for_each_point::apply(geometry, f); } @@ -258,11 +254,7 @@ inline Functor for_each_segment(Geometry& geometry, Functor f) { concept::check(); - return dispatch::for_each_segment - < - typename tag_cast::type, multi_tag>::type, - Geometry - >::apply(geometry, f); + return dispatch::for_each_segment::apply(geometry, f); } diff --git a/include/boost/geometry/multi/algorithms/for_each.hpp b/include/boost/geometry/multi/algorithms/for_each.hpp index cd542ffdf..8a1521039 100644 --- a/include/boost/geometry/multi/algorithms/for_each.hpp +++ b/include/boost/geometry/multi/algorithms/for_each.hpp @@ -60,16 +60,12 @@ namespace dispatch { template -struct for_each_point +struct for_each_point : detail::for_each::for_each_multi < // Specify the dispatch of the single-version as policy for_each_point < - typename single_tag_of - < - typename tag::type - >::type, typename add_const_if_c < is_const::value, @@ -81,16 +77,12 @@ struct for_each_point template -struct for_each_segment +struct for_each_segment : detail::for_each::for_each_multi < // Specify the dispatch of the single-version as policy for_each_segment < - typename single_tag_of - < - typename tag::type - >::type, typename add_const_if_c < is_const::value,