From 4a27ff5bf6dbaca73e3b0249e84413fc7b2a26ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Loriot?= Date: Tue, 5 Jan 2021 11:53:50 +0100 Subject: [PATCH] remove bind in Surface_mesh --- .../examples/Surface_mesh/sm_do_intersect.cpp | 15 ++++----------- .../test/Surface_mesh/surface_mesh_test.cpp | 11 +++-------- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/Surface_mesh/examples/Surface_mesh/sm_do_intersect.cpp b/Surface_mesh/examples/Surface_mesh/sm_do_intersect.cpp index 69e3b2550ab..02a18d5bf45 100644 --- a/Surface_mesh/examples/Surface_mesh/sm_do_intersect.cpp +++ b/Surface_mesh/examples/Surface_mesh/sm_do_intersect.cpp @@ -2,9 +2,6 @@ #include #include -#include -#include -#include #include #include #include @@ -87,16 +84,12 @@ unsigned int intersect(const Mesh& P, const Mesh& Q) { Q_box_ptr.reserve(Q.number_of_faces()); // build boxes and pointers to boxes - boost::transform(P.faces(), - std::back_inserter(P_boxes), - boost::bind(boost::value_factory(), _1, boost::cref(P))); - - + for(auto f : P.faces()) + P_boxes.push_back( Box(f, P) ); std::transform(P_boxes.begin(), P_boxes.end(), std::back_inserter(P_box_ptr), &address_of_box); - boost::transform(Q.faces(), - std::back_inserter(Q_boxes), - boost::bind(boost::value_factory(), _1, boost::cref(Q))); + for(auto f : Q.faces()) + Q_boxes.push_back( Box(f, Q) ); std::transform(Q_boxes.begin(), Q_boxes.end(), std::back_inserter(Q_box_ptr), &address_of_box); diff --git a/Surface_mesh/test/Surface_mesh/surface_mesh_test.cpp b/Surface_mesh/test/Surface_mesh/surface_mesh_test.cpp index ee0e71417de..949d2538bff 100644 --- a/Surface_mesh/test/Surface_mesh/surface_mesh_test.cpp +++ b/Surface_mesh/test/Surface_mesh/surface_mesh_test.cpp @@ -4,9 +4,6 @@ #include #include -#include -#include - #include void constructors_test() @@ -118,15 +115,13 @@ void memory_reuse_test() // remove all faces std::size_t old_face_size = f.m.number_of_faces(); std::size_t old_removed_face_size = f.m.number_of_removed_faces(); - boost::range::for_each(f.m.faces(), boost::bind(&Sm::remove_face, boost::ref(f.m), _1)); + for(auto face : f.m.faces()) f.m.remove_face(face); assert(f.m.number_of_faces()== 0); assert(f.m.number_of_removed_faces()== old_face_size + old_removed_face_size); // remove all edges std::size_t old_edge_size = f.m.number_of_edges(); std::size_t old_removed_edge_size = f.m.number_of_removed_edges(); - boost::range::for_each(f.m.edges(), - boost::bind(static_cast(&Sm::remove_edge), - boost::ref(f.m), _1)); + for(auto e : f.m.edges()) f.m.remove_edge(e); assert(f.m.number_of_faces() == 0); assert(f.m.number_of_removed_edges()== old_edge_size + old_removed_edge_size); @@ -151,7 +146,7 @@ void memory_reuse_test() std::size_t old_size = f.m.number_of_vertices(); std::size_t old_removed_size = f.m.number_of_removed_vertices(); - boost::range::for_each(f.m.vertices(), boost::bind(&Sm::remove_vertex, boost::ref(f.m), _1)); + for(auto v : f.m.vertices()) f.m.remove_vertex(v); assert(f.m.number_of_vertices() == 0); assert(f.m.number_of_removed_vertices()== old_size + old_removed_size);