Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Error C2679 when inserting edge property to subgraph
From: Nicholas Mario Wardhana (mario.wardhana_at_[hidden])
Date: 2013-03-22 15:09:49


On 23 March 2013 02:54, Jeremiah Willcock <jewillco_at_[hidden]> wrote:
> On Sat, 23 Mar 2013, Nicholas Mario Wardhana wrote:
>
>
>> put(get(edge_bundle,g), 0, e); // error here
>
>
> "0" is not a valid edge descriptor. If you want to store the property
> on the edge you added earlier, you'll need to keep its edge descriptor
> (returned from add_edge) and use that as the second argument to put().
>
> -- Jeremiah Willcock

Ah, I didn't realise it. So I changed the code to:

std::pair<Graph::edge_descriptor, bool> ed = add_edge(0, 1, g);
put(get(edge_bundle,g), ed.first, e);

and that solves the problem. Thank you Jeremiah!

Best regards,
Nicholas Mario Wardhana


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