[policy_ptr]std_ptrs.hpp's include target missing & incomplete shared_ptr emulation

The file: std_ptrs.hpp contains: #include "policy/boost.hpp" yet there's no policy/boost.hpp. However, there is: boost_policies.hpp However, in that file, the shared_storage class, contains: detail::shared_count count_; IOW, count_, unlike that in shared_ptr, contains no information about the type of pointee_; hence, I can't understand how policy_ptr's smart_ptr<...>, can emulate boost's shared_ptr with existing policies. What have I missed?

On 05/04/2005 05:08 PM, Larry Evans wrote: [snip]
However, in that file, the shared_storage class, contains:
detail::shared_count count_;
IOW, count_, unlike that in shared_ptr, contains no information about the type of pointee_; hence, I can't understand how policy_ptr's smart_ptr<...>, can emulate boost's shared_ptr with existing policies.
What have I missed?
I missed that shared_count takes checked_deleter<U>() in: template <typename U> explicit shared_storage(U* p) : pointee_(p), count_(p, checked_deleter<U>(), p) which does contain information about the pointee_. OTOH, it also has an error: 3 args instead of 2. This, as well as other errors, are corrected in the obvious zip file at: http://boost-sandbox.sourceforge.net/vault/index.php?&direction=0&order=&directory=cppljevans I'll be happy to upload these to the sandbox with David's permission; however, I've not been able to contact him for several days :(

Larry Evans wrote:
On 05/04/2005 05:08 PM, Larry Evans wrote: [snip]
However, in that file, the shared_storage class, contains:
detail::shared_count count_;
IOW, count_, unlike that in shared_ptr, contains no information about the type of pointee_; hence, I can't understand how policy_ptr's smart_ptr<...>, can emulate boost's shared_ptr with existing policies.
What have I missed?
I missed that shared_count takes checked_deleter<U>() in:
template <typename U> explicit shared_storage(U* p) : pointee_(p), count_(p, checked_deleter<U>(), p)
which does contain information about the pointee_. OTOH, it also has an error: 3 args instead of 2. This, as well as other errors, are corrected in the obvious zip file at:
http://boost-sandbox.sourceforge.net/vault/index.php?&direction=0&order=&directory=cppljevans
I'll be happy to upload these to the sandbox with David's permission; however, I've not been able to contact him for several days :(
Go ahead and check in your changes. I won't be able to review them for a while though. Dave

On 05/05/2005 05:33 PM, David B. Held wrote: [snip]
I'll be happy to upload these to the sandbox with David's permission; however, I've not been able to contact him for several days :(
Go ahead and check in your changes. I won't be able to review them for a while though. OK. The .hpp files are now in sandbox. The smart_ptr_test.cpp is on its way.
participants (2)
-
David B. Held
-
Larry Evans