diff --git a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h index db91adb57cf..e913bc9f7db 100644 --- a/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h +++ b/Arrangement_on_surface_2/include/CGAL/Arr_circular_line_arc_traits_2.h @@ -159,11 +159,11 @@ namespace CGAL { { return CK_Equal_2()(a0, a1); } result_type - operator() ( const Line_arc_2 &a0, const Circular_arc_2 &a1) const + operator() ( const Line_arc_2 &/*a0*/, const Circular_arc_2 &/*a1*/) const { return false; } result_type - operator() ( const Circular_arc_2 &a0, const Line_arc_2 &a1) const + operator() ( const Circular_arc_2 &/*a0*/, const Line_arc_2 &/*a1*/) const { return false; } result_type diff --git a/Classification/include/CGAL/Classification/Evaluation.h b/Classification/include/CGAL/Classification/Evaluation.h index eeff26f73d6..afdde15e216 100644 --- a/Classification/include/CGAL/Classification/Evaluation.h +++ b/Classification/include/CGAL/Classification/Evaluation.h @@ -123,7 +123,7 @@ public: CGAL_precondition (m_labels.is_valid_ground_truth (ground_truth)); CGAL_precondition (m_labels.is_valid_ground_truth (result)); - for (const auto& p : CGAL::make_range + for (const auto p : CGAL::make_range (boost::make_zip_iterator(boost::make_tuple(ground_truth.begin(), result.begin())), boost::make_zip_iterator(boost::make_tuple(ground_truth.end(), result.end())))) { diff --git a/HalfedgeDS/test/HalfedgeDS/test_hds_range_based_loops.cpp b/HalfedgeDS/test/HalfedgeDS/test_hds_range_based_loops.cpp index 455367d6836..893d5e40b0e 100644 --- a/HalfedgeDS/test/HalfedgeDS/test_hds_range_based_loops.cpp +++ b/HalfedgeDS/test/HalfedgeDS/test_hds_range_based_loops.cpp @@ -47,7 +47,7 @@ void test_const_vertex_handles( auto lit = hds_list.vertices_begin(); assert(hds_list.vertex_handles().size() == 1); - for (const auto vh : hds_list.vertex_handles()) { + for (const auto& vh : hds_list.vertex_handles()) { assert(vh == lit); assert(vh->point() == lit->point()); assert(vh->halfedge() == lit->halfedge()); @@ -57,7 +57,7 @@ void test_const_vertex_handles( auto vit = hds_vector.vertices_begin(); assert(hds_vector.vertex_handles().size() == 1); - for (const auto vh : hds_vector.vertex_handles()) { + for (const auto& vh : hds_vector.vertex_handles()) { assert(vh == vit); assert(vh->point() == vit->point()); assert(vh->halfedge() == vit->halfedge()); @@ -97,7 +97,7 @@ void test_const_face_handles( auto lit = hds_list.faces_begin(); assert(hds_list.face_handles().size() == 2); - for (const auto fh : hds_list.face_handles()) { + for (const auto& fh : hds_list.face_handles()) { assert(fh == lit); assert(fh->plane() == lit->plane()); assert(fh->halfedge() == lit->halfedge()); @@ -107,7 +107,7 @@ void test_const_face_handles( auto vit = hds_vector.faces_begin(); assert(hds_vector.face_handles().size() == 2); - for (const auto fh : hds_vector.face_handles()) { + for (const auto& fh : hds_vector.face_handles()) { assert(fh == vit); assert(fh->plane() == vit->plane()); assert(fh->halfedge() == vit->halfedge()); @@ -147,7 +147,7 @@ void test_const_halfedge_handles( auto lit = hds_list.halfedges_begin(); assert(hds_list.halfedge_handles().size() == 2); - for (const auto hh : hds_list.halfedge_handles()) { + for (const auto& hh : hds_list.halfedge_handles()) { assert(hh == lit); assert(hh->face() == lit->face()); assert(hh->vertex() == lit->vertex()); @@ -157,7 +157,7 @@ void test_const_halfedge_handles( auto vit = hds_vector.halfedges_begin(); assert(hds_vector.halfedge_handles().size() == 2); - for (const auto hh : hds_vector.halfedge_handles()) { + for (const auto& hh : hds_vector.halfedge_handles()) { assert(hh == vit); assert(hh->face() == vit->face()); assert(hh->vertex() == vit->vertex()); diff --git a/Mesh_3/include/CGAL/Mesh_3/tet_soup_to_c3t3.h b/Mesh_3/include/CGAL/Mesh_3/tet_soup_to_c3t3.h index 677d37124fa..5c2f6d69a08 100644 --- a/Mesh_3/include/CGAL/Mesh_3/tet_soup_to_c3t3.h +++ b/Mesh_3/include/CGAL/Mesh_3/tet_soup_to_c3t3.h @@ -301,7 +301,7 @@ bool build_infinite_cells(Tr& tr, #endif // add the facets to the incident cells map - for (const Cell_handle c : infinite_cells) + for (const Cell_handle& c : infinite_cells) if(!add_infinite_facets_to_incident_cells_map(c, 0, incident_cells_map, verbose)) return false; diff --git a/Optimal_bounding_box/examples/Optimal_bounding_box/obb_with_point_maps_example.cpp b/Optimal_bounding_box/examples/Optimal_bounding_box/obb_with_point_maps_example.cpp index 4b8210a813d..dd20c5e2095 100644 --- a/Optimal_bounding_box/examples/Optimal_bounding_box/obb_with_point_maps_example.cpp +++ b/Optimal_bounding_box/examples/Optimal_bounding_box/obb_with_point_maps_example.cpp @@ -36,7 +36,7 @@ int main(int argc, char** argv) // one can associate positions to the vertices of the mesh without changing the mesh std::unordered_map translated_positions; - for(const vertex_descriptor v : vertices(sm)) + for(const vertex_descriptor& v : vertices(sm)) translated_positions[v] = sm.point(v) + Vector(1, 2, 3); CGAL::oriented_bounding_box(sm, obb_points, @@ -44,7 +44,7 @@ int main(int argc, char** argv) // using a range of points std::vector points; - for(const vertex_descriptor v : vertices(sm)) + for(const vertex_descriptor& v : vertices(sm)) points.push_back(sm.point(v)); CGAL::oriented_bounding_box(points, obb_points); diff --git a/Optimal_bounding_box/test/Optimal_bounding_box/test_optimization_algorithms.cpp b/Optimal_bounding_box/test/Optimal_bounding_box/test_optimization_algorithms.cpp index eee97967b5b..a7b330b09e6 100644 --- a/Optimal_bounding_box/test/Optimal_bounding_box/test_optimization_algorithms.cpp +++ b/Optimal_bounding_box/test/Optimal_bounding_box/test_optimization_algorithms.cpp @@ -91,7 +91,7 @@ void test_OBB_of_mesh(const std::string fname, } std::vector points; - for(const auto v : vertices(mesh)) + for(const auto& v : vertices(mesh)) points.push_back(v->point()); test_OBB_data(points, expected_vol); diff --git a/Point_set_processing_3/test/Point_set_processing_3/remove_outliers_test.cpp b/Point_set_processing_3/test/Point_set_processing_3/remove_outliers_test.cpp index b1f4e52f69f..4f2966d2717 100644 --- a/Point_set_processing_3/test/Point_set_processing_3/remove_outliers_test.cpp +++ b/Point_set_processing_3/test/Point_set_processing_3/remove_outliers_test.cpp @@ -135,7 +135,7 @@ int main(int argc, char * argv[]) struct A{}; std::vector< std::pair > points_bis; points_bis.reserve(points.size()); - for (const Point p : points) + for (const Point& p : points) points_bis.push_back( std::make_pair(p, A()) ); test_avg_knn_sq_distance(points_bis, nb_neighbors_remove_outliers, removed_percentage, CGAL::First_of_pair_property_map>()); diff --git a/Polyhedron/test/Polyhedron/test_polyhedron_range_based_loops.cpp b/Polyhedron/test/Polyhedron/test_polyhedron_range_based_loops.cpp index da08b8d781f..ee04f5385e1 100644 --- a/Polyhedron/test/Polyhedron/test_polyhedron_range_based_loops.cpp +++ b/Polyhedron/test/Polyhedron/test_polyhedron_range_based_loops.cpp @@ -38,7 +38,7 @@ void test_const_vertex_handles_and_points( auto pit = polyhedron.points_begin(); auto vit = polyhedron.vertices_begin(); - for (const auto vh : polyhedron.vertex_handles()) { + for (const auto& vh : polyhedron.vertex_handles()) { assert(vh == vit); assert(vh->point() == vit->point()); assert(vh->point() == *pit); @@ -88,7 +88,7 @@ void test_const_facet_handles_and_planes( auto pit = polyhedron.planes_begin(); auto fit = polyhedron.facets_begin(); - for (const auto fh : polyhedron.facet_handles()) { + for (const auto& fh : polyhedron.facet_handles()) { assert(fh == fit); assert(fh->plane() == fit->plane()); assert(fh->plane() == *pit); @@ -133,7 +133,7 @@ void test_const_halfedge_handles_and_edges( const Polyhedron& polyhedron) { auto hit = polyhedron.halfedges_begin(); - for (const auto hh : polyhedron.halfedge_handles()) { + for (const auto& hh : polyhedron.halfedge_handles()) { assert(hh == hit); assert(hh->facet() == hit->facet()); assert(hh->vertex() == hit->vertex()); diff --git a/Spatial_searching/examples/Spatial_searching/parallel_kdtree.cpp b/Spatial_searching/examples/Spatial_searching/parallel_kdtree.cpp index a14612a5f22..12f474909f6 100644 --- a/Spatial_searching/examples/Spatial_searching/parallel_kdtree.cpp +++ b/Spatial_searching/examples/Spatial_searching/parallel_kdtree.cpp @@ -47,7 +47,7 @@ int main() // neighbor search returns a set of pair of // point and distance , here we // keep the points only - for (const Point_with_distance& pwd : search) + for (const Point_with_distance pwd : search) neighbors[s].push_back (pwd.first); } }); diff --git a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp index bad0c2dc1ef..116f53dfbd9 100644 --- a/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp +++ b/Surface_mesh_approximation/examples/Surface_mesh_approximation/vsa_isotropic_metric_example.cpp @@ -50,8 +50,7 @@ struct Compact_metric_point_proxy // fitting center Vector_3 center = CGAL::NULL_VECTOR; FT sum_areas = FT(0.0); - for(const face_descriptor f : faces) - { + for(const face_descriptor& f : faces) { center = center + (center_pmap[f] - CGAL::ORIGIN) * area_pmap[f]; sum_areas += area_pmap[f]; } diff --git a/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/L21_metric_plane_proxy.h b/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/L21_metric_plane_proxy.h index 75f324d7469..4a38a9783da 100644 --- a/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/L21_metric_plane_proxy.h +++ b/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/L21_metric_plane_proxy.h @@ -127,7 +127,7 @@ public: // fitting normal Vector_3 norm = CGAL::NULL_VECTOR; - for(const face_descriptor f : faces) { + for(const face_descriptor& f : faces) { norm = m_sum_functor(norm, m_scale_functor(get(m_fnmap, f), get(m_famap, f))); } diff --git a/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/L2_metric_plane_proxy.h b/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/L2_metric_plane_proxy.h index 9ced8858388..eee12468f63 100644 --- a/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/L2_metric_plane_proxy.h +++ b/Surface_mesh_approximation/include/CGAL/Surface_mesh_approximation/L2_metric_plane_proxy.h @@ -125,7 +125,7 @@ public: CGAL_assertion(!faces.empty()); std::list tris; - for(const face_descriptor f : faces) { + for(const face_descriptor& f : faces) { const halfedge_descriptor he = halfedge(f, *m_tm); const Point_3 &p0 = m_vpmap[source(he, *m_tm)]; const Point_3 &p1 = m_vpmap[target(he, *m_tm)]; diff --git a/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h b/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h index 6380cc437d8..ef642b3e074 100644 --- a/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h +++ b/Surface_mesh_approximation/include/CGAL/Variational_shape_approximation.h @@ -1552,7 +1552,7 @@ private: std::cerr << "#chord_anchor " << m_bcycles.back().num_anchors << std::endl; #endif - for(const halfedge_descriptor he : chord) + for(const halfedge_descriptor& he : chord) he_candidates.erase(he); } while (he_start != he_mark); } @@ -1600,7 +1600,7 @@ private: FT dist_max(0.0); chord_vec = scale_functor(chord_vec, FT(1.0) / CGAL::approximate_sqrt(chord_vec.squared_length())); - for(const halfedge_descriptor he : chord) { + for(const halfedge_descriptor& he : chord) { Vector_3 vec = vector_functor(pt_begin, m_vpoint_map[target(he, *m_ptm)]); vec = cross_product_functor(chord_vec, vec); const FT dist = CGAL::approximate_sqrt(vec.squared_length()); @@ -1612,7 +1612,7 @@ private: } else { FT dist_max(0.0); - for(const halfedge_descriptor he : chord) { + for(const halfedge_descriptor& he : chord) { const FT dist = CGAL::approximate_sqrt(CGAL::squared_distance( pt_begin, m_vpoint_map[target(he, *m_ptm)])); if (dist > dist_max) { diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp index 4b8fe1e65d4..186048d8631 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_metric_test.cpp @@ -46,7 +46,7 @@ struct Compact_metric_point_proxy { // fitting center Vector_3 center = CGAL::NULL_VECTOR; FT sum_areas = FT(0.0); - for(const face_descriptor f : faces) { + for(const face_descriptor& f : faces) { center = center + (center_pmap[f] - CGAL::ORIGIN) * area_pmap[f]; sum_areas += area_pmap[f]; } diff --git a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp index 4e7411f1921..f1d10a9a57c 100644 --- a/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp +++ b/Surface_mesh_approximation/test/Surface_mesh_approximation/vsa_teleportation_test.cpp @@ -104,7 +104,7 @@ int main() CGAL::Bbox_3 bbox; - for(const vertex_descriptor v : vertices(mesh)) + for(const vertex_descriptor& v : vertices(mesh)) bbox += vpmap[v].bbox(); const FT ymin = bbox.ymin(), ymax = bbox.ymax(), yrange = ymax - ymin; std::cout << "Range along y axis: [" << ymin << ", " << ymax << "]" << std::endl; @@ -113,7 +113,7 @@ int main() std::size_t planar_pxidx = static_cast(-1); std::size_t num_planar_faces = 0; bool first = true; - for(const face_descriptor f : faces(mesh)) { + for(const face_descriptor& f : faces(mesh)) { const halfedge_descriptor he = halfedge(f, mesh); const Point_3 &p0 = vpmap[source(he, mesh)]; const Point_3 &p1 = vpmap[target(he, mesh)]; diff --git a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h index 7b0ddb69c4f..fd02ec777fa 100644 --- a/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h +++ b/Surface_mesh_simplification/include/CGAL/Surface_mesh_simplification/Policies/Edge_collapse/internal/Lindstrom_Turk_core.h @@ -491,7 +491,7 @@ add_shape_optimization_constraints(const vertex_descriptor_vector& link) 0.0, 0.0, s); Vector c = NULL_VECTOR; - for(const vertex_descriptor v : link) + for(const vertex_descriptor& v : link) c = c + (ORIGIN - get_point(v)); CGAL_SMS_LT_TRACE(1," Adding shape optimization constraint. Shape vector: " << xyz_to_string(c)); @@ -540,7 +540,7 @@ compute_shape_cost(const Point& p, const vertex_descriptor_vector& link) { FT rCost(0); - for(const vertex_descriptor v : link) + for(const vertex_descriptor& v : link) rCost += squared_distance(p, get_point(v)); return rCost; diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/collapse_short_edges.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/collapse_short_edges.h index 526d9dd7d82..4ce1fe25af0 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/collapse_short_edges.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/collapse_short_edges.h @@ -219,7 +219,7 @@ public: Vertex_handle infinite_vertex = triangulation.infinite_vertex(); bool v0_updated = false; - for (const Cell_handle ch : find_incident) + for (const Cell_handle& ch : find_incident) { if (invalid_cells.find(ch) == invalid_cells.end()) //valid cell { @@ -445,7 +445,7 @@ bool is_valid_collapse(const typename C3t3::Edge& edge, c3t3.triangulation().finite_incident_cells(v0, std::back_inserter(cells_to_check)); - for (const Cell_handle ch : cells_to_check) + for (const Cell_handle& ch : cells_to_check) { if (!ch->has_vertex(v1)) { @@ -478,7 +478,7 @@ bool is_valid_collapse(const typename C3t3::Edge& edge, c3t3.triangulation().finite_incident_cells(v1, std::back_inserter(cells_to_check)); - for (const Cell_handle ch : cells_to_check) + for (const Cell_handle& ch : cells_to_check) { if (!ch->has_vertex(v0)) { @@ -792,7 +792,7 @@ collapse(const typename C3t3::Cell_handle ch, std::vector cells_to_remove; boost::unordered_set invalid_cells; - for(const Cell_handle c : inc_cells) + for(const Cell_handle& c : inc_cells) { const int v0_id = c->index(vh0); const int v1_id = c->index(vh1); @@ -838,7 +838,7 @@ collapse(const typename C3t3::Cell_handle ch, const Vertex_handle infinite_vertex = tr.infinite_vertex(); bool v0_updated = false; - for (const Cell_handle c : find_incident) + for (const Cell_handle& c : find_incident) { if (invalid_cells.find(c) == invalid_cells.end())//valid cell { @@ -856,7 +856,7 @@ collapse(const typename C3t3::Cell_handle ch, = { { {{0,1}}, {{0,2}}, {{0,3}}, {{1,2}}, {{1,3}}, {{2,3}} } }; //vertex indices in cells const Vertex_handle vkept = vh0; const Vertex_handle vdeleted = vh1; - for (const Cell_handle c : cells_to_update) + for (const Cell_handle& c : cells_to_update) { for (const std::array& ei : edges) { @@ -886,7 +886,7 @@ collapse(const typename C3t3::Cell_handle ch, // update complex facets //Update the vertex before removing it - for (const Cell_handle c : cells_to_update) + for (const Cell_handle& c : cells_to_update) { if (invalid_cells.find(c) == invalid_cells.end()) //valid cell { @@ -1005,7 +1005,7 @@ bool is_cells_set_manifold(const C3t3&, } boost::unordered_map edges; - for (const std::pair& fvv : facets) + for (const auto& fvv : facets) { if (fvv.second != 1) continue; @@ -1021,7 +1021,7 @@ bool is_cells_set_manifold(const C3t3&, } } - for (const std::pair& evv : edges) + for (const auto& evv : edges) if (evv.second != 2) return false; diff --git a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h index d22d6fdf65c..7c784af9820 100644 --- a/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h +++ b/Tetrahedral_remeshing/include/CGAL/Tetrahedral_remeshing/internal/smooth_vertices.h @@ -162,7 +162,7 @@ private: } } - for (const std::pair& fn : fnormals) + for (const auto& fn : fnormals) { if(fn.second != CGAL::NULL_VECTOR) continue; @@ -347,7 +347,7 @@ private: v->set_point(typename Tr::Point(pv + frac * move)); bool valid_try = true; - for (const typename Tr::Cell_handle ci : inc_cells) + for (const typename Tr::Cell_handle& ci : inc_cells) { if (CGAL::POSITIVE != CGAL::orientation(point(ci->vertex(0)->point()), point(ci->vertex(1)->point()),