[graph] filtered graph and num_vertices

Hi All, I have a graph, and I use a filter like this. struct FilteredGraph : public boost::filtered_graph<SomeGraph, SomeFilter > { FilteredGraph(SomeGraph g) : boost::filtered_graph<SomeGraph, SomeFilter>(g, SomeFilter(g)) {} }; I want to use in this function. template <class Graph>void some_graph_function(const Graph& g) { const size_t vertex_num = boost::num_vertices(g); //... } Like this: FilteredGraph fg(g) some_graph_function(fg); And I get:
error: no matching function for call to 'num_vertices(const FilteredGraph&)' const size_t vertex_num = boost::num_vertices(g); ^
From the boost 1.55 documentation:
The num_vertices <http://www.boost.org/doc/libs/1_55_0/libs/graph/doc/filtered_graph.html#num_vertices> and num_edges <http://www.boost.org/doc/libs/1_55_0/libs/graph/doc/filtered_graph.html#num_edges> functions do not filter before returning results, so they return the number of vertices or edges in the underlying graph, unfiltered [2] <http://www.boost.org/doc/libs/1_55_0/libs/graph/doc/filtered_graph.html#2>. So it should work.
What am I missing? Regards, Miklós
participants (1)
-
Miklós Tóth