
From: boost-bounces@lists.boost.org [mailto:boost-bounces@lists.boost.org] On Behalf Of Kenny Riddile Sent: Thursday, March 17, 2011 3:09 PM To: boost@lists.boost.org 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