Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL: get(p, g, x) and get(get(p, g), x)
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2012-05-11 16:51:50


On Fri, 11 May 2012, Shaun Jackman wrote:

> Hi,
>
> I’ve implemented a graph that’s quite similar to adjacency_list.
> get(get(vertex_index, g), u) works as expected, but
> get(vertex_index, g, u) does not work.
>
> Is their a default implementation in boost/graph somewhere that
> translates the latter call to the first, or does my graph have to
> implement the following function?

I do not believe there is.

> template <typename Tag, typename Key>
> typename property_map_value<MyGraph, Tag>::type
> get(Tag tag, const MyGraph& g, Key key)
> {
> return get(get(tag, g), key);
> }
>
> When I include this implementation, the get(tag, g, u) call works as expected.

That version is what you want to do, most likely with a more efficient
implementation that avoids actually creating a property map object.

-- 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