Boost logo

Boost Users :

From: Sohail Somani (sohail_at_[hidden])
Date: 2008-05-16 16:51:02


David Walthall wrote:
> Overall, it seems like using a shared_ptr for stack objects is
> misleading, and as a result, may eventually lead to difficult to trace
> bugs. Unless allocating and deallocating the object is a bottleneck in
> your code, the potential costs outweigh the benefits.

Yes, this was my general conclusion (i.e., I didn't actually do it!) For
freshly written code, I could not think of a case where I would suggest
a null deleter but that doesn't mean that there isn't one.

I think before adding a null deleter to Boost, it might be useful to
think about the cases in which it is necessary and whether they occur
enough to encourage its use. After all, if it is in Boost, chances are
that it is a proper way to do things.

-- 
Sohail Somani
http://uint32t.blogspot.com

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net