Boost logo

Boost Users :

From: Douglas Paul Gregor (gregod_at_[hidden])
Date: 2004-06-19 22:16:39

On Sun, 20 Jun 2004, Tim Rowe wrote:

> In the Kevin Bacon example in the Boost::Graph documentation, we declare:
> typedef adjacency_list < vecS, vecS, undirectedS, property < vertex_name_t,
> std::string >, property < edge_name_t, std::string > > Graph;
> Graph g;
> and later declare and call:
> typedef property_map < Graph, vertex_name_t >::type actor_name_map_t;
> actor_name_map_t actor_name = get(vertex_name, g);
> What are we actually getting back here? I can see that we can index it (we do later), but is it just an array? Or a vector? Or what? I assume I am /supposed/ to know (not like Ada's "type foo is private"), so that I know what I can do with it!

You're actually getting back an (Lvalue) property map. Think of it like an
std::map<vertex_descriptor, std::string>, because it maps from the
vertices in the graph g to the vertex name (which is an std::string here).
The difference is that the property map is fast (O(1)) whereas the
std::map would be slow (O(log |V|)).

Interior properties will get a bit easier with the next Boost release.


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