From 130cf57758238ab710301e381d094b5988d0ee11 Mon Sep 17 00:00:00 2001 From: Sven Oesau Date: Fri, 1 Mar 2024 17:29:17 +0100 Subject: [PATCH] created local copy of point before using Cartesian_ranges --- Orthtree/include/CGAL/Orthtree.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Orthtree/include/CGAL/Orthtree.h b/Orthtree/include/CGAL/Orthtree.h index 5bb336a22c4..2028c9f72a8 100644 --- a/Orthtree/include/CGAL/Orthtree.h +++ b/Orthtree/include/CGAL/Orthtree.h @@ -1366,7 +1366,9 @@ private: // functions : auto child_node = child(node, i); FT squared_distance = 0; - for (const auto& r : cartesian_range(m_traits.construct_center_d_object()(search_bounds), barycenter(child_node))) { + Point c = m_traits.construct_center_d_object()(search_bounds); + Point b = barycenter(child_node); + for (const auto r : cartesian_range(c, b)) { FT d = (get<0>(r) - get<1>(r)); squared_distance += d * d; }