On Monday 22 May 2006 11:55, Jean-Charles Campagne wrote:
Given a type of graph G such as : typedef adjacency_list < listS, listS, bidirectionalS > G;
and its reverse graph type : typedef reverse_graph<G> RG
How can I convert a graph RG to a graph G simply ?
reverse_graph doesn't provide any means for such a conversion. Given an RG you can access the underlying G via the public m_g member, but I wouldn't depend on that since m_g is likely to become private in the future.
For instance, I would like to apply a function like : void foo(G x); to graphs of type G as well as type RG.
Can foo be a function template?
I tried to change the type of the function to : void foo(RG x); It worked for some functions, but not for others like : void bar(RG x) { // ... add_vertex(x); //... }
reverse_graph doesn't model MutableGraph. D.