
30 Mar
2006
30 Mar
'06
4:10 a.m.
On 03/29/2006 05:05 PM, Peter Dimov wrote:
make_shared_ptr<T>( a, b, c ) (or however we end up calling it) still has the advantage of being able to fold the two allocations into one.
I assume the two allocations are for the detached refcount and the referent. Wouldn't placing them in the same block of memory with a single call to new (and I assume this is what you mean by "fold the two allocations into one") mean that shared_ptr would have to change it's two deletes (1 for refcount and 1 for referent) into one? IOW, make_shared_ptr would not make the current shared_ptr but another type of smart pointer. Or am I missing something?