Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r68703 - in trunk/boost/geometry: algorithms/detail/sections multi/core
From: barend.gehrels_at_[hidden]
Date: 2011-02-07 15:51:36


Author: barendgehrels
Date: 2011-02-07 15:51:35 EST (Mon, 07 Feb 2011)
New Revision: 68703
URL: http://svn.boost.org/trac/boost/changeset/68703

Log:
Propagate constness in metafunction ring_return_type
Text files modified:
   trunk/boost/geometry/algorithms/detail/sections/range_by_section.hpp | 2 --
   trunk/boost/geometry/multi/core/ring_type.hpp | 21 +++++++++++++--------
   2 files changed, 13 insertions(+), 10 deletions(-)

Modified: trunk/boost/geometry/algorithms/detail/sections/range_by_section.hpp
==============================================================================
--- trunk/boost/geometry/algorithms/detail/sections/range_by_section.hpp (original)
+++ trunk/boost/geometry/algorithms/detail/sections/range_by_section.hpp 2011-02-07 15:51:35 EST (Mon, 07 Feb 2011)
@@ -40,8 +40,6 @@
 template <typename Polygon, typename Section>
 struct full_section_polygon
 {
- typedef typename geometry::ring_type<Polygon>::type ring_type;
-
     static inline typename ring_return_type<Polygon const>::type apply(Polygon const& polygon, Section const& section)
     {
         return section.ring_index < 0

Modified: trunk/boost/geometry/multi/core/ring_type.hpp
==============================================================================
--- trunk/boost/geometry/multi/core/ring_type.hpp (original)
+++ trunk/boost/geometry/multi/core/ring_type.hpp 2011-02-07 15:51:35 EST (Mon, 07 Feb 2011)
@@ -26,26 +26,31 @@
 {
 
 template <typename MultiPolygon>
-struct ring_type<multi_polygon_tag, MultiPolygon>
+struct ring_return_type<multi_polygon_tag, MultiPolygon>
 {
- typedef typename geometry::ring_type
+ typedef typename ring_return_type
         <
- typename boost::range_value<MultiPolygon>::type
+ polygon_tag,
+ typedef typename mpl::if_
+ <
+ boost::is_const<MultiPolygon>,
+ typename boost::range_value<MultiPolygon>::type const,
+ typename boost::range_value<MultiPolygon>::type
+ >::type
>::type type;
 };
 
+
 template <typename MultiPolygon>
-struct ring_return_type<multi_polygon_tag, MultiPolygon>
+struct ring_type<multi_polygon_tag, MultiPolygon>
 {
- typedef typename ring_return_type
+ typedef typename boost::remove_reference
         <
- polygon_tag,
- typename boost::range_value<MultiPolygon>::type
+ typename ring_return_type<multi_polygon_tag, MultiPolygon>::type
>::type type;
 };
 
 
-
 } // namespace core_dispatch
 #endif
 


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