
"Larry Evans" <cppljevans@cox-internet.com> wrote in message news:<drafuf$v06$1@sea.gmane.org>...
On 01/24/2006 09:45 AM, David Maisonave wrote:
Since the current smart_ptr (policy_ptr) class at boost vault is on
hold, I like to propose adding the following smart_ptr class to the
boost library:
Could you eliminate the tabs and reformat to something like 75 or 80
columns to ease reading. An example is in
http://boost-consulting.com/vault/Memory. Also, boost convention is
.hpp (or hxx or something like that) extension instead of .h.
I didn't get a chance to see the above link. I'll try to cut it down to 100 columns. I find 80 to be too limiting, and most developers now days have access to editors with wider column view. On my editor, the 80 column point actually is in the center of my screen.
IMHO, the above class has more functional features, than the class
in
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.
In my performance test, the shared and COW policies along with
reference-link policy, are able to out perform the
boost::shared_ptr.
Could this be due to shared_ptr having two refcounts and smart_ptr
having just one?
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.