|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r80922 - in trunk/boost/geometry: algorithms multi/algorithms
From: bruno.lalande_at_[hidden]
Date: 2012-10-09 19:19:55
Author: bruno.lalande
Date: 2012-10-09 19:19:54 EDT (Tue, 09 Oct 2012)
New Revision: 80922
URL: http://svn.boost.org/trac/boost/changeset/80922
Log:
Made dispatch::for_each able to retrieve the tag by itself.
Text files modified:
trunk/boost/geometry/algorithms/for_each.hpp | 36 ++++++++++++++----------------------
trunk/boost/geometry/multi/algorithms/for_each.hpp | 12 ++----------
2 files changed, 16 insertions(+), 32 deletions(-)
Modified: trunk/boost/geometry/algorithms/for_each.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/for_each.hpp (original)
+++ trunk/boost/geometry/algorithms/for_each.hpp 2012-10-09 19:19:54 EDT (Tue, 09 Oct 2012)
@@ -148,63 +148,63 @@
template
<
- typename Tag,
- typename Geometry
+ typename Geometry,
+ typename Tag = typename tag_cast<typename tag<Geometry>::type, multi_tag>::type
>
struct for_each_point {};
template <typename Point>
-struct for_each_point<point_tag, Point>
+struct for_each_point<Point, point_tag>
: detail::for_each::fe_point_per_point
{};
template <typename Linestring>
-struct for_each_point<linestring_tag, Linestring>
+struct for_each_point<Linestring, linestring_tag>
: detail::for_each::fe_range_per_point
{};
template <typename Ring>
-struct for_each_point<ring_tag, Ring>
+struct for_each_point<Ring, ring_tag>
: detail::for_each::fe_range_per_point
{};
template <typename Polygon>
-struct for_each_point<polygon_tag, Polygon>
+struct for_each_point<Polygon, polygon_tag>
: detail::for_each::fe_polygon_per_point
{};
template
<
- typename Tag,
- typename Geometry
+ typename Geometry,
+ typename Tag = typename tag_cast<typename tag<Geometry>::type, multi_tag>::type
>
struct for_each_segment {};
template <typename Point>
-struct for_each_segment<point_tag, Point>
+struct for_each_segment<Point, point_tag>
: detail::for_each::fe_point_per_segment
{};
template <typename Linestring>
-struct for_each_segment<linestring_tag, Linestring>
+struct for_each_segment<Linestring, linestring_tag>
: detail::for_each::fe_range_per_segment
{};
template <typename Ring>
-struct for_each_segment<ring_tag, Ring>
+struct for_each_segment<Ring, ring_tag>
: detail::for_each::fe_range_per_segment
{};
template <typename Polygon>
-struct for_each_segment<polygon_tag, Polygon>
+struct for_each_segment<Polygon, polygon_tag>
: detail::for_each::fe_polygon_per_segment
{};
@@ -232,11 +232,7 @@
{
concept::check<Geometry>();
- return dispatch::for_each_point
- <
- typename tag_cast<typename tag<Geometry>::type, multi_tag>::type,
- Geometry
- >::apply(geometry, f);
+ return dispatch::for_each_point<Geometry>::apply(geometry, f);
}
@@ -258,11 +254,7 @@
{
concept::check<Geometry>();
- return dispatch::for_each_segment
- <
- typename tag_cast<typename tag<Geometry>::type, multi_tag>::type,
- Geometry
- >::apply(geometry, f);
+ return dispatch::for_each_segment<Geometry>::apply(geometry, f);
}
Modified: trunk/boost/geometry/multi/algorithms/for_each.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/for_each.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/for_each.hpp 2012-10-09 19:19:54 EDT (Tue, 09 Oct 2012)
@@ -60,16 +60,12 @@
{
template <typename MultiGeometry>
-struct for_each_point<multi_tag, MultiGeometry>
+struct for_each_point<MultiGeometry, multi_tag>
: detail::for_each::for_each_multi
<
// Specify the dispatch of the single-version as policy
for_each_point
<
- typename single_tag_of
- <
- typename tag<MultiGeometry>::type
- >::type,
typename add_const_if_c
<
is_const<MultiGeometry>::value,
@@ -81,16 +77,12 @@
template <typename MultiGeometry>
-struct for_each_segment<multi_tag, MultiGeometry>
+struct for_each_segment<MultiGeometry, multi_tag>
: detail::for_each::for_each_multi
<
// Specify the dispatch of the single-version as policy
for_each_segment
<
- typename single_tag_of
- <
- typename tag<MultiGeometry>::type
- >::type,
typename add_const_if_c
<
is_const<MultiGeometry>::value,
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk