[the Boost Graph library] no matching function : vertices(const Graph& g)
Dear Boost users, I have come across this strange problem: After designing an interface to a library dealing with molecules (OpenBabel). I get the following compiler error: /usr/include/boost/graph/breadth_first_search.hpp: In function void boost::breadth_first_search(const VertexListGraph&, typename boost::graph_traits<G>::vertex_descriptor, Buffer&, BFSVisitor, ColorMap) [with VertexListGraph = OpenBabel::OBMol, Buffer = boost::queue<OpenBabel::OBAtom*, std::deque<OpenBabel::OBAtom*, std::allocator<OpenBabel::OBAtom*> > >, BFSVisitor = boost::VerboseBFSVisitor, ColorMap = std::vector<boost::default_color_type, std::allocator<boost::default_color_type> >]: bfs_example.cpp:73: instantiated from here /usr/include/boost/graph/breadth_first_search.hpp:96: error: no matching function for call to vertices(const OpenBabel::OBMol&) Easy enough you say -- go ahead and write that function. But it is allready in place. After modiying breath_first_search.hpp on line 96 from ... vertices(g) ... to ... gvertices(g) ... and changing the name of my vertices() function to gvertices(). It works. Is there a different vertices() function defined anywhere, that gets in the way? ____________________________________________________________________________________ Looking for earth-friendly autos? Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center. http://autos.yahoo.com/green_center/
Gerd Menche wrote:
Is there a different vertices() function defined anywhere, that gets in the way?
Yes, boost::graph defines a vertices templated function for each type of graph. It returns a bounding iterator pair to the vertices of the graph. Its one parameter is a "const Graph&". There is also an edges function that provides similar access to the graph's edges.
participants (2)
-
Gerd Menche
-
Jeffrey Holle