Boost logo

Boost Users :

From: Douglas Gregor (doug.gregor_at_[hidden])
Date: 2006-01-31 08:55:43

On Jan 31, 2006, at 6:37 AM, Jef Driesen wrote:

> Suppose I have defined the following graph:
> typedef boost::adjacency_list<
> boost::setS, // Adjacency list
> boost::setS, // Vertex list
> boost::undirectedS, // Undirected graph
> unsigned int, // Vertex property (unique label)
> boost::no_property, // Edge property
> unsigned int, // Graph property (next unique label)
> boost::listS // Edge list
>> graph;
> But I can't find a way to access property associated with my graph.
> How
> can I do this?

This is an omission (bug) in the BGL. If you change your graph type
to this:

typedef boost::adjacency_list<
     boost::setS, // Adjacency list
     boost::setS, // Vertex list
     boost::undirectedS, // Undirected graph
     unsigned int, // Vertex property (unique label)
     boost::no_property, // Edge property
     boost::property<boost::graph_name_t, unsigned int>, //
Graph property (next unique label)
     boost::listS // Edge list
> graph;

You can get at the graph property with:

   get_property(graph_instance, boost::graph_name())

We'll find a better way to handle this in the next Boost release.


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at