Skip to content

Commit

Permalink
boost::tie -> std::tie (#8715)
Browse files Browse the repository at this point in the history
  • Loading branch information
sloriot authored Feb 12, 2025
2 parents 3394b6d + 00bf449 commit 14b83f0
Show file tree
Hide file tree
Showing 136 changed files with 407 additions and 413 deletions.
4 changes: 2 additions & 2 deletions BGL/examples/BGL_LCC/distance_lcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ int main(int argc, char** argv)
// Here we start at an arbitrary vertex
// Any other vertex could be the starting point
vertex_iterator vb, ve;
boost::tie(vb,ve)=vertices(lcc);
std::tie(vb,ve)=vertices(lcc);
vertex_descriptor vd = *vb;

std::cout << "We compute distances to " << vd->point() << std::endl;
Expand All @@ -45,7 +45,7 @@ int main(int argc, char** argv)
boost::on_tree_edge()))));

// Traverse all vertices and show at what distance they are
for(boost::tie(vb,ve)=vertices(lcc); vb!=ve; ++vb)
for(std::tie(vb,ve)=vertices(lcc); vb!=ve; ++vb)
{
vd = *vb;
std::cout<<vd->point()<<" is "<<distance[vd->id()]<<" hops away."<<std::endl;
Expand Down
2 changes: 1 addition & 1 deletion BGL/examples/BGL_LCC/incident_vertices_lcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ OutputIterator adjacent_vertices_V2(const LCC& g,
OutputIterator out)
{
halfedge_around_target_iterator hi, he;
for(boost::tie(hi, he) = halfedges_around_target(halfedge(vd,g),g); hi != he; ++hi)
for(std::tie(hi, he) = halfedges_around_target(halfedge(vd,g),g); hi != he; ++hi)
{
*out++ = source(*hi,g);
}
Expand Down
2 changes: 1 addition & 1 deletion BGL/examples/BGL_LCC/kruskal_lcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ void kruskal(const LCC& lcc)
"point [ \n";

vertex_iterator vb, ve;
for(boost::tie(vb,ve) = vertices(lcc); vb!=ve; ++vb){
for(std::tie(vb,ve) = vertices(lcc); vb!=ve; ++vb){
std::cout << (*vb)->point() << "\n";
}

Expand Down
2 changes: 1 addition & 1 deletion BGL/examples/BGL_LCC/normals_lcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ void calculate_face_normals(const HalfedgeGraph& g,
typedef typename boost::property_traits<NormalMap>::value_type normal;

face_iterator fb, fe;
for(boost::tie(fb, fe) = faces(g); fb != fe; ++fb)
for(std::tie(fb, fe) = faces(g); fb != fe; ++fb)
{
halfedge_descriptor edg = halfedge(*fb, g);
halfedge_descriptor edgb = edg;
Expand Down
4 changes: 2 additions & 2 deletions BGL/examples/BGL_LCC/range_lcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ void fct(const LCC& lcc)
std::cout << vd->point() << std::endl;
}

std::cout << "boost::tie + std::for_each" << std::endl;
std::cout << "std::tie + std::for_each" << std::endl;
vertex_iterator vb, ve;

boost::tie(vb,ve) = vertices_range(lcc);
std::tie(vb,ve) = vertices_range(lcc);
std::for_each(vb,ve, Fct());
}

Expand Down
2 changes: 1 addition & 1 deletion BGL/examples/BGL_LCC/transform_iterator_lcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ int main(int argc, char** argv)
typedef boost::transform_iterator<Source<LCC>,halfedge_around_target_iterator> adjacent_vertex_iterator;

halfedge_around_target_iterator hb,he;
boost::tie(hb,he) = halfedges_around_target(halfedge(vd,lcc),lcc);
std::tie(hb,he) = halfedges_around_target(halfedge(vd,lcc),lcc);
adjacent_vertex_iterator avib, avie;
avib = boost::make_transform_iterator(hb, Source<LCC>(lcc));
avie = boost::make_transform_iterator(he, Source<LCC>(lcc));
Expand Down
8 changes: 4 additions & 4 deletions BGL/examples/BGL_polyhedron_3/distance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ int main(int argc, char** argv) {
vertex_iterator vb, ve;
int index = 0;

// boost::tie assigns the first and second element of the std::pair
// std::tie assigns the first and second element of the std::pair
// returned by boost::vertices to the variables vit and ve
for(boost::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){
for(std::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){
vertex_descriptor vd = *vb;
vd->id() = index++;
}
Expand All @@ -37,7 +37,7 @@ int main(int argc, char** argv) {

// Here we start at an arbitrary vertex
// Any other vertex could be the starting point
boost::tie(vb,ve)=vertices(P);
std::tie(vb,ve)=vertices(P);
vertex_descriptor vd = *vb;

std::cout << "We compute distances to " << vd->point() << std::endl;
Expand All @@ -54,7 +54,7 @@ int main(int argc, char** argv) {


// Traverse all vertices and show at what distance they are
for(boost::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){
for(std::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){
vd = *vb;
std::cout << vd->point() << " is " << distance[vd->id()] << " hops away" << std::endl;
}
Expand Down
2 changes: 1 addition & 1 deletion BGL/examples/BGL_polyhedron_3/incident_vertices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ adjacent_vertices_V2(const Polyhedron& g,
{
halfedge_around_target_iterator hi, he;

for(boost::tie(hi, he) = halfedges_around_target(halfedge(vd,g),g); hi != he; ++hi)
for(std::tie(hi, he) = halfedges_around_target(halfedge(vd,g),g); hi != he; ++hi)
{
*out++ = source(*hi,g);
}
Expand Down
6 changes: 3 additions & 3 deletions BGL/examples/BGL_polyhedron_3/kruskal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ kruskal(const Polyhedron& P)
vertex_iterator vb, ve;
int index = 0;

// boost::tie assigns the first and second element of the std::pair
// std::tie assigns the first and second element of the std::pair
// returned by boost::vertices to the variables vb and ve
for(boost::tie(vb, ve)=vertices(P); vb!=ve; ++vb){
for(std::tie(vb, ve)=vertices(P); vb!=ve; ++vb){
vertex_index_pmap[*vb]= index++;
}

Expand All @@ -59,7 +59,7 @@ kruskal(const Polyhedron& P)
" coord Coordinate {\n"
" point [ \n";

for(boost::tie(vb, ve) = vertices(P); vb!=ve; ++vb){
for(std::tie(vb, ve) = vertices(P); vb!=ve; ++vb){
std::cout << " " << (*vb)->point() << "\n";
}

Expand Down
6 changes: 3 additions & 3 deletions BGL/examples/BGL_polyhedron_3/kruskal_with_stored_id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ kruskal( const Polyhedron& P)
"point [ \n";

vertex_iterator vb, ve;
for(boost::tie(vb,ve) = vertices(P); vb!=ve; ++vb){
for(std::tie(vb,ve) = vertices(P); vb!=ve; ++vb){
std::cout << (*vb)->point() << "\n";
}

Expand Down Expand Up @@ -75,9 +75,9 @@ int main() {
vertex_iterator vb, ve;
int index = 0;

// boost::tie assigns the first and second element of the std::pair
// std::tie assigns the first and second element of the std::pair
// returned by boost::vertices to the variables vit and ve
for(boost::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){
for(std::tie(vb,ve)=vertices(P); vb!=ve; ++vb ){
vertex_descriptor vd = *vb;
vd->id() = index++;
}
Expand Down
2 changes: 1 addition & 1 deletion BGL/examples/BGL_polyhedron_3/normals.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void calculate_face_normals(const HalfedgeGraph& g,
typedef typename boost::property_traits<NormalMap>::value_type normal;

face_iterator fb, fe;
for(boost::tie(fb, fe) = faces(g); fb != fe; ++fb)
for(std::tie(fb, fe) = faces(g); fb != fe; ++fb)
{
halfedge_descriptor edg = halfedge(*fb, g);
halfedge_descriptor edgb = edg;
Expand Down
4 changes: 2 additions & 2 deletions BGL/examples/BGL_polyhedron_3/range.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ void fct(const Polyhedron& p)
std::cout << vd->point() << std::endl;
}

std::cout << "boost::tie + std::for_each" << std::endl;
std::cout << "std::tie + std::for_each" << std::endl;
vertex_iterator vb, ve;

boost::tie(vb,ve) = vertices_range(p);
std::tie(vb,ve) = vertices_range(p);
std::for_each(vb,ve, Fct());
}

Expand Down
2 changes: 1 addition & 1 deletion BGL/examples/BGL_polyhedron_3/transform_iterator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ int main(int argc, char** argv)
typedef boost::transform_iterator<Source<Polyhedron>,halfedge_around_target_iterator> adjacent_vertex_iterator;

halfedge_around_target_iterator hb,he;
boost::tie(hb,he) = halfedges_around_target(halfedge(vd,P),P);
std::tie(hb,he) = halfedges_around_target(halfedge(vd,P),P);
adjacent_vertex_iterator avib, avie;
avib = boost::make_transform_iterator(hb, Source<Polyhedron>(P));
avie = boost::make_transform_iterator(he, Source<Polyhedron>(P));
Expand Down
2 changes: 1 addition & 1 deletion BGL/examples/BGL_surface_mesh/surface_mesh_partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ int main(int argc, char** argv)
std::ofstream outxyz("out.xyz");
outxyz.precision(17);
boost::graph_traits<SM>::vertex_iterator vit, ve;
boost::tie(vit, ve) = vertices(sm);
std::tie(vit, ve) = vertices(sm);
for(; vit!=ve; ++vit)
{
if(get(vertex_pid_map, *vit) == 0)
Expand Down
4 changes: 2 additions & 2 deletions BGL/include/CGAL/boost/graph/Dual.h
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ edge(typename boost::graph_traits<Dual<P> >::vertex_descriptor u,
const Dual<P>& dual)
{
typename boost::graph_traits<Dual<P> >::out_edge_iterator e, e_end;
for(boost::tie(e, e_end) = out_edges(u, dual); e != e_end; ++e) {
for(std::tie(e, e_end) = out_edges(u, dual); e != e_end; ++e) {
if(target(*e, dual) == v)
return std::make_pair(*e, true);
}
Expand Down Expand Up @@ -391,7 +391,7 @@ halfedge(typename boost::graph_traits<Dual<P> >::vertex_descriptor u,
const Dual<P>& dual)
{
typename boost::graph_traits<Dual<P> >::out_edge_iterator e, e_end;
for(boost::tie(e, e_end) = out_edges(u, dual); e != e_end; ++e) {
for(std::tie(e, e_end) = out_edges(u, dual); e != e_end; ++e) {
if(target(*e, dual) == v)
return std::make_pair(halfedge(*e, dual), true);
}
Expand Down
14 changes: 7 additions & 7 deletions BGL/include/CGAL/boost/graph/Euler_operations.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ join_vertex(typename boost::graph_traits<Graph>::halfedge_descriptor h,
CGAL_assertion( halfedge(v_to_remove, v, g).first == h );

halfedge_around_vertex_iterator ieb, iee;
for(boost::tie(ieb, iee) = halfedges_around_target(hop, g); ieb != iee; ++ieb) {
for(std::tie(ieb, iee) = halfedges_around_target(hop, g); ieb != iee; ++ieb) {
CGAL_assertion( target(*ieb,g) == v_to_remove);
set_target(*ieb ,v , g);
}
Expand Down Expand Up @@ -615,7 +615,7 @@ bool can_add_face(const VertexRange& vrange, const PMesh& sm)
for(std::size_t i=0; i < N; ++i){
halfedge_descriptor hd;
bool found;
boost::tie(hd,found) = halfedge(face[i],face[i+1],sm);
std::tie(hd,found) = halfedge(face[i],face[i+1],sm);
if(found && (! is_border(hd,sm))){
return false;
}
Expand Down Expand Up @@ -1149,7 +1149,7 @@ void make_hole(typename boost::graph_traits<Graph>::halfedge_descriptor h,

face_descriptor fd = face(h, g);
halfedge_around_face_iterator hafib, hafie;
for(boost::tie(hafib, hafie) = halfedges_around_face(h, g);
for(std::tie(hafib, hafie) = halfedges_around_face(h, g);
hafib != hafie;
++hafib){
CGAL_assertion(! is_border(opposite(*hafib,g),g));
Expand Down Expand Up @@ -1361,7 +1361,7 @@ add_vertex_and_face_to_border(typename boost::graph_traits<Graph>::halfedge_desc
internal::set_border(he2,g);

CGAL::Halfedge_around_face_iterator<Graph> hafib,hafie;
for(boost::tie(hafib, hafie) = halfedges_around_face(ohe1, g);
for(std::tie(hafib, hafie) = halfedges_around_face(ohe1, g);
hafib != hafie;
++hafib){
set_face(*hafib, f, g);
Expand Down Expand Up @@ -1421,7 +1421,7 @@ add_face_to_border(typename boost::graph_traits<Graph>::halfedge_descriptor h1,
internal::set_border(newhop, g);

CGAL::Halfedge_around_face_iterator<Graph> hafib,hafie;
for(boost::tie(hafib, hafie) = halfedges_around_face(newh, g);
for(std::tie(hafib, hafie) = halfedges_around_face(newh, g);
hafib != hafie;
++hafib){
set_face(*hafib, f, g);
Expand Down Expand Up @@ -1458,15 +1458,15 @@ does_satisfy_link_condition(typename boost::graph_traits<Graph>::edge_descriptor
// The following loop checks the link condition for v0_v1.
// Specifically, that for every vertex 'k' adjacent to both 'p and 'q', 'pkq' is a face of the mesh.
//
for ( boost::tie(eb1,ee1) = halfedges_around_source(v0,g) ; eb1 != ee1 ; ++ eb1 )
for ( std::tie(eb1,ee1) = halfedges_around_source(v0,g) ; eb1 != ee1 ; ++ eb1 )
{
halfedge_descriptor v0_k = *eb1;

if ( v0_k != v0_v1 )
{
vertex_descriptor k = target(v0_k,g);

for ( boost::tie(eb2,ee2) = halfedges_around_source(k,g) ; eb2 != ee2 ; ++ eb2 )
for ( std::tie(eb2,ee2) = halfedges_around_source(k,g) ; eb2 != ee2 ; ++ eb2 )
{
halfedge_descriptor k_v1 = *eb2;

Expand Down
8 changes: 4 additions & 4 deletions BGL/include/CGAL/boost/graph/Face_filtered_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ vertices(const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)

typename Face_filtered_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w);
g_vertex_iterator b,e;
boost::tie(b,e) = vertices(w.graph());
std::tie(b,e) = vertices(w.graph());
return make_range(vertex_iterator(predicate, b, e),
vertex_iterator(predicate, e, e));
}
Expand All @@ -912,7 +912,7 @@ edges(const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)

typename Face_filtered_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w);
g_edge_iterator b,e;
boost::tie(b,e) = edges(w.graph());
std::tie(b,e) = edges(w.graph());
return make_range(edge_iterator(predicate, b, e),
edge_iterator(predicate, e, e));
}
Expand All @@ -931,7 +931,7 @@ out_edges(typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap,

typename Face_filtered_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w);
g_out_edge_iterator b,e;
boost::tie(b,e) = out_edges(v, w.graph());
std::tie(b,e) = out_edges(v, w.graph());
return make_range(out_edge_iterator(predicate, b, e),
out_edge_iterator(predicate, e, e));
}
Expand All @@ -950,7 +950,7 @@ in_edges(typename boost::graph_traits<Face_filtered_graph<Graph, FIMap, VIMap, H

typename Face_filtered_graph<Graph, FIMap, VIMap, HIMap> ::Is_simplex_valid predicate(&w);
g_in_edge_iterator b,e;
boost::tie(b,e) = in_edges(v, w.graph());
std::tie(b,e) = in_edges(v, w.graph());
return make_range(in_edge_iterator(predicate, b, e),
in_edge_iterator(predicate, e, e));
}
Expand Down
16 changes: 8 additions & 8 deletions BGL/include/CGAL/boost/graph/Graph_with_descriptor_with_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ edge(typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::ver
CGAL_assertion(in_same_graph(v,w));
bool b;
g_edge_descriptor ed;
boost::tie(ed,b) = edge(u.descriptor, v.descriptor, *w.graph);
std::tie(ed,b) = edge(u.descriptor, v.descriptor, *w.graph);
return std::make_pair(edge_descriptor(ed,*w.graph),b);
}

Expand All @@ -320,7 +320,7 @@ CGAL::Iterator_range<typename boost::graph_traits<Graph_with_descriptor_with_gra
vertices(const Graph_with_descriptor_with_graph<Graph> & w)
{
typename boost::graph_traits<Graph>::vertex_iterator b,e;
boost::tie(b,e) = vertices(*w.graph);
std::tie(b,e) = vertices(*w.graph);
return std::make_pair(boost::make_transform_iterator(b,typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::V2V(*w.graph)),
boost::make_transform_iterator(e,typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::V2V(*w.graph)));
}
Expand All @@ -330,7 +330,7 @@ CGAL::Iterator_range<typename boost::graph_traits<Graph_with_descriptor_with_gra
edges(const Graph_with_descriptor_with_graph<Graph> & w)
{
typename boost::graph_traits<Graph>::edge_iterator b,e;
boost::tie(b,e) = edges(*w.graph);
std::tie(b,e) = edges(*w.graph);
return std::make_pair(boost::make_transform_iterator(b,typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::E2E(*w.graph)),
boost::make_transform_iterator(e,typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::E2E(*w.graph)));
}
Expand All @@ -342,7 +342,7 @@ out_edges(typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >
{
CGAL_assertion(in_same_graph(v,w));
typename boost::graph_traits<Graph>::out_edge_iterator b,e;
boost::tie(b,e) = out_edges(v.descriptor, *w.graph);
std::tie(b,e) = out_edges(v.descriptor, *w.graph);
return std::make_pair(boost::make_transform_iterator(b,typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::E2E(*w.graph)),
boost::make_transform_iterator(e,typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::E2E(*w.graph)));
}
Expand All @@ -354,7 +354,7 @@ in_edges(typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >:
{
CGAL_assertion(in_same_graph(v,w));
typename boost::graph_traits<Graph>::in_edge_iterator b,e;
boost::tie(b,e) = in_edges(v.descriptor, *w.graph);
std::tie(b,e) = in_edges(v.descriptor, *w.graph);
return std::make_pair(boost::make_transform_iterator(b,typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::E2E(*w.graph)),
boost::make_transform_iterator(e,typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::E2E(*w.graph)));
}
Expand Down Expand Up @@ -557,7 +557,7 @@ halfedge(typename boost::graph_traits< Graph_with_descriptor_with_graph<Graph> >
bool b;
CGAL_assertion(in_same_graph(u,w));
CGAL_assertion(in_same_graph(v,w));
boost::tie(hd,b) = halfedge(u.descriptor, v.descriptor, *w.graph);
std::tie(hd,b) = halfedge(u.descriptor, v.descriptor, *w.graph);
return std::make_pair(halfedge_descriptor(hd,*w.graph),b);
}

Expand Down Expand Up @@ -621,7 +621,7 @@ CGAL::Iterator_range<typename boost::graph_traits<Graph_with_descriptor_with_gra
halfedges(const Graph_with_descriptor_with_graph<Graph> & w)
{
typename boost::graph_traits<Graph>::halfedge_iterator b,e;
boost::tie(b,e) = halfedges(*w.graph);
std::tie(b,e) = halfedges(*w.graph);
return std::make_pair(boost::make_transform_iterator(b, typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::H2H(*w.graph)),
boost::make_transform_iterator(e, typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::H2H(*w.graph)));
}
Expand Down Expand Up @@ -661,7 +661,7 @@ CGAL::Iterator_range<typename boost::graph_traits<Graph_with_descriptor_with_gra
faces(const Graph_with_descriptor_with_graph<Graph> & w)
{
typename boost::graph_traits<Graph>::face_iterator b,e;
boost::tie(b,e) = faces(*w.graph);
std::tie(b,e) = faces(*w.graph);
return std::make_pair(boost::make_transform_iterator(b,typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::F2F(*w.graph)),
boost::make_transform_iterator(e,typename boost::graph_traits<Graph_with_descriptor_with_graph<Graph> >::F2F(*w.graph)));
}
Expand Down
2 changes: 1 addition & 1 deletion BGL/include/CGAL/boost/graph/METIS/partition_dual_graph.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ void partition_dual_graph(const TriangleMesh& tm,

// fill the adjacency info
face_iterator fit, fe;
boost::tie(fit, fe) = faces(tm);
std::tie(fit, fe) = faces(tm);
for(int i=0, j=0; fit!=fe; ++fit, ++i)
{
eptr[i] = j;
Expand Down
Loading

0 comments on commit 14b83f0

Please sign in to comment.