From ffe7a6909a16bb927f5fb4b4a87afb51a69ed4a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Jamin?= Date: Tue, 16 Nov 2021 15:48:48 +0100 Subject: [PATCH] Improve `std::partition` predicate --- Point_set_processing_3/include/CGAL/remove_outliers.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Point_set_processing_3/include/CGAL/remove_outliers.h b/Point_set_processing_3/include/CGAL/remove_outliers.h index e06509bb895..5482d2cbb13 100644 --- a/Point_set_processing_3/include/CGAL/remove_outliers.h +++ b/Point_set_processing_3/include/CGAL/remove_outliers.h @@ -247,9 +247,9 @@ remove_outliers( if (threshold_distance != FT(0)) f2r = std::partition (sorted_points.begin(), sorted_points.end(), - [&threshold_distance](const std::pair& p) -> bool - { - return p.first < threshold_distance * threshold_distance; + [sq_threshold_distance = CGAL::square(threshold_distance)](const std::pair& p) -> bool + { + return p.first < sq_threshold_distance; }); if (static_cast(std::distance (sorted_points.begin(), f2r)) < first_index_to_remove)