Ok, but it still won't work for me.
Let me rephrase my problem:
I have a certain Graph g and I must create several subgraphs from it.
In order to create a subgraph I must declare:
typedef subgraph
Agree with James, shared_ptr can help here...
typedef subgraph
Graph; typedef shared_ptr<Graph> GraphPtr; typedef vector<GraphPtr> Graphs; Graphs graphs; graphs.push_back(GraphPtr(new Graph));
or perhaps
Graphs graphs; graphs.resize(2);
graphs[1].reset(new Graph); graphs[1]->DoStuff();
graphs[0] = GraphPtr(new Graph); graphs[0]->DoStuff();
~Damian();
-----Original Message----- From: boost-users-boun...@lists.boost.org [mailto:boost-users- boun...@lists.boost.org] On Behalf Of fabricio Sent: Wednesday, 8 April 2009 2:54 p.m. To: boost-us...@lists.boost.org Subject: Re: [Boost-users] a vector of subgraphs
oh sorry, forgot to mention, after
vector< Graph& > subG;
I should have something like:
subG.resize(2); subG(0) = G.subgraph();
and subgraph() returns a Graph&
On 7 abr, 21:04, "James C. Sutherland"
wrote: On Apr 7, 2009, at 4:59 PM, fabricio wrote:
typedef subgraph< adjacency_list > Graph;
Graph G;
what I want is to create a:
vector< Graph& > subG;
but the usage of & here is illegal.
Why not use pointers? vector
subG; or vector< boost::shared_ptr<Graph> > subG; _______________________________________________ Boost-users mailing list Boost- us...@lists.boost.orghttp://lists.boost.org/mailman/listinfo.cgi/boost- users
Boost-users mailing list Boost-us...@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
* Scanned by MailMarshal - Marshal's comprehensive email content security solution. Download a free evaluation of MailMarshal atwww.marshal.com* _______________________________________________ Boost-users mailing list Boost-us...@lists.boost.orghttp://lists.boost.org/mailman/listinfo.cgi/boost-users