
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