mirror of
https://github.com/boostorg/graph.git
synced 2026-02-25 16:32:09 +00:00
Merge branch 'develop' of github.com:boostorg/graph into develop
This commit is contained in:
@@ -160,6 +160,8 @@ call <tt>get(vertex_index, g)</tt> returns the actual property map object.
|
||||
{
|
||||
// ...
|
||||
|
||||
typedef graph_traits<Graph>::vertex_descriptor Vertex;
|
||||
|
||||
// get the property map for vertex indices
|
||||
typedef property_map<Graph, vertex_index_t>::type IndexMap;
|
||||
IndexMap index = get(vertex_index, g);
|
||||
@@ -167,8 +169,10 @@ call <tt>get(vertex_index, g)</tt> returns the actual property map object.
|
||||
std::cout << "vertices(g) = ";
|
||||
typedef graph_traits<Graph>::vertex_iterator vertex_iter;
|
||||
std::pair<vertex_iter, vertex_iter> vp;
|
||||
for (vp = vertices(g); vp.first != vp.second; ++vp.first)
|
||||
std::cout << index[*vp.first] << " ";
|
||||
for (vp = vertices(g); vp.first != vp.second; ++vp.first) {
|
||||
Vertex v = *vp.first;
|
||||
std::cout << index[v] << " ";
|
||||
}
|
||||
std::cout << std::endl;
|
||||
// ...
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user