Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76964 - trunk/boost/geometry/multi/algorithms
From: barend.gehrels_at_[hidden]
Date: 2012-02-10 15:44:26


Author: barendgehrels
Date: 2012-02-10 15:44:25 EST (Fri, 10 Feb 2012)
New Revision: 76964
URL: http://svn.boost.org/trac/boost/changeset/76964

Log:
Boost.Geometry fix - multi_centroid should have same throwing behaviour as centroid
Text files modified:
   trunk/boost/geometry/multi/algorithms/centroid.hpp | 4 ++--
   1 files changed, 2 insertions(+), 2 deletions(-)

Modified: trunk/boost/geometry/multi/algorithms/centroid.hpp
==============================================================================
--- trunk/boost/geometry/multi/algorithms/centroid.hpp (original)
+++ trunk/boost/geometry/multi/algorithms/centroid.hpp 2012-02-10 15:44:25 EST (Fri, 10 Feb 2012)
@@ -18,9 +18,7 @@
 #include <boost/range.hpp>
 
 #include <boost/geometry/algorithms/centroid.hpp>
-#include <boost/geometry/algorithms/num_points.hpp>
 #include <boost/geometry/multi/core/point_type.hpp>
-#include <boost/geometry/multi/algorithms/detail/multi_sum.hpp>
 #include <boost/geometry/multi/algorithms/num_points.hpp>
 
 
@@ -73,12 +71,14 @@
     static inline void apply(Multi const& multi, Point& centroid,
             Strategy const& strategy)
     {
+#if ! defined(BOOST_GEOMETRY_CENTROID_NO_THROW)
         // If there is nothing in any of the ranges, it is not possible
         // to calculate the centroid
         if (geometry::num_points(multi) == 0)
         {
             throw centroid_exception();
         }
+#endif
 
         typename Strategy::state_type state;
 


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