
26 Mar
2010
26 Mar
'10
4:45 p.m.
Hi, Could someone please help me understand why the simple program below won't compile? On the call to add_edge, I get: error: invalid conversion from ‘Foo*’ to ‘long unsigned int’ ...followed by two "initializing argument" errors. I've read all the docs I could find on add_edge, but I still don't understand why the code below won't work. Thanks for any help, Trevor #include "boost/graph/adjacency_list.hpp" using namespace boost; typedef struct FooType { } Foo; int main() { typedef adjacency_list<vecS, vecS, directedS, Foo*> Graph; Graph g; Foo foo1, foo2; add_vertex(&foo1, g); add_vertex(&foo2, g); add_edge(g[0], g[1], g); return 0; }