Boost logo

Boost Users :

Subject: Re: [Boost-users] BGL: Copying graphs and edge_descriptors confusion
From: Jeremiah Willcock (jewillco_at_[hidden])
Date: 2011-06-27 13:49:33


On Mon, 27 Jun 2011, David Doria wrote:

>> I can't explain to you why you observe this unexpected behavior, but there is
>> also the copy_graph() function in the BGL which might perhaps suit your needs?
>
> Good to know, but that didn't change anything. I changed
>
> Graph g = inputGraph;
>
> to
>
> Graph g;
> boost::copy_graph(inputGraph, g);
>
> and the output was identical.
>
> Any other thoughts?

Iterators are not preserved among copies of an object; they aren't in STL
either. You need to use iterators from the same graph that you are trying
to access with them. Note that this is also true for vertex and edge
descriptors for some graph types (listS is the most common).

-- 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