Boost logo

Boost Users :

Subject: [Boost-users] [Boost.Graph] - problem with A* and bundled properties
From: David Conner (dcconner_at_[hidden])
Date: 2009-01-08 17:56:22


I'm trying to use Bundled properties with astar.
But I get the following error, below.
1>C:\Program Files\Microsoft Visual Studio 9.0\VC\include\limits(109)
: error C2440: '<function-style-cast>' : cannot convert from 'int' to
'C'
1> No constructor could take the source type, or constructor
overload resolution was ambiguous
1> C:\Program Files\Microsoft Visual Studio
9.0\VC\include\limits(107) : while compiling class template member
function 'C std::numeric_limits<_Ty>::max(void) throw()'
1> with
1> [
1> _Ty=C
1> ]
1> C:\Boost\include\boost-1_36\boost/graph/astar_search.hpp(342)
: see reference to class template instantiation
'std::numeric_limits<_Ty>' being compiled
1> with
1> [
1> _Ty=C
1> ]

I noticed that this is the same problem as a post from January 2008
(Date: 2008-01-09 17:56:40), but there was no reply posted.
The source code is attached; I get the same error with Boost 1.36 or 1.37

Here are my structures:
class EdgePropertyMap
{
public:
  cost weight;
};

  typedef boost::property_map<mygraph_t, cost
EdgePropertyMap::*>::type WeightMap;
  WeightMap weightmap = boost::get(&EdgePropertyMap::weight, g);

    boost::astar_search
      (g,
       start,
       distance_heuristic<mygraph_t, cost, location*>(locations, goal),
       boost::visitor(astar_goal_visitor<vertex>(goal)). // Only the
first of named parameters needs boost::
              predecessor_map(&p[0]).distance_map(&d[0])
      );//.

Any help?

Thanks,

David

----- Earlier post
--------------------------------------------------------------------------

Christopher Gay (cgay_at_[hidden])
Date: 2008-01-09 17:56:40

I'm having a problem implementing A*. I used Mr Beevers cities
example as a spring board for my own version. I am using bundled
properties and I am getting an error that I am unsure of how to
correct. The error revolves around the CostMap template parameter for
the astar_search. It typedefs the value_type to 'C' and the error
tells me that I cannot convert int to 'C' in the
std::numeric_limits<C>::max call in astar_dispatch2. I am not passing
an object/container for the CostMap parameter. Attached are the files
I am working with.

Thanks for your help!
Chris Gay




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