Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL: shared_ptr as bundled properties > how to generate properties maps ???
From: Emil Dotchevski (emildotchevski_at_[hidden])
Date: 2010-01-06 14:57:21


On Wed, Jan 6, 2010 at 8:20 AM, Damien Maupu <damien.maupu_at_[hidden]> 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.)

Emil Dotchevski
Reverge Studios, Inc.
http://www.revergestudios.com/reblog/index.php?n=ReCode


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