diff --git a/include/boost/graph/named_function_params.hpp b/include/boost/graph/named_function_params.hpp index b54d2813..6248891f 100644 --- a/include/boost/graph/named_function_params.hpp +++ b/include/boost/graph/named_function_params.hpp @@ -67,6 +67,13 @@ namespace boost { return Params(pmap, *this); } + template + bgl_named_params + weight_map2(const WeightMap& pmap) const { + typedef bgl_named_params Params; + return Params(pmap, *this); + } + template bgl_named_params distance_map(const DistanceMap& pmap) const { @@ -205,6 +212,13 @@ namespace boost { return Params(pmap); } + template + bgl_named_params + weight_map2(WeightMap pmap) { + typedef bgl_named_params Params; + return Params(pmap); + } + template bgl_named_params distance_map(DistanceMap pmap) { @@ -368,10 +382,10 @@ namespace boost { template struct bind { typedef const P& const_result_type; - typedef P& result_type; + typedef const P& result_type; static const_result_type const_apply(const P& p, const Graph&, Tag&) { return p; } - static result_type apply(P& p, Graph&, Tag&) + static result_type apply(const P& p, Graph&, Tag&) { return p; } }; }; @@ -389,7 +403,7 @@ namespace boost { } static result_type - apply(P& p, Graph& g, Tag tag) { + apply(const P& p, Graph& g, Tag tag) { return get(tag, g); } }; @@ -430,7 +444,7 @@ namespace boost { template typename detail::choose_pmap_helper::result_type - choose_pmap(Param& p, Graph& g, PropertyTag tag) + choose_pmap(const Param& p, Graph& g, PropertyTag tag) { typedef typename detail::choose_pmap_helper::type Choice;