diff --git a/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp b/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp index 90248767e..ceba59b41 100644 --- a/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp +++ b/include/boost/geometry/algorithms/detail/closest_feature/range_to_range.hpp @@ -60,6 +60,7 @@ private: BOOST_ASSERT( queries_first != queries_last ); Distance const zero = Distance(0); + dist_min = zero; // create -- packing algorithm rtree_type rt(rtree_first, rtree_last); diff --git a/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp b/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp index 04d1095cb..63ebdd046 100644 --- a/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp +++ b/include/boost/geometry/algorithms/detail/distance/geometry_to_segment_or_box.hpp @@ -215,7 +215,7 @@ public: // consider all distances of the points in the geometry to the // segment or box - comparable_return_type cd_min1; + 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(); @@ -246,7 +246,7 @@ public: // consider all distances of the points in the segment or box to the // segments of the geometry - comparable_return_type cd_min2; + comparable_return_type cd_min2(0); segment_iterator_type sit_min; typename std::vector::const_iterator it_min; diff --git a/test/algorithms/distance/distance_brute_force.hpp b/test/algorithms/distance/distance_brute_force.hpp index ccea5cbac..e645ec524 100644 --- a/test/algorithms/distance/distance_brute_force.hpp +++ b/test/algorithms/distance/distance_brute_force.hpp @@ -98,7 +98,7 @@ struct one_to_many >::type distance_type; bool first = true; - distance_type d_min; + distance_type d_min(0); for (Iterator it = begin; it != end; ++it, first = false) { distance_type d = Policy::apply(geometry, *it, strategy);