Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r80650 - trunk/boost/geometry/algorithms
From: bruno.lalande_at_[hidden]
Date: 2012-09-22 18:55:13


Author: bruno.lalande
Date: 2012-09-22 18:55:12 EDT (Sat, 22 Sep 2012)
New Revision: 80650
URL: http://svn.boost.org/trac/boost/changeset/80650

Log:
Moved Strategy from class level to function level in length.
Text files modified:
   trunk/boost/geometry/algorithms/length.hpp | 27 ++++++++++++++-------------
   1 files changed, 14 insertions(+), 13 deletions(-)

Modified: trunk/boost/geometry/algorithms/length.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/length.hpp (original)
+++ trunk/boost/geometry/algorithms/length.hpp 2012-09-22 18:55:12 EDT (Sat, 22 Sep 2012)
@@ -43,9 +43,10 @@
 {
 
 
-template<typename Segment, typename Strategy>
+template<typename Segment>
 struct segment_length
 {
+ template <typename Strategy>
     static inline typename default_length_result<Segment>::type apply(
             Segment const& segment, Strategy const& strategy)
     {
@@ -63,11 +64,12 @@
 \note for_each could be used here, now that point_type is changed by boost
     range iterator
 */
-template<typename Range, typename Strategy, closure_selector Closure>
+template<typename Range, closure_selector Closure>
 struct range_length
 {
     typedef typename default_length_result<Range>::type return_type;
 
+ template <typename Strategy>
     static inline return_type apply(
             Range const& range, Strategy const& strategy)
     {
@@ -106,11 +108,12 @@
 {
 
 
-template <typename Tag, typename Geometry, typename Strategy>
+template <typename Tag, typename Geometry>
 struct length : detail::calculate_null
 {
     typedef typename default_length_result<Geometry>::type return_type;
 
+ template <typename Strategy>
     static inline return_type apply(Geometry const& geometry, Strategy const& strategy)
     {
         return calculate_null::apply<return_type>(geometry, strategy);
@@ -118,18 +121,18 @@
 };
 
 
-template <typename Geometry, typename Strategy>
-struct length<linestring_tag, Geometry, Strategy>
- : detail::length::range_length<Geometry, Strategy, closed>
+template <typename Geometry>
+struct length<linestring_tag, Geometry>
+ : detail::length::range_length<Geometry, closed>
 {};
 
 
 // RING: length is currently 0; it might be argued that it is the "perimeter"
 
 
-template <typename Geometry, typename Strategy>
-struct length<segment_tag, Geometry, Strategy>
- : detail::length::segment_length<Geometry, Strategy>
+template <typename Geometry>
+struct length<segment_tag, Geometry>
+ : detail::length::segment_length<Geometry>
 {};
 
 
@@ -164,8 +167,7 @@
     return dispatch::length
         <
             typename tag<Geometry>::type,
- Geometry,
- strategy_type
+ Geometry
>::apply(geometry, strategy_type());
 }
 
@@ -195,8 +197,7 @@
     return dispatch::length
         <
             typename tag<Geometry>::type,
- Geometry,
- Strategy
+ Geometry
>::apply(geometry, 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