diff --git a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_self_intersections.h b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_self_intersections.h index d963e6a5010..d9a2f779991 100644 --- a/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_self_intersections.h +++ b/Polygon_mesh_processing/include/CGAL/Polygon_mesh_processing/polygon_soup_self_intersections.h @@ -41,7 +41,14 @@ bool does_polygon_soup_self_intersect(const PointRange& points, // otherwise, we need to triangulate the polygons beforehand using Polygon = CGAL::cpp20::remove_cvref_t; - std::vector triangles(polygons.begin(), polygons.end()); + using Id = typename std::iterator_traits::value_type; + auto to_std_vector = [](const Polygon& poly) + { + return std::vector(poly.begin(), poly.end()); + }; + + std::vector> triangles(boost::make_transform_iterator(polygons.begin(), to_std_vector), + boost::make_transform_iterator(polygons.end(), to_std_vector)); bool OK = triangulate_polygons(points, triangles, np); if (!OK) return false;