$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r82439 - trunk/libs/graph/example
From: jewillco_at_[hidden]
Date: 2013-01-10 17:49:11
Author: jewillco
Date: 2013-01-10 17:49:10 EST (Thu, 10 Jan 2013)
New Revision: 82439
URL: http://svn.boost.org/trac/boost/changeset/82439
Log:
Changed to iterator_property_map; fixes #7877
Text files modified: 
   trunk/libs/graph/example/dijkstra-example.cpp |    24 ++++--------------------                
   1 files changed, 4 insertions(+), 20 deletions(-)
Modified: trunk/libs/graph/example/dijkstra-example.cpp
==============================================================================
--- trunk/libs/graph/example/dijkstra-example.cpp	(original)
+++ trunk/libs/graph/example/dijkstra-example.cpp	2013-01-10 17:49:10 EST (Thu, 10 Jan 2013)
@@ -12,6 +12,7 @@
 #include <boost/graph/graph_traits.hpp>
 #include <boost/graph/adjacency_list.hpp>
 #include <boost/graph/dijkstra_shortest_paths.hpp>
+#include <boost/property_map/property_map.hpp>
 
 using namespace boost;
 
@@ -32,32 +33,15 @@
   };
   int weights[] = { 1, 2, 1, 2, 7, 3, 1, 1, 1 };
   int num_arcs = sizeof(edge_array) / sizeof(Edge);
-#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
-  graph_t g(num_nodes);
-  property_map<graph_t, edge_weight_t>::type weightmap = get(edge_weight, g);
-  for (std::size_t j = 0; j < num_arcs; ++j) {
-    edge_descriptor e; bool inserted;
-    boost::tie(e, inserted) = add_edge(edge_array[j].first, edge_array[j].second, g);
-    weightmap[e] = weights[j];
-  }
-#else
   graph_t g(edge_array, edge_array + num_arcs, weights, num_nodes);
   property_map<graph_t, edge_weight_t>::type weightmap = get(edge_weight, g);
-#endif
   std::vector<vertex_descriptor> p(num_vertices(g));
   std::vector<int> d(num_vertices(g));
   vertex_descriptor s = vertex(A, g);
 
-#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
-  // VC++ has trouble with the named parameters mechanism
-  property_map<graph_t, vertex_index_t>::type indexmap = get(vertex_index, g);
-  dijkstra_shortest_paths(g, s, &p[0], &d[0], weightmap, indexmap, 
-                          std::less<int>(), closed_plus<int>(), 
-                          (std::numeric_limits<int>::max)(), 0,
-                          default_dijkstra_visitor());
-#else
-  dijkstra_shortest_paths(g, s, predecessor_map(&p[0]).distance_map(&d[0]));
-#endif
+  dijkstra_shortest_paths(g, s,
+                          predecessor_map(boost::make_iterator_property_map(p.begin(), get(boost::vertex_index, g))).
+                          distance_map(boost::make_iterator_property_map(d.begin(), get(boost::vertex_index, g))));
 
   std::cout << "distances and parents:" << std::endl;
   graph_traits < graph_t >::vertex_iterator vi, vend;