[Graph] visitor dijkstra_shortest_paths

Hi all, Can someone explain me why I get an error with the first one and not the second? 1) (error) boost::dijkstra_shortest_paths(m_ugraph,*vertex_iterator_begin, boost::distance_map(boost::make_iterator_property_map(dist_map.begin(), boost::get(boost::vertex_index, m_ugraph))), boost::visitor(dijkstra_vis( *vertex_iterator_begin, superStorage ) )); 2) (good) boost::dijkstra_shortest_paths(m_ugraph,*vertex_iterator_begin, boost::distance_map(boost:: make_iterator_property_map(dist_map.begin(), boost::get(boost::vertex_index, m_ugraph))).visitor(dijkstra_vis( *vertex_iterator_begin, superStorage )) ); Why I need to "." the visitor on the distance_map? BFS is ok with it: (good) boost::breadth_first_search(m_ugraph, *vertex_iterator_begin , boost ::visitor(bfs_vis( *vertex_iterator_begin, superStorage ) )); Best, Tasos

On Thu, 31 Jan 2013, The Maschine wrote:
Hi all,
Can someone explain me why I get an error with the first one and not the second?
1) (error) boost::dijkstra_shortest_paths(m_ugraph,*vertex_iterator_begin, boost::distance_map(boost::make_iterator_property_map(dist_map.begin(), boost::get(boost::vertex_index, m_ugraph))),
boost::visitor(dijkstra_vis( *vertex_iterator_begin, superStorage ) ));
The syntax for named parameters in Boost.Graph requires periods, so all named arguments show up as a single argument to C++.
2) (good) boost::dijkstra_shortest_paths(m_ugraph,*vertex_iterator_begin, boost::distance_map(boost::make_iterator_property_map(dist_map.begin(), boost::get(boost::vertex_index, m_ugraph))).visitor(dijkstra_vis( *vertex_iterator_begin, superStorage )) );
Why I need to "." the visitor on the distance_map?
That's how it was implemented (before Boost.Parameter or variadic templates existed).
BFS is ok with it:
(good) boost::breadth_first_search(m_ugraph, *vertex_iterator_begin , boost::visitor(bfs_vis( *vertex_iterator_begin, superStorage ) ));
You only have one named argument there; if you had more, you would need to use a period between those as well. -- Jeremiah Willcock
participants (2)
-
Jeremiah Willcock
-
The Maschine