Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost Graph: vertex class has no copy constructor
From: Andrew Sutton (andrew.n.sutton_at_[hidden])
Date: 2010-03-26 08:42:37


Hi Trevor,

Unfortunately, the declaration above causes a slew of compiler errors (see
> below) that appear to be related to BasicBlock's copy constructor. Sure
> enough, I checked BasicBlock.h, and its copy constructor is declared private
> and is not even implemented. There appears to be some sort of design issue
> that prevents this class from having a copy constructor.
>
> Is there some workaround for this on the Boost Graph side, or must vertex
> classes always have a copy constructor?
>

The "easy" workaround is to simply have the graph refer to BasicBlock by
pointer instead of actually owning it. Pointers are definitely default and
copy constructible :) Otherwise, those property classes are largely required
to be copy and/or default constructible.

I might caution you about using directed_graph. It's built over
adjacency_list<listS, listS, ...> so it might not be usable quite the same
way that most of the documentation is listed.

Also, since I wrote the class, if you have any problems with it, please let
me know so I can fix them!

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