Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] How do I iterate over a labeled graph?
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2012-10-12 15:42:25


On Fri, 12 Oct 2012, eric wrote:

> Okay, thank you ... new issue....
>
> I am using a labeled_graph, and if I assign a vertex property and then try
> to get that node again to check the value (like so):
>
> Vertex rootVert = patentGraph[rootName];
> rootVert.vertType = "Root";
> rootVert = patentGraph[rootName];
>
> At the end rootVert.vertType is no longer "Root". Am I getting some sort of
> const reference such that my assignment is getting dropped on the floor?

If Vertex is your vertex property type, you are getting a copy and so your
updates are being dropped. Declaring rootVert as a Vertex& might fix your
issue.

-- Jeremiah Willcock


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