21 Apr
2006
21 Apr
'06
2:55 a.m.
I'm trying to have a std::map where the key is an edge of a graph, but I get a compilation error. My graph is: typedef boost::adjacency_list <vecS, vecS, undirectedS, property<vertex_name_t, std::string>, property<edge_weight_t, int, property<edge_weight2_t, int> > > Graph; And an edge: typedef graph_traits<Graph>::edge_descriptor Edge; Then I have a map: std::map<Edge, double> m; But when I try this: m[e] = 0 where e is of type Edge, then I get: /usr/lib/gcc/i386-redhat-linux/3.4.4/../../../../include/c++/3.4.4/bits/stl_function.h:227: error: no match for 'operator<' in '__x < __y' Can I use map with the Edge as the key type? If so, what should I do? Thanks for reading. Best, Irek