Creating a property map inside Dijkstra Visitor

Good afternoon, Inside a dijkstra visitor I would like to change the edge weights at some point, so in my visitor I'm trying to make a property map called weight :
template<class DynamicMap> class gds_visitor : public dijkstra_visitor<> { public:
gds_visitor(DynamicMap input):dynamic(input){}
....
template
void examine_edge (Edge e, Graph& g) { typename property_map ::type weight; weight=get(edge_weight, g); std::cout << "An edge is being examined..." << "\n"; }
protected: DynamicMap dynamic; };
typedef adjacency_list
where Graph:
property
typedef std::pair
Edge;
But it is not compiling, mentioning a problem with weight 'soperator = . Thank you in advance, Jonas Gabriel

Jonas Gabriel wrote:
Good afternoon,
Inside a dijkstra visitor I would like to change the edge weights at some point, so in my visitor I'm trying to make a property map called weight :
template
void examine_edge (Edge e, Graph& g) { typename property_map ::type weight; weight=get(edge_weight, g);
The "Graph" you get will actually be a const Graph. So you should
probably make the parameter to examine_edge a const Graph& and then
either use the "const_type" of the property map:
template
participants (2)
-
Douglas Gregor
-
Jonas Gabriel