Boost logo

Boost Users :

Subject: Re: [Boost-users] [Graph] visitor dijkstra_shortest_paths
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2013-01-31 11:12:29


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net