Boost logo

Boost Users :

From: Manuel Yguel (manuel.yguel_at_[hidden])
Date: 2006-08-19 09:59:56


Hello,
I want to make tree class with the BGL and so I need to specify the root of the
tree.
Previously I did that by deriving a graph and adding a graph_descriptor member
like the code below:

typedef boost::adjacency_list< boost::listS, boost::listS, boost::directedS, int
> Graph;

class Tree : public Graph
{
public:
typedef typename boost::graph_traits< Graph >::vertex_descriptor root;
Tree();
};

The constructor create a Vertex then defines root equal to that first vertex.
But with bundled property I wanted to know if it is possible to define the root
in the graph property.
In fact I tried it but I am a bit embarrassed by the cyclic problem:
- graph property needs to know what a vertex_descriptor is,
- graph needs to know what a graph property is,
- graph defines what a vertex_descriptor is.

I tried the Barton-Nackman trick but I failed.

Is it a proper way to do that ? Some advices, or pointers will be really apreciated.

Thanks,
Manuel Yguel.


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