diff options
Diffstat (limited to 'boost/geometry/algorithms/for_each.hpp')
-rw-r--r-- | boost/geometry/algorithms/for_each.hpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/boost/geometry/algorithms/for_each.hpp b/boost/geometry/algorithms/for_each.hpp index d1aa1b10fd..d03643ab1b 100644 --- a/boost/geometry/algorithms/for_each.hpp +++ b/boost/geometry/algorithms/for_each.hpp @@ -5,9 +5,9 @@ // Copyright (c) 2009-2014 Mateusz Loskot, London, UK. // Copyright (c) 2014 Adam Wulkiewicz, Lodz, Poland. -// This file was modified by Oracle on 2014-2020. -// Modifications copyright (c) 2014-2020, Oracle and/or its affiliates. - +// This file was modified by Oracle on 2014-2023. +// Modifications copyright (c) 2014-2023, Oracle and/or its affiliates. +// Contributed and/or modified by Vissarion Fysikopoulos, on behalf of Oracle // Contributed and/or modified by Menelaos Karavelas, on behalf of Oracle // Contributed and/or modified by Adam Wulkiewicz, on behalf of Oracle @@ -22,14 +22,11 @@ #define BOOST_GEOMETRY_ALGORITHMS_FOR_EACH_HPP -#include <algorithm> - #include <boost/range/begin.hpp> #include <boost/range/end.hpp> #include <boost/range/reference.hpp> #include <boost/range/value_type.hpp> -#include <boost/geometry/algorithms/detail/interior_iterator.hpp> #include <boost/geometry/algorithms/not_implemented.hpp> #include <boost/geometry/core/closure.hpp> #include <boost/geometry/core/exterior_ring.hpp> @@ -42,9 +39,6 @@ #include <boost/geometry/geometries/segment.hpp> -#include <boost/geometry/util/range.hpp> -#include <boost/geometry/util/type_traits.hpp> - #include <boost/geometry/views/detail/indexed_point_view.hpp> @@ -277,7 +271,10 @@ struct fe_segment_range_with_closure<open> template <typename Range, typename Functor> static inline bool apply(Range& range, Functor&& f) { - fe_segment_range_with_closure<closed>::apply(range, f); + if (! fe_segment_range_with_closure<closed>::apply(range, f)) + { + return false; + } auto const begin = boost::begin(range); auto end = boost::end(range); @@ -285,9 +282,9 @@ struct fe_segment_range_with_closure<open> { return true; } - + --end; - + if (begin == end) { // single point ranges already handled in closed case above @@ -323,9 +320,7 @@ struct for_each_polygon return false; } - typename interior_return_type<Polygon>::type - rings = interior_rings(poly); - + auto&& rings = interior_rings(poly); auto const end = boost::end(rings); for (auto it = boost::begin(rings); it != end; ++it) { |