Hi,
How to initialize edge index map?
I tried following:
typedef adjacency_list
graph_t;
graph_traits::edge_iterator ei, ei_end;
graph_t graph(num_nodes);
......
adding edges
......
for(tie(ei, ei_end) = edges(graph); ei != ei_end; ++ei, ++index)
put(edge_index, graph, *ei, index);
But I always get a compilation error:
/usr/include/boost/property_map.hpp: In function ‘void boost::put(const
boost::put_get_helper&, K, const V&) [with
PropertyMap = boost::adj_list_edge_property_map,
boost::edge_index_t>, Reference =
boost::detail::error_property_not_found&, K =
boost::detail::edge_desc_impl, V =
int]’:
/usr/include/boost/graph/detail/adjacency_list.hpp:1667: instantiated
from ‘void boost::put(Property, boost::adj_list_helper&,
const Key&, const Value&) [with Config =
boost::detail::adj_list_gen, boost::vecS, boost::vecS, boost::directedS,
boost::property,
boost::property,
boost::no_property, boost::listS>::config, Base =
boost::directed_graph_helper, boost::vecS, boost::vecS, boost::directedS, boost::property, boost::property, boost::no_property, boost::listS>::config>, Property = boost::edge_index_t, Key = boost::detail::edge_desc_impl, Value = int]’
shooting_star_boost_wrapper.cpp:266: instantiated from here
/usr/include/boost/property_map.hpp:319: error: no match for ‘operator=’
in ‘((const boost::adj_list_edge_property_map,
boost::edge_index_t>*)((const
boost::adj_list_edge_property_map,
boost::edge_index_t>&)((const
boost::adj_list_edge_property_map,
boost::edge_index_t>*)(&
pa))))->boost::adj_list_edge_property_map::operator[] [with Directed = boost::directed_tag, Value =
boost::detail::error_property_not_found, Ref =
boost::detail::error_property_not_found&, Vertex = unsigned int,
Property = boost::property, Tag = boost::edge_index_t](k) = v’
/usr/include/boost/pending/detail/property.hpp:21: note: candidates are:
boost::detail::error_property_not_found&
boost::detail::error_property_not_found::operator=(const
boost::detail::error_property_not_found&)
I really can't get through all these template parameters :(
Please, tell me how to initialize this map properly!
Thanks,
Anton.