Boost logo

Boost Users :

Subject: [Boost-users] Boost Graph: add_edge causes compiler error
From: Trevor Harmon (Trevor.W.Harmon_at_[hidden])
Date: 2010-03-26 18:45:07


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;
}


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