From 207fbb7efdf69efd71e20eb692cb4aad8caf27a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Mon, 15 Jan 2018 13:28:03 +0100 Subject: [PATCH] Changed functor's result type Technically the point() function of the TriangulationVertexBase_2 concept has return type Point and not const Point& so we can't take a const ref here otherwise we might take refs to temporaries. --- Interpolation/include/CGAL/Interpolation/internal/helpers.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Interpolation/include/CGAL/Interpolation/internal/helpers.h b/Interpolation/include/CGAL/Interpolation/internal/helpers.h index 79780b35520..31ee814e48a 100644 --- a/Interpolation/include/CGAL/Interpolation/internal/helpers.h +++ b/Interpolation/include/CGAL/Interpolation/internal/helpers.h @@ -51,7 +51,8 @@ struct Extract_bare_point } template - const Point& operator()(const VH& vh) const { + Point operator()(const VH& vh) const { + CGAL_precondition(vh != VH()); return traits.construct_point_d_object()(vh->point()); } @@ -75,6 +76,7 @@ struct Extract_point_in_pair result_type operator()(const argument_type& vp) const { + CGAL_precondition(vp.first != Vertex_handle()); return std::make_pair(vp.first->point(), vp.second); } };