Boost logo

Boost :

From: Johan Nilsson (johan.nilsson_at_[hidden])
Date: 2004-05-28 07:56:54


"Jeff Flinn" <TriumphSprint2000_at_[hidden]> wrote in message
news:c97afd$60h$1_at_sea.gmane.org...
>
> "Johan Nilsson" <johan.nilsson_at_[hidden]> wrote in message
> news:c96p5d$qlg$1_at_sea.gmane.org...
> >

[...]

> matter
> > if this is a two-step procedure:
> > Allocate in constructors + Initialize in entry
> > or one-step:
> > Allocate and initialize in constructor.
>
> class astate : non_copyable
> {
> T& mRef;
>
> astate();
>
> public:
>
> astate( T& aRef ):mRef(aRef){ aRef.somefunction(); }
>
> void init( T& aRef ){ mRef = aRef; mRef.somefunction(); } // not the
> same
>
> };

No, of course not. I meant:

// one-step
class astate : non_copyable { ...
    astate( T& aRef ):mRef(aRef){ aRef.somefunction(); }
... };

versus:

// two-step
class astate : non_copyable { ...
    astate( T& aRef ):mRef(aRef){}
    void entry(){ mRef.somefunction(); }
... };

Regards,

// Johan


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk