From 70a5ab79dd465fc63284656dce7cce09cbcd69d7 Mon Sep 17 00:00:00 2001 From: Jeremy Siek Date: Mon, 7 May 2001 15:50:16 +0000 Subject: [PATCH] fixed num_vertices() and num_edges() [SVN r10045] --- include/boost/graph/filtered_graph.hpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/include/boost/graph/filtered_graph.hpp b/include/boost/graph/filtered_graph.hpp index 5f6b3a6c..6a1e6515 100644 --- a/include/boost/graph/filtered_graph.hpp +++ b/include/boost/graph/filtered_graph.hpp @@ -263,13 +263,21 @@ namespace boost { template typename filtered_graph::vertices_size_type num_vertices(const filtered_graph& g) { - return num_vertices(g); + typename filtered_graph::vertices_size_type n = 0; + typename filtered_graph::vertex_iterator f, l; + for (tie(f, l) = vertices(g); f != l; ++f) + ++n; + return n; } template typename filtered_graph::edges_size_type num_edges(const filtered_graph& g) { - return num_edges(g); + typename filtered_graph::edges_size_type n = 0; + typename filtered_graph::edge_iterator f, l; + for (tie(f, l) = edges(g); f != l; ++f) + ++n; + return n; } template