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 1c684d32202e..05a199a5bffa 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(); } 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 000000000000..6dd4a4e5e2b4 --- /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; +}