Boost logo

Boost Users :

Subject: Re: [Boost-users] [BGL] Can't copy_graph the simplest graph with bundled properties
From: Paolo Bolzoni (paolo.bolzoni.brown_at_[hidden])
Date: 2015-12-04 00:08:01


Sorry, I am not sure. However it does seems reasonable, you are giving
the graphs the map between old descriptors and new descriptors; the
same thing you need to do for manual copying.

About operator= vs copy_graph is mainly that the Graph concept is not
required to be Assignable[1], this means that using operator= or swap
is unsafe. So they made this copy function.

I am not sure why this design choice; by intuition I'd think that
Graph should be Assignable at least in some "memberwise copy" sense.

Cheers,
Paolo

[1]http://www.boost.org/doc/libs/1_59_0/libs/graph/doc/Graph.html

On Thu, Dec 3, 2015 at 9:06 PM, Alberto Santini
<santini.alberto_at_[hidden]> wrote:
> On Wednesday, 2 December 2015 03:10:34 UTC+1, Paolo Bolzoni wrote:
>>
>> I am afraid you have to give a custom edge and vertex copier.
>
>
> My bundled properties are so trivial that I shouldn't be supposed to provide
> a copier (hopefully!).
> I figured out that if I just provide a vertex_index_map, the copy succeeds.
> I am not sure if the following is correct, but it gives the correct output:
>
> http://coliru.stacked-crooked.com/a/d1355b0800503892
>
> It would be interesting to know if copy_graph(old_graph, new_graph) is any
> different from new_graph = old_graph. In the first case I needed the
> property map, in the second I don't. But is the second version correct? (I'm
> not even sure the first version is).
>
> I pledge that, if I manage to understand all these mechanisms right one day,
> I'll volunteer for the improvement of the BGL documentation (to make it more
> user-friendly!). :-)
>
> AS
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users


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