write your own total ordering/comparison function object for Edge objects and declare the map type using this function. On Apr 20, 2006, at 7:55 PM, Irek Szczesniak wrote:
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
, property > > Graph; And an edge:
typedef graph_traits<Graph>::edge_descriptor Edge;
Then I have a map:
std::map
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 _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users