Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80652 - in trunk/boost/geometry: algorithms multi/algorithms
From: bruno.lalande_at_[hidden]
Date: 2012-09-22 19:15:07


Author: bruno.lalande
Date: 2012-09-22 19:15:06 EDT (Sat, 22 Sep 2012)
New Revision: 80652
URL: http://svn.boost.org/trac/boost/changeset/80652

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

Modified: trunk/boost/geometry/algorithms/length.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/length.hpp (original)
+++ trunk/boost/geometry/algorithms/length.hpp 2012-09-22 19:15:06 EDT (Sat, 22 Sep 2012)
@@ -108,7 +108,7 @@
 {
 
 
-template <typename Tag, typename Geometry>
+template <typename Geometry, typename Tag = typename tag<Geometry>::type>
 struct length : detail::calculate_null
 {
     typedef typename default_length_result<Geometry>::type return_type;
@@ -122,7 +122,7 @@
 
 
 template <typename Geometry>
-struct length<linestring_tag, Geometry>
+struct length<Geometry, linestring_tag>
     : detail::length::range_length<Geometry, closed>
 {};
 
@@ -131,7 +131,7 @@
 
 
 template <typename Geometry>
-struct length<segment_tag, Geometry>
+struct length<Geometry, segment_tag>
     : detail::length::segment_length<Geometry>
 {};
 
@@ -164,11 +164,7 @@
             point_tag, typename point_type<Geometry>::type
>::type strategy_type;
 
- return dispatch::length
- <
- typename tag<Geometry>::type,
- Geometry
- >::apply(geometry, strategy_type());
+ return dispatch::length<Geometry>::apply(geometry, strategy_type());
 }
 
 
@@ -194,11 +190,7 @@
 
     // detail::throw_on_empty_input(geometry);
     
- return dispatch::length
- <
- typename tag<Geometry>::type,
- Geometry
- >::apply(geometry, strategy);
+ return dispatch::length<Geometry>::apply(geometry, strategy);
 }
 
 

Modified: trunk/boost/geometry/multi/algorithms/length.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/length.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/length.hpp 2012-09-22 19:15:06 EDT (Sat, 22 Sep 2012)
@@ -31,7 +31,7 @@
 {
 
 template <typename MultiLinestring>
-struct length<multi_linestring_tag, MultiLinestring> : detail::multi_sum
+struct length<MultiLinestring, multi_linestring_tag> : detail::multi_sum
 {
     template <typename Strategy>
     static inline typename default_length_result<MultiLinestring>::type


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