Boost logo

Boost Users :

From: Irek Szczesniak (ijs_at_[hidden])
Date: 2006-04-20 22:55:54


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


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