Boost logo

Boost :

Subject: Re: [boost] [shared_ptr] delete shared_ptr
From: Nevin Liber (nevin_at_[hidden])
Date: 2011-03-16 21:44:15


On 16 March 2011 15:44, Alexander Pshenichnikov <alpshenichnik_at_[hidden]>wrote:

> >
> > codepad.org is down so i just attached a toy programm with an
> > implementation of this technique (works at least in msvc10)
>
> Please at least include required headers and add 'using' directives to
> the attached code, so that it will be enough to compile :)

What does this have to do with boost::shared_ptr?

If you are requesting a feature where delete p does the same thing as
p.reset(), that sounds like a very bad idea to me, because the expected
semantics of the former (that the object is destroyed) is not what you get
with the latter (the object is only destroyed when no one owns it). Not to
mention error-prone as smart pointers should be discouraging people from
ever explicitly delete-ing objects.

-- 
 Nevin ":-)" Liber  <mailto:nevin_at_[hidden]>  (847) 691-1404

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