|
Boost : |
Subject: Re: [boost] [shared_ptr] delete shared_ptr
From: Sid Sacek (ssacek_at_[hidden])
Date: 2011-03-18 02:40:52
From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]] On Behalf Of Kenny Riddile
Sent: Thursday, March 17, 2011 3:09 PM
To: boost_at_[hidden]
Subject: Re: [boost] [shared_ptr] delete shared_ptr
On 3/17/2011 2:13 PM, pavel wrote:
>> and at last can you please give a couple of reasons why delete'ing
>> smart pointers is a bad idea?
> Because it's a lie. "delete" should delete something, and not be
> overloaded
I don't necessarily agree that it's a lie.
I think it's simply stating an intention; the intention being that the current shared pointer is no longer interesting in the shared object; who cares if the shared object gets deleted under the covers. This is the mentality that one needs to have in a garbage-collected environment, since you get the same exact effect when you set a reference to null.
Having said that; I don't yet feel Pavel has convinced me that changing the shared_pr library will buy anything significant.
-Sid Sacek
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk