Boost logo

Boost Users :

Subject: Re: [Boost-users] Boost Graph: vertex class has no copy constructor
From: Trevor Harmon (Trevor.W.Harmon_at_[hidden])
Date: 2010-03-26 14:36:56


On Mar 26, 2010, at 5:42 AM, Andrew Sutton wrote:

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

Yes, I had tried that, and the pointers are added to the graph okay
using add_vertex, but when I try to pull them out using, say,
graph[0], my program segfaults. I have no idea what I'm doing wrong.

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

So instead of:

   typedef directed_graph<BasicBlock*> TimingGraph;

I should do maybe:

   typedef adjacency_list<vecS, vecS, directedS, BasicBlock*>
TimingGraph;

?

Trevor


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