|
Boost : |
From: Peter Dimov (pdimov_at_[hidden])
Date: 2008-04-11 20:29:16
Daniel Frey:
>> I'd change the first argument of the new constructor to
>> detail::shared_count.
>
> Wouldn't that lead to an additional reference counter
> increment/decrement cycle?
Good point. It will in the usual case:
shared_ptr( detail::shared_count const & pn, Y* px );
which I admit I had in mind.
It won't if we use
shared_ptr( detail::shared_count pn, Y* px );
and swap(pn,pn_) as poor man's move.
Let me bring up something else. Should
shared_ptr(Y* p, D d);
call sp_accept_owner(this, p), or should it call sp_accept_owner(this, p,
&d'), where d' is the stored deleter?
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk