Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76206 - in trunk/boost/geometry: algorithms multi/algorithms
From: bruno.lalande_at_[hidden]
Date: 2011-12-28 05:30:04


Author: bruno.lalande
Date: 2011-12-28 05:30:03 EST (Wed, 28 Dec 2011)
New Revision: 76206
URL: http://svn.boost.org/trac/boost/changeset/76206

Log:
Made dispatch::area able to retrieve the geometry tag by itself.
Text files modified:
   trunk/boost/geometry/algorithms/area.hpp | 12 +++++-------
   trunk/boost/geometry/multi/algorithms/area.hpp | 6 +++---
   2 files changed, 8 insertions(+), 10 deletions(-)

Modified: trunk/boost/geometry/algorithms/area.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/area.hpp (original)
+++ trunk/boost/geometry/algorithms/area.hpp 2011-12-28 05:30:03 EST (Wed, 28 Dec 2011)
@@ -135,9 +135,9 @@
 
 template
 <
- typename Tag,
     typename Geometry,
- typename Strategy
+ typename Strategy,
+ typename Tag = typename tag<Geometry>::type
>
 struct area
     : detail::calculate_null
@@ -153,7 +153,7 @@
     typename Geometry,
     typename Strategy
>
-struct area<box_tag, Geometry, Strategy>
+struct area<Geometry, Strategy, box_tag>
     : detail::area::box_area<Geometry, Strategy>
 {};
 
@@ -163,7 +163,7 @@
     typename Ring,
     typename Strategy
>
-struct area<ring_tag, Ring, Strategy>
+struct area<Ring, Strategy, ring_tag>
     : detail::area::ring_area
         <
             Ring,
@@ -179,7 +179,7 @@
     typename Polygon,
     typename Strategy
>
-struct area<polygon_tag, Polygon, Strategy>
+struct area<Polygon, Strategy, polygon_tag>
     : detail::calculate_polygon_sum
         <
             typename Strategy::return_type,
@@ -236,7 +236,6 @@
 
     return dispatch::area
         <
- typename tag<Geometry>::type,
             Geometry,
             strategy_type
>::apply(geometry, strategy_type());
@@ -274,7 +273,6 @@
 
     return dispatch::area
         <
- typename tag<Geometry>::type,
             Geometry,
             Strategy
>::apply(geometry, strategy);

Modified: trunk/boost/geometry/multi/algorithms/area.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/area.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/area.hpp 2011-12-28 05:30:03 EST (Wed, 28 Dec 2011)
@@ -30,7 +30,7 @@
 namespace dispatch
 {
 template <typename MultiGeometry, typename Strategy>
-struct area<multi_polygon_tag, MultiGeometry, Strategy>
+struct area<MultiGeometry, Strategy, multi_polygon_tag>
     : detail::multi_sum
         <
             typename Strategy::return_type,
@@ -38,9 +38,9 @@
             Strategy,
             area
                 <
- polygon_tag,
                     typename boost::range_value<MultiGeometry>::type,
- Strategy
+ Strategy,
+ polygon_tag
>
>
 {};


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