Boost logo

Boost Users :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-07-16 13:08:20


AMDG

Meryl Silverburgh wrote:
> when I switch to use boost shared_ptr, i.e. switch from 'B* b' to
> 'shared_ptr<B> b' in A's class definition.
>
> I don't need to do 'b= NULL' in A's constructor, right?
>

Correct.

> But why this line won't compile "b = new B();" ?
>

Use b.reset(new B());

In Christ,
Steven Watanabe


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