Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2006-01-29 23:22:16


On 01/29/2006 06:15 PM, David Maisonave wrote:
> "Larry Evans" <cppljevans_at_[hidden]> wrote in message
> news:<drafuf$v06$1_at_[hidden]>...
[snip]
>
>>I notice policy_ptr has a weak_ptr class. Does axter smart_ptr has
>>something similar to handle cycles in pointer graph?
>
>
> No. Currently it does not support weak_ptr, although it does support
> (pointee) comparison
>
> Semantics like weak_ptr. It does not support any other weak_ptr specific
> feature.
>
>
>>>the boost vault, and the class is ready for use.
>
>
>
>>I've compiled and run the policy_ptr tests with g++.
>
>
> Do you have any example code?
> I like to see some usage example for policy_ptr. Just looking at the
> policy_ptr code is very confusing, and it is hard to tell how to use it.
>

Do you mean the test driver code in libs/policy_ptr/test is very confusing?
In particular, do you find the std_ptr_shared_ptr_test.cpp confusing?

>
> No. In general, reference-link is able to out perform reference-count
> logic. Smart_ptr has a policy for both methods, where-as shared_ptr only
> does reference-count.
>
OTOH, policy_ptr, also based on Alexandrescu's smart pointer library,
and has, AFAICT, a reflinked policy in:

   boost-sandbox/boost/policy_ptr/policy/ref_linked.hpp

What might be interesting is to compare the two methods of specifying
policies. I know David Held at first did it one way, and then switched
to the current way for some reason. Maybe you could compare the pros
and cons to your method vs. Held's method.


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk