Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2003-12-29 14:36:46


"Bronek Kozicki" <brok_at_[hidden]> wrote in message
news:010001c3ce3a$193a1dd0$d801a8c0_at_waw.home...
> I need to be able to assign auto_ptr from shared_ptr. Here's simplified
> sample use:
>
> class M {
> boost::shared_ptr<int> ptr1_;
> boost::shared_ptr<int> ptr2_;
> public:
> M() : ptr1_ (boost::shared_ptr<int> (new int))
> {}
>

It's sufficient to write ptr1_(new int) here.

>
> Lack of such release function is real problem for me. Why it's not
> provided in shared_ptr? Is there any workaround I could use?
>

This question is addressed directly in the FAQ? (Q. Why doesn't shared_ptr
provide a release() function? )

HTH.

Jonathan


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