Boost logo

Boost Users :

From: Leandro Melo (ltcmelo_at_[hidden])
Date: 2006-10-20 10:21:02


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

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net