Boost logo

Boost :

From: Larry Evans (cppljevans_at_[hidden])
Date: 2003-11-23 22:28:46

On 10/27/2003 01:34 PM, David B. Held wrote:
> The latest version is in the Sandbox now under "latest".
I believe I've found a few bugs in the code.>
   P ref_counted::clone(P const& a_val)

which means a clone of P is returned, which is consistent with the name;
however, it's used to assign to, e.g. the scalar_storage::pointee_ in
the portion of the smart_ptr copy CTOR code below:

         smart_ptr(copy_arg rhs)
         : base_type(static_cast<copy_base>(rhs))
         { get_impl_ref(*this) = ownership_policy::clone(get_impl(rhs));

So, the return value should be P* not a P. In addition, get_impl(rhs),
which is storage_policy::get_impl(rhs), returns a P* instead of
the (P const&) which is declared as the argument to clone.

Please let me know if I'm wrong.


Boost list run by bdawes at, gregod at, cpdaniel at, john at