Boost logo

Boost Users :

From: Doug Gregor (dgregor_at_[hidden])
Date: 2007-07-03 11:22:50


On Jul 3, 2007, at 5:07 AM, Ewgenij Sokolovski wrote:

> Hello, I read in the documentation that the parameter weight_map of
> dijkstra_shortest_paths should be a model of Readable Property Map.
>
> http://www.boost.org/libs/graph/doc/dijkstra_shortest_paths.html
>
> Readable Property Map interface defines a function get(), which has
> to be contained in each implementation of the interface. OK so far.
> But when you look at the example provided with the boost library,
> you see that a simple STL vector is used as weight map.
>
> http://www.boost.org/libs/graph/example/dijkstra-example.cpp
>
> And STL vector doesn't provide a get() function at all. So the
> whole thing shouldn't work at all. So where is the magic
> explanation?:)

The magic is on line 139 of boost/property_map.hpp, which turns
pointers into property maps.

        - Doug


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