Why doesn't scoped_ptr have an additional template parameter to accept a deleter? Thanks Sohail
On 5/23/05, Sohail Somani
Why doesn't scoped_ptr have an additional template parameter to accept a deleter?
Because that would make it larger than sizeof (T*). I believe the general consensus on this is to use shared_ptr or perhaps the upcoming policy_ptr. -- Caleb Epstein caleb dot epstein at gmail dot com
Caleb Epstein wrote:
On 5/23/05, Sohail Somani
wrote: Why doesn't scoped_ptr have an additional template parameter to accept a deleter?
Because that would make it larger than sizeof (T*). I believe the general consensus on this is to use shared_ptr or perhaps the upcoming policy_ptr.
The size could be kept as is in the case that no deleter is specified, or even if a stateless deleter were specified. I'd like to see a deleter parameter to scoped_ptr. Another option is to use static_move_ptr (which I will probably renamed unique_ptr soon): http://www.kangaroologic.com/move_ptr/ Jonathan
participants (3)
-
Caleb Epstein
-
Jonathan Turkanis
-
Sohail Somani