Boost logo

Boost :

From: Neal Fachan (neal_at_[hidden])
Date: 2001-01-12 18:34:28


Hi. I just recently started using the BGL. First, I want to say that BGL is
a great library. Thank you for providing it. I've had three
questions/problems with BGL so far. BTW, I'm using the CVS version with tag
Version_1_20_0.

First, there's an add_edge which takes an edge property, but there isn't an
add_vertex which takes a vertex property. It seems like either both or
neither should exist. I would prefer if there was a second version of
add_vertex which took the property.

Second, when using add_edge on a graph which checks for parallel edges, it
would be handy if the return pair always contained a valid edge descriptor,
even if the edge previously existed. I seem to have a lot of cases which
look like this:

    Edge e;
    bool created;
    boost::tie(e, created) = add_edge(v1, v2, g);
    if (!created)
        boost::tie(e, create) = edge(v1, v2);
    put(propertyMap, e, enabled);

It's not that big of a deal to have to make the "edge" call, but it seems
like add_edge must already have the existing edge to return created=false,
so it should be able to return it.

Third, adding custom property portably is kind of a pain right now. The
documentation reads that one should be able to create an empty struct/class,
but the examples show that you need conditional compilation based on
BOOST_NO_PARTIAL_TEMPLATE_SPECIALIZATION. Additionally, since the
non-partial-specialization version uses an enum value for the instance,
while the "normal" version uses a real class instance, I have to
conditionally define the variable in a .cpp file. I've written some macros
to work around this, but it seems like the old version where you just had a
simple class and could create a simple instance when you needed it,
get(my_tag(), g), was a lot simpler.

Thanks again for providing a great library. I've definitely enjoyed using
it.

--
Neal Fachan

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk