From 43e53a0cd2e81bd9b0a13d1d7e473ac56f576760 Mon Sep 17 00:00:00 2001 From: andreacassioli Date: Fri, 23 Oct 2026 18:31:03 +0200 Subject: [PATCH] use make_iterator_range in csr example --- example/csr-example.cpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/example/csr-example.cpp b/example/csr-example.cpp index 456ccd824..6d0cf832e 100644 --- a/example/csr-example.cpp +++ b/example/csr-example.cpp @@ -8,8 +8,8 @@ // Andrew Lumsdaine #include +#include #include -#include #include #include #include @@ -43,15 +43,19 @@ int main() // Set the URLs of each vertex int index = 0; - BGL_FORALL_VERTICES(v, g, WebGraph) - g[v].url = urls[index++]; + for(const auto v : boost::make_iterator_range(vertices(g))) + { + g[v].url = urls[index++]; + } // Output each of the links std::cout << "The web graph:" << std::endl; - BGL_FORALL_EDGES(e, g, WebGraph) - std::cout << " " << g[source(e, g)].url << " -> " << g[target(e, g)].url - << std::endl; + for(const auto& e : boost::make_iterator_range(edges(g))) + { + std::cout << " " << g[source(e, g)].url << " -> " << g[target(e, g)].url + << std::endl; + } // Output the graph in DOT format dynamic_properties dp; dp.property("label", get(&WebPage::url, g));