|
Boost Users : |
From: Doug Gregor (dgregor_at_[hidden])
Date: 2004-11-08 11:22:14
On Nov 8, 2004, at 12:10 AM, Stephen torri wrote:
> What is the best method for storing a type in a boost graph vertex? By
> value or pointer?
By value is preferred. The BGL will allocate it via a pointer anyway if
it needs to be.
> I have the following graph type:
>
>
> typedef property< vertex_index_t, uint32_t,
> property< vertex_name_t, boost::shared_ptr<Component> > >
> VertexProperty;
>
> typedef adjacency_list<setS, // OutEdgeList
> setS, // VertexList
> directedS, // Directed
> VertexProperty> // VertexProperties
> Graph_Type;
>
>
> The Component is a class. I thought it was best to store it in the
> vertex as a pointer. Is this going to cause me trouble?
It won't cause you trouble, but it isn't necessary, either. In 1.32.0,
you'll be able to write just:
typedef adjacency_list<setS, setS, directedS, Component> Graph_Type;
This is the "bundled properties" feature.
Doug
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