>On Monday 22 May 2006 11:55, Jean-Charles Campagne wrote:
>Can foo be a function template?

thanks for the idea ;-)

I've solved my problem type making the function a template and by passing it the two graphs (graph and reverse_graph) :

template< G1, G2 >
foo(G1 g1, G2 g2, x)
{
...
   index = get(index, g1); // I get the properties from g1
   dijkstra_shortest_paths(g2, ....);   // I apply algos to g2
...
}

G1 being a "normal" graph, and G2 being a "normal" graph or a reverse graph :
if I want to work on the "normal" graph I call :
foo(g, g);
and if i want to work on the reversed graph :
foo(g, rg);


JCC