|
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