On 20/12/2011 16:22, Jeremiah Willcock wrote:
On Tue, 20 Dec 2011, Alex Hagen-Zanker wrote:
I upgraded from boost 1.45 to 1.48 and there are some breaking changes related to reverse_graph
The main problem that I encounter is that boost::edge(u ,v, graph) returns a edge_descriptor to the graph that underlies reverse_graph, rather than reverse_graph itself . The following therefore does not compile:
template<typename Graph> void foo(Graph& graph) { boost::graph_traits<Graph>::edge_descriptor e = boost::edge(0, 1, graph).first; }
That is a bug in that case; please file a ticket about it. boost::edge should always return an edge in the graph you call it on.
Do you have suggestions how to rewrite foo(Graph& graph) in order to generically work for both plain and reversed graphs? For now I have rewritten the boost::edge function in reverse_graph.hpp to return a pair
but that does not seem right. That is the right solution, actually, to match the specification of boost::edge. Please send a patch if you can.