diff options
Diffstat (limited to 'boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp')
-rw-r--r-- | boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp b/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp index 57257dbdcc..d6de7cac91 100644 --- a/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp +++ b/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp @@ -185,10 +185,10 @@ public: Geometry const > segment_iterator_type; - typedef typename std::vector + typedef typename boost::range_const_iterator < - segment_or_box_point - >::const_iterator seg_or_box_iterator_type; + std::vector<segment_or_box_point> + >::type seg_or_box_const_iterator; typedef assign_new_min_iterator<SegmentOrBox> assign_new_value; @@ -219,8 +219,9 @@ public: // segment or box comparable_return_type cd_min1(0); point_iterator_type pit_min; - seg_or_box_iterator_type it_min1 = seg_or_box_points.begin(); - seg_or_box_iterator_type it_min2 = ++seg_or_box_points.begin(); + seg_or_box_const_iterator it_min1 = boost::const_begin(seg_or_box_points); + seg_or_box_const_iterator it_min2 = it_min1; + ++it_min2; bool first = true; for (point_iterator_type pit = points_begin(geometry); @@ -229,11 +230,11 @@ public: comparable_return_type cd; std::pair < - seg_or_box_iterator_type, seg_or_box_iterator_type + seg_or_box_const_iterator, seg_or_box_const_iterator > it_pair = point_to_point_range::apply(*pit, - seg_or_box_points.begin(), - seg_or_box_points.end(), + boost::const_begin(seg_or_box_points), + boost::const_end(seg_or_box_points), cstrategy, cd); @@ -250,12 +251,11 @@ public: // segments of the geometry comparable_return_type cd_min2(0); segment_iterator_type sit_min; - typename std::vector<segment_or_box_point>::const_iterator it_min; + seg_or_box_const_iterator it_min; first = true; - for (typename std::vector<segment_or_box_point>::const_iterator it - = seg_or_box_points.begin(); - it != seg_or_box_points.end(); ++it, first = false) + for (seg_or_box_const_iterator it = boost::const_begin(seg_or_box_points); + it != boost::const_end(seg_or_box_points); ++it, first = false) { comparable_return_type cd; segment_iterator_type sit |