I am writing a function that performs some calculation on graphs using the BGL. The way the calculation is done depends on whether the graph is directed or not, but I would like to avoid writing two different functions, one for undirected graphs and one for directed graphs. Both types of graph are defined as follows
using namespace boost;
// Undirected
typedef adjacency_list<listS, vecS, undirectedS> UGraph;
// Directed
typedef adjacency_list<listS, vecS, bidirectionalS> DGraph;
Is there a way to check whether a graph is directed or not from the graph object itself? In other words, is there a way to know, from the graph object, the "directedness" property used (i.e., undirectedS, bidiretionalS or directedS)?