Boost logo

Boost Users :

Subject: Re: [Boost-users] How to access a GRAPH property? - simple
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2010-08-15 14:19:02


On Sun, 15 Aug 2010, Caligula wrote:

> Thanks Cedric & Jeremiah,
>
> I tried a bunch of stuff
>
>   template < typename Graph >
>     void test_graph_property( Graph & g )
>   {
>
>
>         //get_property(graph_properties, bobo);
>         //g[graph_properties].bobo;
>         //g[graph_bundle].bobo;
>         //g[bobo];
>  
>         //get(bobo,g);
>         //get(g, graph_properties);
>         //cout << g[g].bobo << endl;
>  
>         //get_property(g.graph_properties, bobo);
>         get_property(g, bobo);
>
>   }
>
> But nothing works.
> For "get_property(g, bobo);"  I get
>  
> In function ‘void test_graph_property(Graph&)’:
> error: ‘bobo’ was not declared in this scope
>
>
> The doc pages you refered me to only mention property_maps, as far as I can tell.
> Maybe I need to declare a property_map such as
>
>        property_map < graph_t, int >::type
>           capacity = get(bobo, g);
>
> I would hope that I could avoid this using bundled properties.

You probably can, but bundled graph properties have only been in the Boost
trunk for about a week and are not the 1.43 or 1.44 releases. Otherwise,
you will need to use old-style properties (you can define a single
property that contains your struct of properties, though).

-- Jeremiah Willcock


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