|
Boost : |
From: Beman Dawes (beman_at_[hidden])
Date: 2000-01-14 10:35:36
At 03:11 PM 1/13/00 -0800, Boris Fomitchev wrote:
>"greg colvin" <gcolvi-_at_[hidden]> wrote:
>original article:http://www.egroups.com/group/boost/?start=1771
>
>> > * Since the smart point goes in an iterator, it would be better
to
>> > avoid the size and separate allocation penalty of shared_ptr.
>> >
>> > * Memory allocation should use the container's Allocator.
>> >
>> > * The smart pointer needs to support construction from a raw
>pointer
>> > when other smart pointers to the same object are known to exist,
but
>> > are not available. This means there needs to be a constructor
which
>> > increments the reference count rather than just setting it to 1.
>
>I do believe that, for this purpose, "reference body technique"
serves
>better
>than invasiveness as long as you control allocation (please see
> http://www.boost.org/more/count_bdy.htm for details).
Good point. I had actually reread Kevlin's
http://www.boost.org/more/count_bdy.htm paper recently, but for the
B-tree requirements it seemed to me to be excess complexity. Ditto
Greg's weak_ptr<>. So I will just do something specific for the
B-tree implementation; when boost gets some kind of a smart pointer
which meets the requirements it will be easy enough to switch to that
new smart pointer.
Thanks for all the comments,
--Beman
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk