From aeb9a7284319731785546e67e41ee083f3e8a74b Mon Sep 17 00:00:00 2001 From: Jane Tournois Date: Fri, 28 Jul 2017 17:48:37 +0200 Subject: [PATCH] replace BOOST_FOREACH by a simple for loop the BOOST_FOREACH loop was either crashing after one loop, of entering an infinite loop on the first vertex of the range, and this fixes the bug it happened on vs2015 and vs2017, in Release mode, and only Release mode --- BGL/include/CGAL/boost/graph/copy_face_graph.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/BGL/include/CGAL/boost/graph/copy_face_graph.h b/BGL/include/CGAL/boost/graph/copy_face_graph.h index 1f9b82087be..c075f6c0f45 100644 --- a/BGL/include/CGAL/boost/graph/copy_face_graph.h +++ b/BGL/include/CGAL/boost/graph/copy_face_graph.h @@ -46,6 +46,7 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, { typedef typename boost::graph_traits::vertex_descriptor sm_vertex_descriptor; typedef typename boost::graph_traits::vertex_descriptor tm_vertex_descriptor; + typedef typename boost::graph_traits::vertex_iterator tm_vertex_iterator; typedef typename boost::graph_traits::face_descriptor sm_face_descriptor; typedef typename boost::graph_traits::face_descriptor tm_face_descriptor; @@ -153,8 +154,10 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm, } // update halfedge vertex of all but the vertex halfedge - BOOST_FOREACH(tm_vertex_descriptor v, vertices(tm)) + for(tm_vertex_iterator vit = vertices(tm).first; + vit != vertices(tm).second; ++vit) { + tm_vertex_descriptor v = *vit; tm_halfedge_descriptor h = halfedge(v, tm); tm_halfedge_descriptor next_around_vertex=h; do{