Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r67167 - in sandbox/geometry/boost/geometry: algorithms algorithms/detail algorithms/detail/equals algorithms/detail/overlay algorithms/detail/sections extensions/algorithms extensions/algorithms/buffer extensions/gis/io/shapelib extensions/gis/io/veshape extensions/gis/io/wkt extensions/io/svg util
From: barend.gehrels_at_[hidden]
Date: 2010-12-11 09:03:57


Author: barendgehrels
Date: 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
New Revision: 67167
URL: http://svn.boost.org/trac/boost/changeset/67167

Log:
Changed loops to BOOST_AUTO in preparation of change in concept of interior_rings/return_type
Text files modified:
   sandbox/geometry/boost/geometry/algorithms/centroid.hpp | 6 -
   sandbox/geometry/boost/geometry/algorithms/correct.hpp | 19 ++---
   sandbox/geometry/boost/geometry/algorithms/detail/calculate_sum.hpp | 6 -
   sandbox/geometry/boost/geometry/algorithms/detail/equals/collect_vectors.hpp | 6 -
   sandbox/geometry/boost/geometry/algorithms/detail/overlay/add_to_containment.hpp | 6 -
   sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp | 8 -
   sandbox/geometry/boost/geometry/algorithms/detail/overlay/split_rings.hpp | 17 +---
   sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp | 9 --
   sandbox/geometry/boost/geometry/algorithms/distance.hpp | 6 -
   sandbox/geometry/boost/geometry/algorithms/for_each.hpp | 17 ----
   sandbox/geometry/boost/geometry/algorithms/num_points.hpp | 8 -
   sandbox/geometry/boost/geometry/algorithms/reverse.hpp | 6 -
   sandbox/geometry/boost/geometry/algorithms/simplify.hpp | 18 +----
   sandbox/geometry/boost/geometry/algorithms/transform.hpp | 23 +-----
   sandbox/geometry/boost/geometry/algorithms/unique.hpp | 6 -
   sandbox/geometry/boost/geometry/algorithms/within.hpp | 8 -
   sandbox/geometry/boost/geometry/extensions/algorithms/buffer/polygon_buffer.hpp | 6 -
   sandbox/geometry/boost/geometry/extensions/algorithms/remove_holes_if.hpp | 3
   sandbox/geometry/boost/geometry/extensions/algorithms/remove_spikes.hpp | 6 -
   sandbox/geometry/boost/geometry/extensions/gis/io/shapelib/shp_create_object.hpp | 124 +++++++++++++++++++--------------------
   sandbox/geometry/boost/geometry/extensions/gis/io/veshape/write_veshape.hpp | 2
   sandbox/geometry/boost/geometry/extensions/gis/io/wkt/write_wkt.hpp | 7 -
   sandbox/geometry/boost/geometry/extensions/io/svg/write_svg.hpp | 10 --
   sandbox/geometry/boost/geometry/util/write_dsv.hpp | 7 -
   24 files changed, 123 insertions(+), 211 deletions(-)

Modified: sandbox/geometry/boost/geometry/algorithms/centroid.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/centroid.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/centroid.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -14,6 +14,7 @@
 #include <cstddef>
 
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/core/closure.hpp>
 #include <boost/geometry/core/cs.hpp>
@@ -258,10 +259,7 @@
 
         per_ring::apply(exterior_ring(poly), strategy, state);
 
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type it = boost::begin(interior_rings(poly));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(poly)));
              it != boost::end(interior_rings(poly));
              ++it)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/correct.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/correct.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/correct.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -16,6 +16,7 @@
 
 #include <boost/mpl/assert.hpp>
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/core/closure.hpp>
 #include <boost/geometry/core/cs.hpp>
@@ -159,22 +160,18 @@
     {
         correct_ring
             <
- ring_type,
- std::less<coordinate_type>
+ ring_type,
+ std::less<coordinate_type>
>::apply(exterior_ring(poly));
 
- typedef typename boost::range_iterator
- <
- typename interior_type<Polygon>::type
- >::type iterator_type;
-
- for (iterator_type it = boost::begin(interior_rings(poly));
- it != boost::end(interior_rings(poly)); ++it)
+ for (BOOST_AUTO(it, boost::begin(interior_rings(poly)));
+ it != boost::end(interior_rings(poly));
+ ++it)
         {
             correct_ring
                 <
- ring_type,
- std::greater<coordinate_type>
+ ring_type,
+ std::greater<coordinate_type>
>::apply(*it);
         }
     }

Modified: sandbox/geometry/boost/geometry/algorithms/detail/calculate_sum.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/calculate_sum.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/calculate_sum.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -10,6 +10,7 @@
 
 
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 namespace boost { namespace geometry
 {
@@ -32,10 +33,7 @@
     {
         ReturnType sum = Policy::apply(exterior_ring(poly), strategy);
 
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type it = boost::begin(interior_rings(poly));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(poly)));
              it != boost::end(interior_rings(poly));
              ++it)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/detail/equals/collect_vectors.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/equals/collect_vectors.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/equals/collect_vectors.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -13,6 +13,7 @@
 
 #include <boost/numeric/conversion/cast.hpp>
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/multi/core/tags.hpp>
 
@@ -180,10 +181,7 @@
         typedef range_collect_vectors<ring_type, Collection> per_range;
         per_range::apply(collection, exterior_ring(polygon));
 
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type it = boost::begin(interior_rings(polygon));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
              it != boost::end(interior_rings(polygon));
              ++it)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/add_to_containment.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/add_to_containment.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/add_to_containment.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -11,6 +11,7 @@
 
 #include <boost/mpl/assert.hpp>
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 
 #include <boost/geometry/core/tags.hpp>
@@ -95,10 +96,7 @@
 
         policy::apply(container, copy, exterior_ring(polygon), map, dissolve);
         copy.ring_index = 0;
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type it = boost::begin(interior_rings(polygon));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
             it != boost::end(interior_rings(polygon));
             ++it, ++copy.ring_index)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/get_turns.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -15,6 +15,7 @@
 #include <boost/array.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/tuple/tuple.hpp>
 
@@ -679,11 +680,6 @@
     {
         typedef typename geometry::ring_type<Polygon>::type ring_type;
 
- typedef typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type iterator_type;
-
         typedef detail::get_turns::get_turns_cs
             <
                 ring_type,
@@ -699,7 +695,7 @@
                 multi_index, -1);
 
         int i = 0;
- for (iterator_type it = boost::begin(interior_rings(polygon));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
              it != boost::end(interior_rings(polygon));
              ++it, ++i)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/detail/overlay/split_rings.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/overlay/split_rings.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/overlay/split_rings.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -15,6 +15,7 @@
 #include <string>
 
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/algorithms/detail/overlay/get_turns.hpp>
 
@@ -25,11 +26,10 @@
 #include <boost/geometry/util/math.hpp>
 
 #include <boost/geometry/algorithms/intersects.hpp>
-
 #include <boost/geometry/algorithms/detail/overlay/turn_info.hpp>
-
 #include <boost/geometry/geometries/concepts/check.hpp>
 
+
 #if defined(BOOST_GEOMETRY_DEBUG_SPLIT_RINGS) || defined(BOOST_GEOMETRY_CHECK_SPLIT_RINGS)
 # include <boost/geometry/extensions/gis/io/wkt/wkt.hpp>
 #endif
@@ -182,11 +182,9 @@
 {
     static inline void apply(RingCollection& ring_collection, Polygon const& polygon)
     {
- ring_collection.push_back(exterior_ring(polygon));
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type it = boost::begin(interior_rings(polygon));
+ ring_collection.push_back(exterior_ring(polygon));
+
+ for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
              it != boost::end(interior_rings(polygon));
              ++it)
         {
@@ -496,10 +494,7 @@
     static inline void apply(Polygon const& polygon, RingCollection& ring_collection)
     {
         per_ring::apply(exterior_ring(polygon), ring_collection);
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type it = boost::begin(interior_rings(polygon));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
              it != boost::end(interior_rings(polygon));
              ++it)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/detail/sections/sectionalize.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -14,6 +14,7 @@
 
 #include <boost/mpl/assert.hpp>
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/algorithms/assign.hpp>
 #include <boost/geometry/algorithms/combine.hpp>
@@ -24,7 +25,6 @@
 #include <boost/geometry/core/point_order.hpp>
 
 #include <boost/geometry/geometries/concepts/check.hpp>
-
 #include <boost/geometry/util/math.hpp>
 #include <boost/geometry/util/closeable_view.hpp>
 #include <boost/geometry/geometries/segment.hpp>
@@ -420,15 +420,10 @@
                 point_type, Sections, DimensionCount, MaxCount
> sectionalizer_type;
 
- typedef typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type iterator_type;
-
         sectionalizer_type::apply(exterior_ring(poly), sections, -1, multi_index);
 
         int i = 0;
- for (iterator_type it = boost::begin(interior_rings(poly));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(poly)));
              it != boost::end(interior_rings(poly));
              ++it, ++i)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/distance.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/distance.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/distance.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -12,6 +12,7 @@
 
 #include <boost/mpl/if.hpp>
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/static_assert.hpp>
 
@@ -212,10 +213,7 @@
         distance_containment dc = per_ring::apply(point,
                         exterior_ring(polygon), pp_strategy, ps_strategy);
 
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type it = boost::begin(interior_rings(polygon));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
              it != boost::end(interior_rings(polygon));
              ++it)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/for_each.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/for_each.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/for_each.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -13,6 +13,7 @@
 #include <algorithm>
 
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/core/exterior_ring.hpp>
 #include <boost/geometry/core/interior_rings.hpp>
@@ -109,12 +110,6 @@
                 typename add_const_if_c<IsConst, Polygon>::type& poly,
                 Functor f)
     {
- typedef typename range_iterator_const_if_c
- <
- IsConst,
- typename interior_type<Polygon>::type
- >::type iterator_type;
-
         typedef fe_range_per_point
                 <
                     typename ring_type<Polygon>::type,
@@ -124,7 +119,7 @@
 
         f = per_ring::apply(exterior_ring(poly), f);
 
- for (iterator_type it = boost::begin(interior_rings(poly));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(poly)));
              it != boost::end(interior_rings(poly));
              ++it)
         {
@@ -144,12 +139,6 @@
                 typename add_const_if_c<IsConst, Polygon>::type& poly,
                 Functor f)
     {
- typedef typename range_iterator_const_if_c
- <
- IsConst,
- typename interior_type<Polygon>::type
- >::type iterator_type;
-
         typedef fe_range_per_segment
             <
                 typename ring_type<Polygon>::type,
@@ -159,7 +148,7 @@
 
         f = per_ring::apply(exterior_ring(poly), f);
 
- for (iterator_type it = boost::begin(interior_rings(poly));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(poly)));
              it != boost::end(interior_rings(poly));
              ++it)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/num_points.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/num_points.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/num_points.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -13,6 +13,7 @@
 
 #include <boost/mpl/assert.hpp>
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/core/closure.hpp>
 #include <boost/geometry/core/is_linear.hpp>
@@ -73,12 +74,7 @@
         std::size_t n = range_count<ring_type>::apply(
                     exterior_ring(poly), add_for_open);
 
- typedef typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type iterator;
-
- for (iterator it = boost::begin(interior_rings(poly));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(poly)));
              it != boost::end(interior_rings(poly));
              ++it)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/reverse.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/reverse.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/reverse.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -11,6 +11,7 @@
 #include <algorithm>
 
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/core/interior_rings.hpp>
 #include <boost/geometry/geometries/concepts/check.hpp>
@@ -45,10 +46,7 @@
         typedef range_reverse<ring_type> per_range;
         per_range::apply(exterior_ring(polygon));
 
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type
- >::type it = boost::begin(interior_rings(polygon));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
              it != boost::end(interior_rings(polygon));
              ++it)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/simplify.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/simplify.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/simplify.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -13,6 +13,7 @@
 #include <cstddef>
 
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/core/cs.hpp>
 #include <boost/geometry/core/ring_type.hpp>
@@ -20,7 +21,6 @@
 #include <boost/geometry/core/interior_rings.hpp>
 
 #include <boost/geometry/geometries/concepts/check.hpp>
-
 #include <boost/geometry/strategies/agnostic/simplify_douglas_peucker.hpp>
 #include <boost/geometry/strategies/concepts/simplify_concept.hpp>
 
@@ -116,15 +116,6 @@
     {
         typedef typename ring_type<Polygon>::type ring_type;
 
- typedef typename boost::range_iterator
- <
- typename interior_type<Polygon>::type
- >::type iterator_type;
- typedef typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type const_iterator_type;
-
         // Note that if there are inner rings, and distance is too large,
         // they might intersect with the outer ring in the output,
         // while it didn't in the input.
@@ -133,12 +124,11 @@
                         max_distance, strategy);
 
         // Note: here a resizeable container is assumed.
- // Maybe we should make this part of the concept.
+ // TODO: we should make this part of the concept.
         interior_rings(poly_out).resize(num_interior_rings(poly_in));
 
- iterator_type it_out = boost::begin(interior_rings(poly_out));
-
- for (const_iterator_type it_in = boost::begin(interior_rings(poly_in));
+ BOOST_AUTO(it_out, boost::begin(interior_rings(poly_out)));
+ for (BOOST_AUTO(it_in, boost::begin(interior_rings(poly_in)));
             it_in != boost::end(interior_rings(poly_in));
             ++it_in, ++it_out)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/transform.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/transform.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/transform.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -13,6 +13,7 @@
 #include <iterator>
 
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/algorithms/clear.hpp>
 #include <boost/geometry/algorithms/assign.hpp>
@@ -21,9 +22,7 @@
 #include <boost/geometry/core/exterior_ring.hpp>
 #include <boost/geometry/core/interior_rings.hpp>
 #include <boost/geometry/core/ring_type.hpp>
-
 #include <boost/geometry/geometries/concepts/check.hpp>
-
 #include <boost/geometry/strategies/transform.hpp>
 
 
@@ -122,8 +121,6 @@
     static inline bool apply(Polygon1 const& poly1, Polygon2& poly2,
                 Strategy const& strategy)
     {
- typedef typename interior_type<Polygon1>::type interior1_type;
- typedef typename interior_type<Polygon2>::type interior2_type;
         typedef typename ring_type<Polygon1>::type ring1_type;
         typedef typename ring_type<Polygon2>::type ring2_type;
         typedef typename point_type<Polygon2>::type point2_type;
@@ -136,21 +133,13 @@
             return false;
         }
 
+ // Note: here a resizeable container is assumed.
+ // TODO: we should make this part of the concept.
         interior_rings(poly2).resize(num_interior_rings(poly1));
 
- typedef typename boost::range_iterator
- <
- interior1_type const
- >::type iterator1_type;
- typedef typename boost::range_iterator
- <
- interior2_type
- >::type iterator2_type;
-
- iterator1_type it1 = boost::begin(interior_rings(poly1));
- iterator2_type it2 = boost::begin(interior_rings(poly2));
- for ( ; it1 != boost::end(interior_rings(poly1));
- ++it1, ++it2)
+ BOOST_AUTO(it1, boost::begin(interior_rings(poly1)));
+ BOOST_AUTO(it2, boost::begin(interior_rings(poly2)));
+ for ( ; it1 != boost::end(interior_rings(poly1)); ++it1, ++it2)
         {
             if (!transform_range_out<point2_type>(*it1,
                 std::back_inserter(*it2), strategy))

Modified: sandbox/geometry/boost/geometry/algorithms/unique.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/unique.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/unique.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -11,6 +11,7 @@
 #include <algorithm>
 
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/core/interior_rings.hpp>
 #include <boost/geometry/geometries/concepts/check.hpp>
@@ -56,10 +57,7 @@
         typedef range_unique<ring_type, ComparePolicy> per_range;
         per_range::apply(exterior_ring(polygon), policy);
 
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type
- >::type it = boost::begin(interior_rings(polygon));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
              it != boost::end(interior_rings(polygon));
              ++it)
         {

Modified: sandbox/geometry/boost/geometry/algorithms/within.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/algorithms/within.hpp (original)
+++ sandbox/geometry/boost/geometry/algorithms/within.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -12,8 +12,9 @@
 
 #include <cstddef>
 
-#include <boost/range.hpp>
 #include <boost/mpl/assert.hpp>
+#include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/algorithms/make.hpp>
 
@@ -216,10 +217,7 @@
 
         if (code == 1)
         {
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type it = boost::begin(interior_rings(poly));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(poly)));
                  it != boost::end(interior_rings(poly));
                  ++it)
             {

Modified: sandbox/geometry/boost/geometry/extensions/algorithms/buffer/polygon_buffer.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/algorithms/buffer/polygon_buffer.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/algorithms/buffer/polygon_buffer.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -13,6 +13,7 @@
 #include <boost/numeric/conversion/cast.hpp>
 
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/core/point_type.hpp>
 
@@ -203,10 +204,7 @@
 #endif
                 );
 
- for (typename boost::range_iterator
- <
- typename interior_type<PolygonInput>::type const
- >::type it = boost::begin(interior_rings(polygon));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
              it != boost::end(interior_rings(polygon));
              ++it)
         {

Modified: sandbox/geometry/boost/geometry/extensions/algorithms/remove_holes_if.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/algorithms/remove_holes_if.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/algorithms/remove_holes_if.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -38,7 +38,8 @@
 {
     static inline void apply(Polygon& poly, Predicate const& predicate)
     {
- typename interior_type<Polygon>::type& rings = interior_rings(poly);
+ // TODO: evaluate this behaviour w.r.t. writable concepts
+ typename interior_return_type<Polygon>::type rings = interior_rings(poly);
 
         // Remove rings using erase-remove-idiom
         // http://en.wikipedia.org/wiki/Erase-remove_idiom

Modified: sandbox/geometry/boost/geometry/extensions/algorithms/remove_spikes.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/algorithms/remove_spikes.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/algorithms/remove_spikes.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -12,6 +12,7 @@
 #include <deque>
 
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/multi/core/tags.hpp>
 
@@ -127,10 +128,7 @@
         typedef range_remove_spikes<ring_type, Policy> per_range;
         per_range::apply(exterior_ring(polygon), policy);
 
- for (typename boost::range_iterator
- <
- typename interior_type<Polygon>::type
- >::type it = boost::begin(interior_rings(polygon));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
              it != boost::end(interior_rings(polygon));
              ++it)
         {

Modified: sandbox/geometry/boost/geometry/extensions/gis/io/shapelib/shp_create_object.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/gis/io/shapelib/shp_create_object.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/gis/io/shapelib/shp_create_object.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -12,6 +12,7 @@
 #include <boost/mpl/assert.hpp>
 #include <boost/range.hpp>
 #include <boost/scoped_array.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/core/exterior_ring.hpp>
 #include <boost/geometry/core/interior_rings.hpp>
@@ -36,16 +37,16 @@
 template <typename Point>
 struct shape_create_point
 {
-
+
     static inline SHPObject* apply(Point const& point)
     {
- double x = get<0>(point);
- double y = get<1>(point);
+ double x = get<0>(point);
+ double y = get<1>(point);
 
- int const parts = 0;
+ int const parts = 0;
 
- return ::SHPCreateObject(SHPT_POINT, -1, 1, &parts, NULL,
- 1, &x, &y, NULL, NULL);
+ return ::SHPCreateObject(SHPT_POINT, -1, 1, &parts, NULL,
+ 1, &x, &y, NULL, NULL);
     }
 };
 
@@ -53,19 +54,19 @@
 template <typename Range>
 static inline int range_to_part(Range const& range, double* x, double* y, int offset = 0)
 {
- x += offset;
- y += offset;
+ x += offset;
+ y += offset;
 
- for (typename boost::range_iterator<Range const>::type
- it = boost::begin(range);
- it != boost::end(range);
- ++it, ++x, ++y)
- {
- *x = get<0>(*it);
- *y = get<1>(*it);
- offset++;
+ for (typename boost::range_iterator<Range const>::type
+ it = boost::begin(range);
+ it != boost::end(range);
+ ++it, ++x, ++y)
+ {
+ *x = get<0>(*it);
+ *y = get<1>(*it);
+ offset++;
     }
- return offset;
+ return offset;
 }
 
 
@@ -76,15 +77,15 @@
     {
         int const n = boost::size(range);
 
- boost::scoped_array<double> x(new double[n]);
- boost::scoped_array<double> y(new double[n]);
+ boost::scoped_array<double> x(new double[n]);
+ boost::scoped_array<double> y(new double[n]);
 
- range_to_part(range, x.get(), y.get());
-
- int const parts = 0;
+ range_to_part(range, x.get(), y.get());
 
- return ::SHPCreateObject(ShapeType, -1, 1, &parts, NULL,
- n, x.get(), y.get(), NULL, NULL);
+ int const parts = 0;
+
+ return ::SHPCreateObject(ShapeType, -1, 1, &parts, NULL,
+ n, x.get(), y.get(), NULL, NULL);
     }
 };
 
@@ -92,44 +93,39 @@
 template <typename Polygon>
 struct shape_create_polygon
 {
- static inline void process_polygon(Polygon const& polygon,
- double* xp, double* yp, int* parts,
- int& offset, int& ring)
- {
- parts[ring++] = offset;
- offset = range_to_part(geometry::exterior_ring(polygon), xp, yp, offset);
-
- typedef typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type iterator;
+ static inline void process_polygon(Polygon const& polygon,
+ double* xp, double* yp, int* parts,
+ int& offset, int& ring)
+ {
+ parts[ring++] = offset;
+ offset = range_to_part(geometry::exterior_ring(polygon), xp, yp, offset);
 
- for (iterator it = boost::begin(geometry::interior_rings(polygon));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(polygon)));
              it != boost::end(interior_rings(polygon));
              ++it)
         {
- parts[ring++] = offset;
+ parts[ring++] = offset;
             offset = range_to_part(*it, xp, yp, offset);
         }
- }
-
+ }
+
     static inline SHPObject* apply(Polygon const& polygon)
     {
         int const n = geometry::num_points(polygon);
- int const ring_count = 1 + geometry::num_interior_rings(polygon);
+ int const ring_count = 1 + geometry::num_interior_rings(polygon);
 
- boost::scoped_array<double> x(new double[n]);
- boost::scoped_array<double> y(new double[n]);
- boost::scoped_array<int> parts(new int[ring_count]);
+ boost::scoped_array<double> x(new double[n]);
+ boost::scoped_array<double> y(new double[n]);
+ boost::scoped_array<int> parts(new int[ring_count]);
 
- int ring = 0;
- int offset = 0;
+ int ring = 0;
+ int offset = 0;
 
- process_polygon(polygon, x.get(), y.get(), parts.get(), offset, ring);
+ process_polygon(polygon, x.get(), y.get(), parts.get(), offset, ring);
 
- return ::SHPCreateObject(SHPT_POLYGON, -1, ring_count, parts.get(), NULL,
- n, x.get(), y.get(), NULL, NULL);
- }
+ return ::SHPCreateObject(SHPT_POLYGON, -1, ring_count, parts.get(), NULL,
+ n, x.get(), y.get(), NULL, NULL);
+ }
 };
 
 template <typename Geometry, typename AdaptedRange, int ShapeType>
@@ -137,7 +133,7 @@
 {
     static inline SHPObject* apply(Geometry const& geometry)
     {
- return shape_create_range<AdaptedRange, ShapeType>::apply(AdaptedRange(geometry));
+ return shape_create_range<AdaptedRange, ShapeType>::apply(AdaptedRange(geometry));
     }
 };
 
@@ -189,21 +185,21 @@
 template <typename Box>
 struct shp_create_object<box_tag, Box>
     : detail::shp_create_object::shape_create_adapted_range
- <
- Box,
- box_range<Box>,
- SHPT_POLYGON
- >
+ <
+ Box,
+ box_range<Box>,
+ SHPT_POLYGON
+ >
 {};
 
 template <typename Segment>
 struct shp_create_object<segment_tag, Segment>
     : detail::shp_create_object::shape_create_adapted_range
- <
- Segment,
- segment_range<Segment>,
- SHPT_ARC
- >
+ <
+ Segment,
+ segment_range<Segment>,
+ SHPT_ARC
+ >
 {};
 
 
@@ -216,10 +212,10 @@
 template <typename Geometry>
 inline SHPObject* SHPCreateObject(Geometry const& geometry)
 {
- return dispatch::shp_create_object
- <
- typename tag<Geometry>::type, Geometry
- >::apply(geometry);
+ return dispatch::shp_create_object
+ <
+ typename tag<Geometry>::type, Geometry
+ >::apply(geometry);
 }
 
 

Modified: sandbox/geometry/boost/geometry/extensions/gis/io/veshape/write_veshape.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/gis/io/veshape/write_veshape.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/gis/io/veshape/write_veshape.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -162,8 +162,6 @@
     static inline void stream(std::basic_ostream<Char, Traits>& os, P const& poly)
     {
         typedef typename ring_type<P>::type ring;
- typedef typename boost::range_const_iterator<
- typename interior_type<P>::type>::type iterator;
 
         veshape_range<ring, Policy>::stream(os, exterior_ring(poly));
 

Modified: sandbox/geometry/boost/geometry/extensions/gis/io/wkt/write_wkt.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/gis/io/wkt/write_wkt.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/gis/io/wkt/write_wkt.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -13,6 +13,7 @@
 
 #include <boost/concept/assert.hpp>
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 
 #include <boost/geometry/algorithms/convert.hpp>
@@ -160,16 +161,12 @@
                 Polygon const& poly)
     {
         typedef typename ring_type<Polygon>::type ring;
- typedef typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type iterator;
 
         os << PrefixPolicy::apply();
         // TODO: check EMPTY here
         os << "(";
         wkt_sequence<ring>::apply(os, exterior_ring(poly));
- for (iterator it = boost::begin(interior_rings(poly));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(poly)));
             it != boost::end(interior_rings(poly));
             ++it)
         {

Modified: sandbox/geometry/boost/geometry/extensions/io/svg/write_svg.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/extensions/io/svg/write_svg.hpp (original)
+++ sandbox/geometry/boost/geometry/extensions/io/svg/write_svg.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -15,6 +15,7 @@
 #include <boost/config.hpp>
 #include <boost/mpl/assert.hpp>
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 
 #include <boost/geometry/core/exterior_ring.hpp>
@@ -131,17 +132,12 @@
 
         // Inner rings:
         {
- typedef typename boost::range_iterator
- <
- typename geometry::interior_type<Polygon>::type const
- >::type ring_iterator_type;
- for (ring_iterator_type rit = boost::begin(interior_rings(polygon));
+ for (BOOST_AUTO(rit, boost::begin(interior_rings(polygon)));
                  rit != boost::end(interior_rings(polygon));
                  ++rit)
             {
                 first = true;
- for (iterator_type it = boost::begin(*rit);
- it != boost::end(*rit);
+ for (BOOST_AUTO(it, boost::begin(*rit)); it != boost::end(*rit);
                     ++it, first = false)
                 {
                     os << (first ? "M" : " L") << " "

Modified: sandbox/geometry/boost/geometry/util/write_dsv.hpp
==============================================================================
--- sandbox/geometry/boost/geometry/util/write_dsv.hpp (original)
+++ sandbox/geometry/boost/geometry/util/write_dsv.hpp 2010-12-11 09:03:54 EST (Sat, 11 Dec 2010)
@@ -15,6 +15,7 @@
 
 #include <boost/concept_check.hpp>
 #include <boost/range.hpp>
+#include <boost/typeof/typeof.hpp>
 
 #include <boost/geometry/algorithms/convert.hpp>
 
@@ -206,15 +207,11 @@
                 dsv_settings const& settings)
     {
         typedef typename ring_type<Polygon>::type ring;
- typedef typename boost::range_iterator
- <
- typename interior_type<Polygon>::type const
- >::type iterator_type;
 
         os << settings.list_open;
 
         dsv_range<ring>::apply(os, exterior_ring(poly), settings);
- for (iterator_type it = boost::begin(interior_rings(poly));
+ for (BOOST_AUTO(it, boost::begin(interior_rings(poly)));
             it != boost::end(interior_rings(poly));
             ++it)
         {


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