
On Wed, 6 Jan 2010, Emil Dotchevski wrote:
On Wed, Jan 6, 2010 at 8:20 AM, Damien Maupu <damien.maupu@epfl.ch> wrote:
I write something like: typedef boost::shared_ptr<Vertex> VertexPtr; typedef boost::shared_ptr<Edge> EdgePtr; typedef adjacency_list<vecS, vecS, directedS, VertexPtr, EdgePtr> Graph;
It is probably not a good idea to use shared_ptr for graphs; some graphs have cycles and this will lead to leaks (if your data structure is a DAG, you're fine.)
I don't think that will be an issue -- his shared pointers link to properties; the graph structure itself is in BGL data structures. However, if the properties refer to other graph vertices or edges, there is an issue of dangling references if those objects are removed from the graph. -- Jeremiah Willcock