Boost logo

Boost :

From: Douglas Paul Gregor (gregod_at_[hidden])
Date: 2004-04-05 13:50:55


Jeremy,

On Mon, 5 Apr 2004, Jeremy Siek wrote:
> On Apr 5, 2004, at 11:57 AM, Douglas Paul Gregor wrote:
> > Not this one. Do you really think this extra overhead is going to sink
> > the
> > idea?
>
> Well, it's a pretty major overhead. We're talking an extra load from
> memory
> every time you want to do anything with a vertex descriptor. For the
> slow
> graph structures this is not significant, but this would change the fast
> graph structures into slow ones.
>
> Another idea I had was to make vertex_descriptor some kind of pointer
> proxy
> that defined operator-> to return City*.

If you still want convertability to an (unsigned) int, you'll need to
either store that in the class derived from City or store it directly, so
we'll probably need a proxy in any case.

Personally, I'd be willing to pay for the few extra memory ops (who knows?
they may get optimized away) in most of my work. I think having more
user-friendly graph adaptors graph<Vertex, Edge> and digraph<Vertex, Edge>
would help the usability of the library; adjacency_list can be for those
that need maximal performance (although I suspect that they'd roll their
own graph data structures/algorithms anyway).

        Doug


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