
On Mon, 26 Sep 2011, Christoph wrote:
Dear List,
i just started learning about The Boost Graph Library. Here is my Problem in a minimal example:
#include <iostream> #include
typedef boost::adjacency_list < boost::listS, boost::listS, boost::bidirectionalS> Map; int main() { Map map; std::cout << "number of vertices: " << num_vertices(map) << std::endl; Map::vertex_descriptor u = boost::add_vertex (map);; Map::vertex_descriptor v = boost::add_vertex (map);; std::cout << "number of vertices: " << num_vertices(map) << std::endl;
Map::add_edge (u, v, map); // <- problem return 0; }
The compiler tells me that ‘add_edge’ is not a member of ‘Map’. I would like to know why and what am i doing wrong by writing "Map::add_edge (u, v, map);"
The add_edge() function should be called unqualified; the compiler will find the correct definition. In particular, it is not a member of any class (static or non-static). -- Jeremiah Willcock