Boost logo

Boost Users :

Subject: [Boost-users] [BGL] How do I iterate over a labeled graph?
From: eric (eric.burns_at_[hidden])
Date: 2012-10-12 12:31:27


I am trying to iterate over my labeled_graph like so:

struct Vertex
{
        std::string vertType;
};
typedef Graph::vertex_iterator VertexIter;
VertexIter vertexIter, vertexEnd;
for (tie(vertexIter, vertexEnd) = vertices(graph); vertexIter != vertexEnd;
vertexIter++)
{
        std::string vertexType = graph[*vertexIter].vertType;
}

However, I get a compiler error saying that graph has no operator [] that
accepts an unsigned int. How should I be doing what I'm trying to do?

--
View this message in context: http://boost.2283326.n4.nabble.com/BGL-How-do-I-iterate-over-a-labeled-graph-tp4637024.html
Sent from the Boost - Users mailing list archive at Nabble.com.

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