Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76347 - trunk/boost/geometry/multi/algorithms
From: bruno.lalande_at_[hidden]
Date: 2012-01-07 17:50:41


Author: bruno.lalande
Date: 2012-01-07 17:50:40 EST (Sat, 07 Jan 2012)
New Revision: 76347
URL: http://svn.boost.org/trac/boost/changeset/76347

Log:
Made distance dispatch classes for multi actually inherit from their underlying implementation to ensure not_implemented works.
Text files modified:
   trunk/boost/geometry/multi/algorithms/distance.hpp | 20 +++++++++++++++++++-
   1 files changed, 19 insertions(+), 1 deletions(-)

Modified: trunk/boost/geometry/multi/algorithms/distance.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/distance.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/distance.hpp 2012-01-07 17:50:40 EST (Sat, 07 Jan 2012)
@@ -36,6 +36,12 @@
 
 template<typename Geometry, typename MultiGeometry, typename Strategy>
 struct distance_single_to_multi
+ : private dispatch::distance
+ <
+ Geometry,
+ typename range_value<MultiGeometry>::type,
+ Strategy
+ >
 {
     typedef typename strategy::distance::services::return_type<Strategy>::type return_type;
 
@@ -50,7 +56,13 @@
                 it != boost::end(multi);
                 ++it)
         {
- return_type dist = geometry::distance(geometry, *it);
+ return_type dist = dispatch::distance
+ <
+ Geometry,
+ typename range_value<MultiGeometry>::type,
+ Strategy
+ >::apply(geometry, *it, strategy);
+
             if (first || dist < mindist)
             {
                 mindist = dist;
@@ -64,6 +76,12 @@
 
 template<typename Multi1, typename Multi2, typename Strategy>
 struct distance_multi_to_multi
+ : distance_single_to_multi
+ <
+ typename range_value<Multi1>::type,
+ Multi2,
+ Strategy
+ >
 {
     typedef typename strategy::distance::services::return_type<Strategy>::type return_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