From: Gregory Colvin (gregory.colvin_at_[hidden])
Date: 2003-10-01 14:49:01
It's an important feature of shared_ptr that it doesn't care how the
pointee gets allocated. So one could use the shifted_ptr allocation
strategy with shared_ptr, and get the advantages of co-allocating the
pointee and the count. But what you couldn't get is the smaller
size of shifted_ptr, because there is no way to tell shared_ptr how
to navigate from the pointer to the associated count.
On Wednesday, Oct 1, 2003, at 13:07 America/Denver,
> On 10/01/2003 11:33 AM, Douglas Paul Gregor wrote:
>> On Wed, 1 Oct 2003 cppljevans_at_[hidden] wrote:
>>> Why couldn't the shifted_ptr(T*) be replaced with
>>> shifted_ptr(make_shifted_ptr<T>&), where make_shifted_ptr<T> is
>>> simply derived from auto_ptr but has no make_shifted_ptr(T*) CTOR?
>> Heck, with the types of syntax we're discussing, where we move the
>> memory allocation into the library, shifted_ptr could become an
>> implementation detail of shared_ptr. We'd get the efficiency benefits
>> shifted_ptr without the safety problems.
> Sounds good to me.
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk