From 4e1f2cf017973c65be4d2dd4b1700a3b66320041 Mon Sep 17 00:00:00 2001 From: Andreas Fabri Date: Tue, 4 Jun 2019 17:13:53 +0200 Subject: [PATCH] Replace BOOST_FOREACH with C++11 for --- Polyhedron_IO/include/CGAL/IO/PLY_writer.h | 2 +- Stream_support/include/CGAL/IO/WKT.h | 12 +++++------- .../include/CGAL/Surface_mesh/Surface_mesh.h | 10 +++++----- 3 files changed, 11 insertions(+), 13 deletions(-) diff --git a/Polyhedron_IO/include/CGAL/IO/PLY_writer.h b/Polyhedron_IO/include/CGAL/IO/PLY_writer.h index 1807899a040..052c6d196a9 100644 --- a/Polyhedron_IO/include/CGAL/IO/PLY_writer.h +++ b/Polyhedron_IO/include/CGAL/IO/PLY_writer.h @@ -142,7 +142,7 @@ namespace CGAL{ if(has_texture) { - BOOST_FOREACH(halfedge_descriptor hd, halfedges(mesh)) + for(halfedge_descriptor hd : halfedges(mesh)) { typedef std::tuple Super_tuple; Super_tuple t = diff --git a/Stream_support/include/CGAL/IO/WKT.h b/Stream_support/include/CGAL/IO/WKT.h index b9dcce70eb1..2d845fb8e10 100644 --- a/Stream_support/include/CGAL/IO/WKT.h +++ b/Stream_support/include/CGAL/IO/WKT.h @@ -33,8 +33,6 @@ #include #include -#include - #include #include @@ -157,7 +155,7 @@ read_multi_linestring_WKT( std::istream& in, break; } } - BOOST_FOREACH(LineString& ls, gc) + for(LineString& ls : gc) { mls.push_back(*ls.range); } @@ -312,7 +310,7 @@ write_multi_linestring_WKT( std::ostream& out, typedef typename MultiLineString::value_type PointRange; typedef internal::Geometry_container LineString; std::vector pr_range; - BOOST_FOREACH(PointRange& pr, mls) + for(PointRange& pr : mls) { LineString ls(pr); pr_range.push_back(ls); @@ -374,21 +372,21 @@ read_WKT( std::istream& input, { MultiPoint mp; CGAL::read_multi_point_WKT(input, mp); - BOOST_FOREACH(const Point& point, mp) + for(const Point& point : mp) points.push_back(point); } else if(type == "MULTILINESTRING") { MultiLineString mls; CGAL::read_multi_linestring_WKT(input, mls); - BOOST_FOREACH(const LineString& ls, mls) + (const LineString& ls : mls) polylines.push_back(ls); } else if(type == "MULTIPOLYGON") { MultiPolygon mp; CGAL::read_multi_polygon_WKT(input, mp); - BOOST_FOREACH(const Polygon& poly, mp) + for(const Polygon& poly : mp) polygons.push_back(poly); } }while(input.good() && !input.eof()); diff --git a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h index 0f9b77861b2..9e4d71e82ab 100644 --- a/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h +++ b/Surface_mesh/include/CGAL/Surface_mesh/Surface_mesh.h @@ -2234,7 +2234,7 @@ private: //------------------------------------------------------- private data os << "end_header" << std::endl; - BOOST_FOREACH(VIndex vi, sm.vertices()) + for(VIndex vi : sm.vertices()) { for (std::size_t i = 0; i < vprinters.size(); ++ i) { @@ -2248,11 +2248,11 @@ private: //------------------------------------------------------- private data std::vector polygon; - BOOST_FOREACH(FIndex fi, sm.faces()) + for(FIndex fi : sm.faces()) { // Get list of vertex indices polygon.clear(); - BOOST_FOREACH(HIndex hi, halfedges_around_face(halfedge(fi, sm), sm)) + for(HIndex hi : halfedges_around_face(halfedge(fi, sm), sm)) polygon.push_back (sm.target(hi)); if (get_mode (os) == IO::ASCII) @@ -2285,7 +2285,7 @@ private: //------------------------------------------------------- private data if (!eprinters.empty()) { - BOOST_FOREACH(EIndex ei, sm.edges()) + for(EIndex ei : sm.edges()) { if (get_mode (os) == IO::ASCII) os << int(sm.vertex(ei,0)) << " " << int(sm.vertex(ei,1)) << " "; @@ -2311,7 +2311,7 @@ private: //------------------------------------------------------- private data if (!hprinters.empty()) { - BOOST_FOREACH(HIndex hi, sm.halfedges()) + for(HIndex hi : sm.halfedges()) { if (get_mode (os) == IO::ASCII) os << int(sm.source(hi)) << " " << int(sm.target(hi)) << " ";