Hello, I'm currently implementing some algorithms for drawing graphs, using boost::graph. PropertyMaps e.a. are working like a charm, but for my algorithm I need to find the adjacent vertices. Now I've become stuck on the following: typedef boost::adjacency_list < boost::mapS, boost::vecS, boost::undirectedS, VertexProperty, EdgeProperty> Graph; typedef boost::graph_traits<Graph>::vertex_descriptor Vertex; class functor { ... void operator()(Vertex& v) { ... }; }; for_each(adjacent_vertices(u,g).first, adjacent_vertices(u,g).second, functor<Graph>(g)); complains about foo.cc:30: initialization of non-const reference type `Vertex &' foo.cc:30: from rvalue of type `unsigned int' But, when using vertices(g) instead of adjacent_vertices(v,g), the code compiles, and applies functor to each vertex. What am I missing? The documentation is quite thorough, but I'm lost at the moment... EJ
participants (1)
-
EJ van Eijk