[Boost-bugs] [Boost C++ Libraries] #4715: custom property_map no longer works for astar_search

Subject: [Boost-bugs] [Boost C++ Libraries] #4715: custom property_map no longer works for astar_search
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-10-05 23:48:52


#4715: custom property_map no longer works for astar_search
-----------------------------------------------------+----------------------
 Reporter: Szymon Gatner <szymon.gatner@…> | Owner:
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: None
  Version: Boost 1.44.0 | Severity: Problem
 Keywords: |
-----------------------------------------------------+----------------------
 After updating from boost 1.43 to 1.44 code calling astar_search with
 custom property map no longer compiles with error:

 Error 2 error C2039: 'value_type' : is not a member of
 'boost::property_traits<PA>'
 c:\libs\boost_1_44_0\boost\graph\astar_search.hpp 323

 dijkstra_shortest_paths_no_color_map() with same property map still
 compiles correctly.

 custom property map:


 {{{
 template <typename Functor, typename Arg>
 struct function_property_map {
 private:
   Functor f;

 public:
   typedef typename boost::property_traits<
     function_property_map<Functor, Arg>
>::value_type
   value_type;

   explicit function_property_map(const Functor& f): f(f) {}

   friend value_type get(const function_property_map& pm, const Arg& x) {
     return pm.f(x);
   }
 };

 namespace boost {
   template <typename Functor, typename Arg>
   struct property_traits<function_property_map<Functor, Arg> > {
     typedef typename boost::result_of<Functor(Arg)>::type value_type;
     typedef value_type reference;
     typedef Arg key_type;
     typedef boost::readable_property_map_tag category;
   };
 }

 template <typename Arg, typename Functor>
 function_property_map<Functor, Arg>
 make_function_property_map(const Functor& f) {
   return function_property_map<Functor, Arg>(f);
 }
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4715>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:04 UTC