Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80161 - in trunk/boost/geometry: algorithms multi/algorithms
From: bruno.lalande_at_[hidden]
Date: 2012-08-23 16:19:12


Author: bruno.lalande
Date: 2012-08-23 16:19:11 EDT (Thu, 23 Aug 2012)
New Revision: 80161
URL: http://svn.boost.org/trac/boost/changeset/80161

Log:
Made dispatch::transform able to retrieve the tags by itself.
Text files modified:
   trunk/boost/geometry/algorithms/transform.hpp | 28 +++++++++++-----------------
   trunk/boost/geometry/multi/algorithms/transform.hpp | 12 ++----------
   2 files changed, 13 insertions(+), 27 deletions(-)

Modified: trunk/boost/geometry/algorithms/transform.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/transform.hpp (original)
+++ trunk/boost/geometry/algorithms/transform.hpp 2012-08-23 16:19:11 EDT (Thu, 23 Aug 2012)
@@ -231,14 +231,15 @@
 
 template
 <
- typename Tag1, typename Tag2,
     typename Geometry1, typename Geometry2,
- typename Strategy
+ typename Strategy,
+ typename Tag1 = typename tag_cast<typename tag<Geometry1>::type, multi_tag>::type,
+ typename Tag2 = typename tag_cast<typename tag<Geometry2>::type, multi_tag>::type
>
 struct transform {};
 
 template <typename Point1, typename Point2, typename Strategy>
-struct transform<point_tag, point_tag, Point1, Point2, Strategy>
+struct transform<Point1, Point2, Strategy, point_tag, point_tag>
     : detail::transform::transform_point
 {
 };
@@ -247,33 +248,33 @@
 template <typename Linestring1, typename Linestring2, typename Strategy>
 struct transform
     <
- linestring_tag, linestring_tag,
- Linestring1, Linestring2, Strategy
+ Linestring1, Linestring2, Strategy,
+ linestring_tag, linestring_tag
>
     : detail::transform::transform_range
 {
 };
 
 template <typename Range1, typename Range2, typename Strategy>
-struct transform<ring_tag, ring_tag, Range1, Range2, Strategy>
+struct transform<Range1, Range2, Strategy, ring_tag, ring_tag>
     : detail::transform::transform_range
 {
 };
 
 template <typename Polygon1, typename Polygon2, typename Strategy>
-struct transform<polygon_tag, polygon_tag, Polygon1, Polygon2, Strategy>
+struct transform<Polygon1, Polygon2, Strategy, polygon_tag, polygon_tag>
     : detail::transform::transform_polygon
 {
 };
 
 template <typename Box1, typename Box2, typename Strategy>
-struct transform<box_tag, box_tag, Box1, Box2, Strategy>
+struct transform<Box1, Box2, Strategy, box_tag, box_tag>
     : detail::transform::transform_box
 {
 };
 
 template <typename Segment1, typename Segment2, typename Strategy>
-struct transform<segment_tag, segment_tag, Segment1, Segment2, Strategy>
+struct transform<Segment1, Segment2, Strategy, segment_tag, segment_tag>
     : detail::transform::transform_box_or_segment
 {
 };
@@ -305,14 +306,7 @@
     concept::check<Geometry1 const>();
     concept::check<Geometry2>();
 
- typedef dispatch::transform
- <
- typename tag_cast<typename tag<Geometry1>::type, multi_tag>::type,
- typename tag_cast<typename tag<Geometry2>::type, multi_tag>::type,
- Geometry1,
- Geometry2,
- Strategy
- > transform_type;
+ typedef dispatch::transform<Geometry1, Geometry2, Strategy> transform_type;
 
     return transform_type::apply(geometry1, geometry2, strategy);
 }

Modified: trunk/boost/geometry/multi/algorithms/transform.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/transform.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/transform.hpp 2012-08-23 16:19:11 EDT (Thu, 23 Aug 2012)
@@ -68,22 +68,14 @@
 template <typename Multi1, typename Multi2, typename Strategy>
 struct transform
     <
- multi_tag, multi_tag,
         Multi1, Multi2,
- Strategy
+ Strategy,
+ multi_tag, multi_tag
>
     : detail::transform::transform_multi
         <
             transform
                 <
- typename single_tag_of
- <
- typename tag<Multi1>::type
- >::type,
- typename single_tag_of
- <
- typename tag<Multi2>::type
- >::type,
                     typename boost::range_value<Multi1>::type,
                     typename boost::range_value<Multi2>::type,
                     Strategy


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