Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71628 - in trunk/boost/geometry: extensions/gis/io/shapelib iterators
From: barend.gehrels_at_[hidden]
Date: 2011-04-30 12:29:22


Author: barendgehrels
Date: 2011-04-30 12:29:21 EDT (Sat, 30 Apr 2011)
New Revision: 71628
URL: http://svn.boost.org/trac/boost/changeset/71628

Log:
Fixed box_iterator behaviour to support Boost.Range concept checking
Text files modified:
   trunk/boost/geometry/extensions/gis/io/shapelib/shp_read_object.hpp | 2 --
   trunk/boost/geometry/iterators/box_iterator.hpp | 17 ++++++++++++++++-
   trunk/boost/geometry/iterators/segment_range_iterator.hpp | 19 +++++++++----------
   3 files changed, 25 insertions(+), 13 deletions(-)

Modified: trunk/boost/geometry/extensions/gis/io/shapelib/shp_read_object.hpp
==============================================================================
--- trunk/boost/geometry/extensions/gis/io/shapelib/shp_read_object.hpp (original)
+++ trunk/boost/geometry/extensions/gis/io/shapelib/shp_read_object.hpp 2011-04-30 12:29:21 EDT (Sat, 30 Apr 2011)
@@ -18,8 +18,6 @@
 #include <boost/geometry/core/interior_rings.hpp>
 #include <boost/geometry/core/ring_type.hpp>
 #include <boost/geometry/algorithms/num_points.hpp>
-#include <boost/geometry/ranges/box_range.hpp>
-#include <boost/geometry/ranges/segment_range.hpp>
 
 
 // Should be somewhere in your include path

Modified: trunk/boost/geometry/iterators/box_iterator.hpp
==============================================================================
--- trunk/boost/geometry/iterators/box_iterator.hpp (original)
+++ trunk/boost/geometry/iterators/box_iterator.hpp 2011-04-30 12:29:21 EDT (Sat, 30 Apr 2011)
@@ -41,6 +41,13 @@
         boost::random_access_traversal_tag
>
 {
+ // Default constructor is required to check concept of Range
+ inline box_iterator()
+ : m_index(-1)
+ , m_box_address(NULL)
+ {
+ }
+
     explicit inline box_iterator(Box const& box)
         : m_index(0)
         , m_box_address(&box)
@@ -56,6 +63,14 @@
         init(box);
     }
 
+ // Operator= is required to check concept of Range
+ inline box_iterator<Box>& operator=(box_iterator<Box> const& source)
+ {
+ m_index = source.m_index;
+ m_box_address = source.m_box_address;
+ return *this;
+ }
+
     typedef std::ptrdiff_t difference_type;
 
 private:
@@ -101,7 +116,7 @@
     // Copy points here - box might define them otherwise
     point_type m_points[4];
     int m_index;
- Box const* const m_box_address;
+ Box const* m_box_address;
 };
 
 

Modified: trunk/boost/geometry/iterators/segment_range_iterator.hpp
==============================================================================
--- trunk/boost/geometry/iterators/segment_range_iterator.hpp (original)
+++ trunk/boost/geometry/iterators/segment_range_iterator.hpp 2011-04-30 12:29:21 EDT (Sat, 30 Apr 2011)
@@ -51,15 +51,6 @@
     {
     }
 
- // Operator= is required to check concept of Range
- inline segment_range_iterator<Segment>& operator=(segment_range_iterator<Segment> const& source)
- {
- m_index = source.m_index;
- m_segment_address = source.m_segment_address;
- return *this;
- }
-
-
     explicit inline segment_range_iterator(Segment const& segment)
         : m_index(0)
         , m_segment_address(&segment)
@@ -74,7 +65,15 @@
     {
         init(segment);
     }
-
+
+ // Operator= is required to check concept of Range
+ inline segment_range_iterator<Segment>& operator=(segment_range_iterator<Segment> const& source)
+ {
+ m_index = source.m_index;
+ m_segment_address = source.m_segment_address;
+ return *this;
+ }
+
     typedef std::ptrdiff_t difference_type;
 
 private:


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