Boost logo

Boost Users :

From: Stephan Diederich (stephan.diederich_at_[hidden])
Date: 2007-04-16 08:47:22


On 4/15/07, Shufei Fan <fansf_at_[hidden]> wrote:
> Stephan Diederich <stephan.diederich <at> googlemail.com> writes:
>
> >
> > Hi Shufei,
> >
> > On 4/10/07, Shufei Fan <fansf <at> hotmail.com> wrote:
> > [snip]
> >
> > > I found out later that a member defined in my class GA was causing the
> > > compiling error:
> >
> > This seems to work for me (currently on apple's gcc 4.01):
> >
> > struct GA {
> > Graph *rowGraph;
> > boost::property_map<Graph, int Node::*>::type nmt;
> >
> > GA():rowGraph(0){
> > rowGraph = new Graph();
> > nmt = get(&Node::count, *rowGraph);
> > };
> >
> > ~GA(){
> > if(rowGraph) delete rowGraph;
> > }
> > };
> >
> > HTH,
> > Stephan
> Are you saying initialize the property-pointer in the class GA's constructor?

I just wanted to get a working example ;)

> I tried this, I am on windows vc2003.net, but that still doesnot compile. I've
> switched to using local variable instead(although more local definitions, but
> easier to get it work anyway)

Maybe we can get Doug (the one who made the Bundled Properties) to
comment on this...

Cheers,
Stephan


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