
20 Oct
2006
20 Oct
'06
2:21 p.m.
Hi, I'd like to make about whether this is the correct way to retrieve a vertex (or edge) property from graph. In this case, the vertex is property is my_v_prop and the edge property is my_e_prop. //... typedef adjacency_list<vecS, vecS, directedS, my_v_prop, my_e_prop> Graph; //.... std::pair<VI, VI> vi = vertices(g); //VI are vertices iterators. for (; !(vi.first == vi.second); ++vi.first) { vertex_descriptor v = *vi.first; //Now, I want to retrieve the property of v. my_v_prop data = g[v]; } Is it the the best/fastest/easiest way to retrieve the property? Thanks. -- Leandro Terra C. Melo