|
Boost : |
From: Greg Colvin (Gregory.Colvin_at_[hidden])
Date: 2002-08-29 16:06:53
At 01:24 PM 8/29/2002, Larry Evans wrote:
>Greg Colvin wrote:
>
>>At 11:31 AM 8/29/2002, Philippe A. Bouchard wrote:
>>
>[snip]
>
>>>
>>My guess is that placement new is necessary so that you
>>can capture the address of the shared object, yes?
>>
>>
>It's only purpose, I believe, is to avoid two allocations instead of
>one. In other words, instead of a detached reference count, as
>with shared_ptr, the reference count is allocated in the same
>block of memory as the object.
Which is what makes it possible to retrieve the counter, given
a pointer into the object, or vice versa. Or at least to do it
quickly. OK. But then I still say that ptr<T> can just hold an
actual T*, and the rest of Phillippe's machinery should be
unnecessary.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk