Boost logo

Boost Users :

From: Douglas Gregor (gregod_at_[hidden])
Date: 2004-05-11 09:31:12


On Tuesday 11 May 2004 05:59 am, boost_at_[hidden] wrote:
> Hi,
> is it possible to use an edge_descriptor
> (boost::graph_traits<G>::edge_descriptor) as key in a map?

In general, no. Edge descriptors can typically only be compared via == and !=.
One notable exception is when the edge list type is "vecS" in an
adjacent_list, because those edge descriptors can be used as integral types.

> I intend to write a visitor class which sets a boolean to each edge, and
> therefore I need the edge as key.

Common ways to do this include using internal properties and maintaining your
own edge_index (internal) property so that you can build property maps out of
vectors.

        Doug


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