Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost Graph: add_edge causes compiler error
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2010-03-29 20:37:54


> Is there a way to add an edge if I don't know the vertex indices? For
>> instance, let's say I've only got the two Foo pointers and I want to
>> add an edge between them.
>>
>
>
> I figured out a way to do it:
>
> graph_traits<Graph>::vertex_descriptor u = add_vertex(&foo1, g);
> graph_traits<Graph>::vertex_descriptor v = add_vertex(&foo2, g);
> add_edge(u, v, g);

That's the right way :) I think I must have misunderstood your previous
question.

Andrew Sutton
andrew.n.sutton_at_[hidden]



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