|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2002-07-23 11:50:32
"Philippe A. Bouchard" <philippeb_at_[hidden]> wrote in message
news:ahk0in$gk6$1_at_main.gmane.org...
> It seems you cannot use it with typenames that easily; it depends on
> virtual tables and you'll have to prepare your pointee type similarly to
> detail::counted_base derivatives. I'm still not convinced this
> complexity / benefits ratio is better.
I'm not sure what your first objection means, but it seems that you
don't quite understand how the policy-based smart pointers work.
First of all, I'm not aware of any smart pointer type that calls through
a virtual table. That would seem like a rather extravagant way to go
that most people would be unwilling to pay for. Secondly, while you
can use a counted_base type intrusive pointer with most of the
policy-based implementations, the whole point of policy-based
design is *choice*. You can just as easily choose an external
count or a wrapped count. What Gennadiy was suggesting is:
See if you can't write your squad_ptr as a policy set for one of the
policy-based pointers. Right now, that's a little tricky, since they
aren't all well-documented and thoroughly tested. But the advantage
of writing it as a policy set is that it makes it easier to define
interoperability conversions between similar but different pointers.
Also, it reduces the proliferation of smart pointer headers (since a
good deal of your code is more or less identical to the various
smart pointers in Boost currently).
Dave
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk