Boost logo

Boost :

From: Brock Peabody (brock.peabody_at_[hidden])
Date: 2003-12-29 14:58:42


> -----Original Message-----
> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
> On Behalf Of AlisdairM
> Sent: Monday, December 29, 2003 1:34 PM
> To: boost_at_[hidden]
> Subject: [boost] Re: how do I release shared_ptr ?
>
> "Bronek Kozicki" <brok_at_[hidden]> wrote in
> news:010001c3ce3a$193a1dd0$d801a8c0_at_waw.home:
>
> > 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?
>
> How would shared_ptr release() a pointer shared with 3 other shared_ptrs?

How about

        shared_ptr<std::auto_ptr<T> > t(new std::auto_ptr<T>(new T))

        //...

        t->release();


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