10 Aug
2003
10 Aug
'03
1:30 a.m.
Hi, First, to address why what you're doing doesn't work, then on to an alternative. The add_edge function is expecting arguments of type graph_traits<Graph>::vertex_descriptor. Another words, you get a compiler error because there is no add_edge function defined for your GraphNode class. As for an alternative, do you really need the node to be a base class, or could you get by with attaching a property to each node, where the property is a base class. The reason I say this is that the BGL adjacency_list graph lets the user specify property types, but not the vertex_descriptor type. Another option, of course, would be to implement your own graph class. Cheers, Jeremy