From 3f3691a48e4fece4f072cf8488e4772f2f99d810 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 11 Jan 2024 08:43:05 +0000 Subject: [PATCH 1/2] Add testcase that shows the problem --- .../Segment_Delaunay_graph_2/issue7972.cpp | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/issue7972.cpp diff --git a/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/issue7972.cpp b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/issue7972.cpp new file mode 100644 index 00000000000..6dd4a4e5e2b --- /dev/null +++ b/Segment_Delaunay_graph_2/test/Segment_Delaunay_graph_2/issue7972.cpp @@ -0,0 +1,21 @@ + +#include +#include +#include + +typedef CGAL::Exact_predicates_exact_constructions_kernel K; +typedef CGAL::Segment_Delaunay_graph_traits_2 Gt; +typedef CGAL::Segment_Delaunay_graph_2 SDG2; + +int main() { + auto segments = std::vector({ + CGAL::Segment_2( + CGAL::Point_2(0.0, 0.0), + CGAL::Point_2(1.0, 0.0)) + }); + + SDG2 delaunay; + delaunay.insert_segments(segments.begin(), segments.end()); + + return 0; +} From 23e56a8e3e2df7b1c5e9cd659f1b10c35e41940d Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Thu, 11 Jan 2024 08:43:48 +0000 Subject: [PATCH 2/2] In case of Epeck the source of a segment is not a reference --- .../include/CGAL/Segment_Delaunay_graph_2.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h index 1c684d32202..05a199a5bff 100644 --- a/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h +++ b/Segment_Delaunay_graph_2/include/CGAL/Segment_Delaunay_graph_2.h @@ -632,11 +632,11 @@ class Segment_Delaunay_graph_2 } template - static const Point_2& get_source(const Segment_2& segment){ + static Point_2 get_source(const Segment_2& segment){ return segment.source(); } template - static const Point_2& get_target(const Segment_2& segment){ + static Point_2 get_target(const Segment_2& segment){ return segment.target(); }