
12 Apr
2008
12 Apr
'08
12:29 a.m.
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?